Okay. Here is my hibernate mapping file. I'm just keeping it simple for now:
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping
PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="core">
<class name="core.Request"
table="REQUESTS">
<id name="id"
column="REQ_ID"
type="long">
<generator class="native"/>
</id>
<property name="created"/>
<joined-subclass name="core.Ticket"
table = "TICKET" >
<key column = "TICKET_ID" />
<property name="state" />
<property name="problem" />
<property name="resolution" />
</joined-subclass>
</class>
</hibernate-mapping>
And for the database schema:
Code:
create table REQUESTS (
REQ_ID bigint not null auto_increment,
created datetime,
primary key (REQ_ID)
)
create table TICKET (
TICKET_ID bigint not null,
state varchar(255),
problem varchar(255),
resolution varchar(255),
primary key (TICKET_ID)
)
alter table TICKET add index FK937B5F0C1B50D64E (TICKET_ID), add constraint FK937B5F0C1B50D64E foreign key (TICKET_ID) references REQUESTS (REQ_ID)
This is the schema generated by hibernate using SchemaExport.create()
This is really bugging me. I can iterate through all the Tickets (subclass). And once I iterate through them, I can load each one up using the session.load(classname,id) (since it's grabbing it from cached information), but I can't load them up directly, if they aren't in cache.
I've been troubleshooting this all weekend.