I am building a real estate website which has a concept of users, these users can have galleries (collections of properties that meet a certain criteria). If I want to load a page of public galleries from various users hibernate is also loading all of the users and all of their related user data and it seems quite slow. Is there a quicker/better way to just get a handle on those particular public galleries and the specific attributes I need to display - like I would with cfquery?
User.cfc
<cfproperty name="MemberID" column="MemberID" type="numeric" ormtype="int" fieldtype="id" generator="native" />
<cfproperty name="FirstName" column="FirstName" type="string" ormtype="string" notempty="true" display="First Name" />
<cfproperty name="LastName" column="LastName" type="string" ormtype="string" notempty="true" display="Last Name" />
...
<cfproperty name="Gallery" type="array" fieldtype="one-to-many" cfc="gallery" fkcolumn="memberID" lazy="true">
Gallery.cfc
<cfproperty name="name" column="name" type="string" ormtype="string" />
<cfproperty name="galleryID" column="galleryID" type="numeric" ormtype="int" fieldtype="id" generator="native" />
<cfproperty name="isPublic" column="isPublic" type="numeric" ormtype="int" default="0" />
<cfproperty name="created" column="created" type="date" ormtype="timestamp" />
<cfproperty name="User" fieldtype="many-to-one" cfc="User" fkcolumn="memberID" lazy="true">
Thanks!
Seth
http://groups.google.com/group/cf-orm-dev
Sean