Hibernate version:
2.1.89
Mapping documents:
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="eha.dao.EzMemb" table="EHA.ezMemb" mutable="false">
<cache usage="read-only" />
<id name="membid" type="string">
<generator class="assigned"/>
</id>
<property name="subssn"/>
<property name="lastnm"/>
<property name="firstnm"/>
<property name="mi"/>
<property name="patid"/>
<property name="sex"/>
<property name="street"/>
<property name="city"/>
<property name="state"/>
<property name="zip"/>
<property name="phone"/>
<property name="birth" type="date"/>
<property name="hpCode"/>
<set name="claims" sort="natural" lazy="true">
<key column="membid"/>
<one-to-many class="eha.dao.Claim"/>
</set>
<set name="providerHistory" sort="natural" lazy="true">
<key column="membid"/>
<one-to-many class="eha.dao.EzMembPcp"/>
</set>
<set name="healthPlans" sort="natural" lazy="true">
<key column="membid"/>
<one-to-many class="eha.dao.EzMembHp"/>
</set>
</class>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():Code:
retList = getHibernateTemplate().find(
"FROM EzMemb m " +
"WHERE m.patid = ?",
member.getPatid()
);
Util.debug(Integer.toString(retList.size()));
Name and version of the database you are using:
SQL Server 2000 with JTDS
The generated SQL (show_sql=true):
Hibernate: select ... from EHA.ezMemb familymemb0_ where (familymemb0_.patid=? )
I plug the generated SQL directly into the database with the ID from the debugger and I get n records. However, when I run that code the size of the returned list is always 2n. Anyone seen this before? Thanks!