I have spent a bunch of hours hacking at this new task, and I am still
having issues. Everything a compiles fine, and I am able to retrieve the locations using the query "getLocations", but the data in
the collection tables is not being returned. No errors are generated.
I am logging the sql that is being used (using log4j) and it shows the
attempts to load the ReferralType collection for each location, but I guess it doesn't find anything. I put a sample of my table data below the mapping, and below that some of the SQL logs:
Thank you so much for looking at this!!
<hibernate-mapping default-lazy="false">
<class name="test.Location" table="location" >
<id name="id" column="id" type="java.lang.Integer">
</id>
<property name="location" column="location" type="java.lang.String"/>
<property name="street" column="street" type="java.lang.String"/>
<property name="city" column="city" type="java.lang.String"/>
<property name="state" column="state" type="java.lang.String"/>
<property name="zip" column="zip" type="java.lang.String"/>
<property name="hrContactEmail" column="hr_contact_email" type="java.lang.String"/>
<property name="isVisible" column="is_visible" type="java.lang.Boolean"/>
<list name="referralType" table="referral_type">
<key column="state" />
<list-index column="list_index" />
<one-to-many class="test.ReferralType" />
</list>
</class>
<class name="test.ReferralType" table="referral_type">
<id name="id" column="id" type="java.lang.Integer">
</id>
<property name="state" column="state" type="java.lang.String"/>
<property name="type" column="type" type="java.lang.String"/>
<list name="referralSubType" table="referral_subtype" >
<key column="id" />
<list-index column="list_index" />
<element type="string" column="subtype"/>
</list>
</class>
<query name="getLocations">
<![CDATA[
from test.Location location
where location.isVisible = true
order by location.location
]]>
</hibernate-mapping>
table location
"id","location","street","city","state","zip","hr_contact_email","is_visible"
1,"Syracuse, UT","add","Syracuse","UT","84075","email",1
2,"Murray, UT","add","Murray","UT","84107","email",1
12,"Henderson, NV","add","Henderson","NV","89014","email",1
14,"Summerlin, NV","add","Las Vegas","NV","89135","email",1
table referral_type
"id","state","type","list_index"
1,"UT","Internet",1
2,"UT","Referral",2
3,"NV","Newspaper",0
4,"NV","Internet",1
5,"NV","Referral",2
table referral_subtype
"id","subtype","list_index"
0,"Salt Lake Tribune",0
0,"Standard Examiner",1
0,"Daily Herald",2
0,"The Globe",3
0,"Deseret Morning News",4
0,"Utah Chronicle",5
0,"Other Publication (Specify)",6
1,"corp.com",0
1,"YahooHotJobs.com",1
1,"YourUtahJob.com",2
1,"Monster.com",3
1,"Craigslist.com",4
1,"Jobs.Utah.gov",5
1,"Other Website (Specify)",6
2,"CurrentEmployee",0
2,"Friend of Family",1
2,"Other (Specify",2
2008-06-12 12:59:56,565 DEBUG [http-8080-Processor24] jdbc.AbstractBatcher (AbstractBatcher.java:346) - select location0_.id as id5_, location0_.location as location5_, location0_.street as street5_, location0_.city as city5_, location0_.state as state5_, location0_.zip as zip5_, location0_.hr_contact_email as hr7_5_, location0_.is_visible as is8_5_ from location location0_ where location0_.is_visible=1 order by location0_.location
2008-06-12 12:59:56,572 DEBUG [http-8080-Processor24] jdbc.AbstractBatcher (AbstractBatcher.java:346) - select referralty0_.state as state1_, referralty0_.id as id1_, referralty0_.list_index as list4_1_, referralty0_.id as id6_0_, referralty0_.state as state6_0_, referralty0_.type as type6_0_ from referral_type referralty0_ where referralty0_.state=?
|