dlmiles wrote:
Can you post your HBM.xml for class "com.pa.asset.orm.base.BaseAgent" ?
<class
name="Agent"
table="Agent" >
<id
name="UserName"
type="string"
column="UserName">
<generator class="assigned"/>
</id>
<property
name="FullName"
column="FullName"
type="string"
not-null="false"
length="50"
/>
<property
name="Created"
column="Created"
type="timestamp"
not-null="false"
length="23"
/>
<property
name="Grace"
column="Grace"
type="integer"
not-null="false"
length="10"
/>
<set name="MemberOfGroups" inverse="true">
<key column="UserName"/>
<one-to-many class="MemberOfGroup" />
</set>
<many-to-one
name="Person"
column="Person_ID"
class="Person"
not-null="false">
</many-to-one>
</class>
dlmiles wrote:
Can you post your table description for the table, in mysql "DESCRIBE myTable" ?
CREATE TABLE Agent (
UserName NVARCHAR(10) NOT NULL,
FullName NVARCHAR(50),
Expires DATETIME,
Person_ID INTEGER,
Grace INTEGER,
Created DATETIME
)
Go
CREATE INDEX PK_Agent ON Agent (UserName ASC)
Go
ALTER TABLE Agent ADD CONSTRAINT PK_Agent PRIMARY KEY (UserName)
Go
ALTER TABLE Agent ADD CONSTRAINT FK_Agent_PERSON FOREIGN KEY (Person_ID)
REFERENCES PERSON (ID)
ON DELETE RESTRICT
ON UPDATE RESTRICT
Go
dlmiles wrote:
Can you post the POJO or at least the getter/setters, constructor, field variables ?
// primary key
private java.lang.String userName;
// fields
private java.lang.String fullName;
private java.util.Date expires;
private java.lang.Integer grace;
private java.util.Date created;
// many to one
private com.pa.asset.orm.Person person;
// collections
private java.util.Set<com.pa.asset.orm.MemberOfGroup> memberOfGroups;
private java.util.Set<com.pa.asset.orm.Person> agentPerson;
Here are some of the different type of fields used in this mapping
Agent class is inherited from the class BaseAgent..and I am using hibernate with Spring 1.2.6 ,tomcat 5.5 and SQL server 2000