Hi ColinEberhardt ,
I have exactly the same problem.
Can you give me an example how to implement this:
Code:
What I do in this case is create a RefRoom, or RoomSummary entity which maps to the same table as Room but only includes the information required when I am retrieving Hotels
I hava the following
Code:
@Entity
@Name("shortQueryResult")
@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name="QUERYTYPE", discriminatorType=DiscriminatorType.STRING)
public class ShortQueryResult extends StandardEntity implements Serializable, Comparable<ShortQueryResult> {
protected BaseCategory query;
public void setQuery(BaseCategory query) {
this.anfrage = query;
}
and
Code:
@Entity(name="ShortQueryResultRef")
@Name("shortQueryResultRef")
public class ShortQueryResultRef extends ShortQueryResult {
@OneToOne(cascade={CascadeType.REMOVE, CascadeType.ALL}, fetch=FetchType.EAGER)
public BaseCategory getQuery() {
return query;
}
}
In my case I don't need the field query at all times. When I leave the field complete in ShortQueryResult class with no Inheritance and LAZY loading some fields in query are not availeble.
I hope you can give me an example.
Thanks
Andi