i want to insert title, in the first table(displayname, see above) and i want to insert description, in the second table(mainTable, see above)
Could you tell me the in single submission, i want to insert two databases.
How Hibernate Query looks like. thanks Thanks edward
Thank You<br />Edward
Reza Ravasizadeh
Ranch Hand
Joined: Jun 08, 2004
Posts: 177
posted
0
make store procedure at database side (T-sql in SQL server if I remember correctly )and call that store procedure in hibernate(should be possible I'm not aware about Hibernate)
Reza
Raminder Singh
Ranch Hand
Joined: Mar 01, 2002
Posts: 72
posted
0
for two tables say u have 2 hbm files(t1,t2) and 2 java persistance files(p1,p2) now while saving, write:
Call commit() whne u have saved objects of both classes representing ur tables.
hope it works......!!!
pascal betz
Ranch Hand
Joined: Jun 19, 2001
Posts: 547
posted
0
@Raminder: i think edward wants to insert two entries with the same FieldId ?? with your aproach hibernate will use two different IDs (unless you use "assigned" generator.
so probably you need to map the properties (Title, Description) of your class to two tables. in hibernate you use the <join> element for this.
perhaps you could also use a one-to-one relation with primary key association could do the trick if its a composition (you did not show any code...)
check the hibernate reference manual for those two things and see if they help...