A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
Win a copy of
Arduino in Action
this week in the
General Computing
forum!
A special promo:
Enter your blog post or vote on a blogger to be featured in an upcoming Journal
JavaRanch
»
Java Forums
»
Databases
»
Object Relational Mapping
Author
problem in using composite key
vishwas srivastava
Greenhorn
Joined: Apr 20, 2012
Posts: 1
posted
Sep 25, 2012 00:41:55
0
hi friend,
i m using composte key in this class but unable to find out where is the problem.
i have two table one is finyear and other is finyearperiods both contain two same coloum i.e
finyearid and ORGSTRUCTCODE.now help me to find out problem
<class name="FinancialYear" table="FINYEAR"> <composite-id name="uid" class="Compid"> <key-property name="financialYearId" column="FINYEARID" /> <key-property name="orgStructure" column="ORGSTRUCTCODE" /> </composite-id> <property name="description" column="DESCRIPTION" /> <property name="yearStartDate" column="STARTDATE" /> <property name="yearEndDate" column="ENDDATE" /> <property name="lock" column="ISCLOSED" type="true_false"/> <property name="isActive" column="ISACTIVE" type="true_false"/> <property name="financialPeriodType" column="FINANCIALPERIODTYPE" /> <bag name="financialPeriodList" lazy="false" cascade="all,delete-orphan"> <key> <column name="ORGSTRUCTCODE" /> <column name="FINYEARID" /> </key> <one-to-many class="FinancialPeriod" /> </bag> </class> <class name="FinancialPeriod" table="FINYEARPERIODS"> <id name="periodId" column="PERIODNUMBERID"> <generator class="uuid.hex"/> </id> <property name="periodStartDate" column="PERIODSTARTDATE" /> <property name="periodEndDate" column="PERIODENDDATE" /> <property name="orgcode" column="ORGSTRUCTCODE" /> <property name="locked" column="ISLOCKED" type="true_false" /> <property name="finyear2" column="FINYEARID" /> </class>
rohit chavan
Ranch Hand
Joined: Oct 08, 2010
Posts: 91
I like...
posted
Sep 25, 2012 02:24:08
0
Welcome to the ranch.
Can you please give the exact error that you are getting.
Also, make yourself familiar with the various tags available.
I agree. Here's the link:
http://aspose.com/file-tools
subject: problem in using composite key
Similar Threads
HBM mapping Problem
Lazy loading issue with composite primary keys
Mapping For CompositeID
Use of set tag in Hibernate mapping file for foreign key
Auto Generator in composite key
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter