Hi friends,
I'm trying to create mapping documents for classes with composite IDs using XDoclet. I have an entity class and an entityID class which holds the composite key. However, when I try to generate the doc using XDoclet, I get this error:
54 ) <<Class com.myco.myapp.dao.hibernate.entity.ImportGroupHibernateEntityID misses ID property>>
So does this meant that the entityID class also needs an ID property declared?
I've searched the Hibernate docs and this forum, XDoclet examples and docs and all over the net, but have only found bits and pieces; nothing that helps. So now I'm looking for a kind soul that could offer a pointer or two. My sincerest thanks in advance.
Here are my classes:
/** A business entity class representing an ImportGroup .
*
*
* @hibernate.class table="ImportGroup"
*/
public class ImportGroupHibernateEntity implements ImportGroup, Serializable, Cloneable
{
private ImportGroupHibernateEntityID id = null;
private Integer gRank = null;
private String text;
public void setImportGroupHibernateEntityID(ImportGroupHibernateEntityID igID)
{
id = igID;
}
/**
*
* @return
* @hibernate.id generator-class="assigned" type="com.myco.myapp.dao.hibernate.entity.ImportGroupHibernateEntityID"
*
*/
public ImportGroupHibernateEntityID getImportGroupHibernateEntityID()
{
return(id);
}
/**
*@hibernate.property column="C3"
* type="java.lang.Integer"
*/
public Integer getGRank()
{
return (gRank);
}
public void setGRank(Integer integer1)
{
gRank = integer1;
}
}
}
/** A composite id class for entity ImportGroup .
*
*
* @hibernate.class table="ImportGroup"
*/
public class ImportGroupHibernateEntityID implements Serializable, Cloneable
{
private String typID = null;
private String pTypID = null;
/**
* @return
* @hibernate.property column="C1"
* type="java.lang.String"
*/
public String getTypID()
{
return(typID);
}
public void setTypID(String string)
{
typID = string;
}
/**
* @return
* @hibernate.property column="C2"
* type="java.lang.String"
*/
public String getPTypID()
{
return(pTypID);
}
public void setPTypID(String string)
{
pTypID = string;
}
public boolean equals(Object o)
{
if (o == null) { return false; }
if (getClass().equals(o.getClass()) &&
typID.equals(((ImportGroupHibernateEntityID) o).getTypID()) &&
pTypID.equals(((ImportGroupHibernateEntityID) o).getPTypID()))
{
return true;
}
else
{
return false;
}
}
public int hashCode()
{
return typID.hashCode();
}
}
|