Hibernate version: 3.2 cr3
Hibernate annotation version: 3.2 cr1
I'm using hbm2ddl to create my database tables via annotations. This tool seems to work fine except that some fields are being skipped. It seems that this tool only generates database fields for functions that either start with 'get' or 'is', but misses other important fields such as ones that start with 'has' or 'can'. These fields are skipped even when I place a @Basic annotation above the function.
Is there a fix, configuration setting or a work around for this? Note that no exceptions are generated, the generated ddl just doesn't have the fields.
Here's sample code below. For brevity sake, I've left out the import statements.
@Entity
@Table(name="GroupItemAccess")
public class GroupItemAccess
{
private long m_ID;
private boolean m_isDeleted;
private boolean m_canCreate;
/**
* @return Returns the ID.
*/
@Id @GeneratedValue(strategy=GenerationType.IDENTITY)
public long getID()
{
return m_ID;
}
/**
* Set the id
* @param id the id to set
*/
public void setID(long id)
{
m_ID = id;
}
/**
* @return Returns the is deleted flag
*/
//This field gets generated fine in the ddl.
public boolean isDeleted()
{
return m_isDeleted;
}
/**
* @param deleted The deleted flag to set.
*/
public void setDeleted(boolean deleted)
{
m_isDeleted = deleted;
}
/**
* @return Returns the create.
*/
//Even with the @Basic annotation added, this field is ignored.
@Basic
public boolean canCreate()
{
return m_canCreate;
}
/**
* @param create The create to set.
*/
public void setCreate(boolean create)
{
m_canCreate = create;
}
}
Thanks!
|