facebook

[Closed] Realated to database explorer

  1. MyEclipse Archived
  2.  > 
  3. Database Tools (DB Explorer, Hibernate, etc.)
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #253537 Reply

    Prasanna
    Member

    Hii…
    Iam Using the Hibernate for an application to create an entity in the database.before using hibernate i have created the database profile in result i got Hibernate.cfg.xml and Session Factory class.
    Then i have chosen Open perspective—>myeclipse database explorer
    right clicked on profile and selected open connection and selected the employee table and right clicked on the table and clicked on “create hibernate mapping” —>next–>selected javatypes—>finish .
    when the above steps are carried out MySql created Hbm files and hibernate mapping classes. instead of getting one employee.java (i.e.,mapping class) class created it has created two classes by names
    1)employee.java (this contains the setter and getter method for id)
    2)employeeid.java(this contains the setter and getter methods for all the properties).
    Now iam unable to get the values in the servlet wjhich i wrote.
    please Can anyone help me out how to solve this issue?

    #253541 Reply

    Haris Peco
    Member

    Prasu,

    You haven’t primary key for table.Hibernate request ID value and default is to table’s primary key.If primary key doesn’t exists MyEclipse create ID from all columns (it is your EmployeesId classes).

    You have to have primary key (and foreign keys for more tables) for correct hibernate mappings

    Best regards

    #253572 Reply

    Prasanna
    Member

    Hii Sir
    Thanks alot .
    now iam able to do it .

    @support-snpe wrote:

    Prasu,

    You haven’t primary key for table.Hibernate request ID value and default is to table’s primary key.If primary key doesn’t exists MyEclipse create ID from all columns (it is your EmployeesId classes).

    You have to have primary key (and foreign keys for more tables) for correct hibernate mappings

    Best regards

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: [Closed] Realated to database explorer

You must be logged in to post in the forum log in