Joined: Wed Nov 05, 2008 10:12 am Posts: 1
|
Hi,
I am using following code to user's list of subscribed applications.
Mapping:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="test">
<class name="ApplicationUserModel" table="APPLICATION_USERS" lazy="false">
<id name="userid" column="USER_ID" type="java.lang.String" length="20">
<generator class="assigned" />
</id>
<set name="subscription" table="USER_SUBSCRIPTION" cascade="all-delete-orphan" lazy="false" inverse="true">
<key column="USER_ID" />
<one-to-many class="UserSubscriptionModel" not-found="ignore"/>
</list>
</class>
<class name="UserSubscriptionModel" table="USER_SUBSCRIPTION" lazy="false">
<id name="id" column="ID" type="java.lang.String">
<generator class="guid" />
</id>
<property name="userid" column="USER_ID" type="java.lang.String" length="20" not-null="true"/>
</class>
</hibernate-mapping>
In MS SQL DB i have entries like
APPLICATION_USER Table
UID
TestUser01
USER_SUBSCRIPTION Table
UID
TestUser01 --------
Testuser01 --------
testuser01 --------
When I load application user obejct then only 1 entries comes from another table while it should be three. It looks that hibernate collections are case-sensitive.
Anu solution to get all 3 entries.
|
|