Forums Register Login

Having problem with inserting data into table using hibernate

+Pie Number of slices to send: Send
Hi guys,

I am having trouble with adding data into the database using hibernate .I have got a table 'ln_user_group' which has 2 columns 'userid,groupname'. Both these fields act as a primary key

The Hibernate mapping file is as follows



I am using netbeansIDE and it automatically generates 2 POJO's of the table 'ln_user_group'

The 2 POJO's a given below..



And the other one is


Now i understand it creates 2 pojo's for generating a unique id , but i want to know how do i add data into this table 'ln_user_group'

My code for adding data into table is as follows:



but i don't thing it will work. Can any one please tell me the write way to add data into this table
+Pie Number of slices to send: Send
The approach to use given auto generated classes to add record should be as follows:

They weren't very bright, but they were very, very big. Ad contrast:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1480 times.
Similar Threads
Adding data using hibernate for Composite primary keys
hibernate composite key problem
Error when inserting data in hibernate
Problem with inserting new data into database using hibernate
Problem mapping pojo with view using hibernate
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 15, 2024 23:24:47.