-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: annotations hbm2ddl misses some fields in ddl creation
PostPosted: Thu Aug 03, 2006 7:35 pm 
Newbie

Joined: Tue Nov 22, 2005 6:26 pm
Posts: 1
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!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.