That's weird b/c I have Debugged that exact part of the code, and the Person object and its attributes seem to be set fine. Then again, I am a Hibernate newbie, so that presents a problem in itself.
My AbstractPerson is as follows:
Code:
/*
* WARNING: DO NOT EDIT THIS FILE. This is a generated file that is synchronized
* by MyEclipse Hibernate tool integration.
*
* Created Wed Mar 01 00:17:40 CST 2006 by MyEclipse Hibernate Tool.
*/
package com;
import java.io.Serializable;
/**
* A class that represents a row in the person table. You can customize the
* behavior of this class by editing the class, {@link Person()}. WARNING: DO
* NOT EDIT THIS FILE. This is a generated file that is synchronized by
* MyEclipse Hibernate tool integration.
*/
public abstract class AbstractPerson implements Serializable
{
/**
* The cached hash code value for this instance. Settting to 0 triggers
* re-calculation.
*/
private int hashValue = 0;
/** The composite primary key value. */
private java.lang.Integer pid;
/** The value of the professorsSet one-to-many association. */
private java.util.Set professorsSet;
/** The value of the studentsSet one-to-many association. */
private java.util.Set studentsSet;
/** The value of the studentsCoursesSet one-to-many association. */
private java.util.Set studentsCoursesSet;
/** The value of the simple ssn property. */
private java.lang.Integer ssn;
/** The value of the simple name property. */
private java.lang.String name;
/**
* Simple constructor of AbstractPerson instances.
*/
public AbstractPerson()
{
}
/**
* Constructor of AbstractPerson instances given a simple primary key.
*
* @param pid
*/
public AbstractPerson(java.lang.Integer pid)
{
this.setPid(pid);
}
/**
* Return the simple primary key value that identifies this object.
*
* @return java.lang.Integer
*/
public java.lang.Integer getPid()
{
return pid;
}
/**
* Set the simple primary key value that identifies this object.
*
* @param pid
*/
public void setPid(java.lang.Integer pid)
{
this.hashValue = 0;
this.pid = pid;
}
/**
* Return the value of the ssn column.
*
* @return java.lang.Integer
*/
public java.lang.Integer getSsn()
{
return this.ssn;
}
/**
* Set the value of the ssn column.
*
* @param ssn
*/
public void setSsn(java.lang.Integer ssn)
{
this.ssn = ssn;
}
/**
* Return the value of the name column.
*
* @return java.lang.String
*/
public java.lang.String getName()
{
return this.name;
}
/**
* Set the value of the name column.
*
* @param name
*/
public void setName(java.lang.String name)
{
this.name = name;
}
/**
* Return the value of the pid collection.
*
* @return Professors
*/
public java.util.Set getProfessorsSet()
{
return this.professorsSet;
}
/**
* Set the value of the pid collection.
*
* @param professorsSet
*/
public void setProfessorsSet(java.util.Set professorsSet)
{
this.professorsSet = professorsSet;
}
/**
* Return the value of the pid collection.
*
* @return Students
*/
public java.util.Set getStudentsSet()
{
return this.studentsSet;
}
/**
* Set the value of the pid collection.
*
* @param studentsSet
*/
public void setStudentsSet(java.util.Set studentsSet)
{
this.studentsSet = studentsSet;
}
/**
* Return the value of the pid collection.
*
* @return StudentsCourses
*/
public java.util.Set getStudentsCoursesSet()
{
return this.studentsCoursesSet;
}
/**
* Set the value of the pid collection.
*
* @param studentsCoursesSet
*/
public void setStudentsCoursesSet(java.util.Set studentsCoursesSet)
{
this.studentsCoursesSet = studentsCoursesSet;
}
/**
* Implementation of the equals comparison on the basis of equality of the
* primary key values.
*
* @param rhs
* @return boolean
*/
public boolean equals(Object rhs)
{
if (rhs == null)
return false;
if (!(rhs instanceof Person))
return false;
Person that = (Person) rhs;
if (this.getPid() == null || that.getPid() == null)
return false;
return (this.getPid().equals(that.getPid()));
}
/**
* Implementation of the hashCode method conforming to the Bloch pattern
* with the exception of array properties (these are very unlikely primary
* key types).
*
* @return int
*/
public int hashCode()
{
if (this.hashValue == 0)
{
int result = 17;
int pidValue = this.getPid() == null ? 0 : this.getPid().hashCode();
result = result * 37 + pidValue;
this.hashValue = result;
}
return this.hashValue;
}
}