Jboss doesn't map my auto-generate entity class with hibernate-tools

617 views Asked by At

A strange thing happens when I put my auto-generated entity classes with hibernate-tools 3.2.4-GA into Jboss 6.1.0-Final. My persistence.xml has every class record with the correct entity:

<class>package.server.persistence.base.entity.Groups</class>

I found the issue in a hibernate-tools bug: here

My entity is generated with a strange new line near the last bracket:

/** * Groups generated by hbm2java */
@Entity
@Table(name="GROUPS"
)
public class Groups  implements java.io.Serializable {

if I manually set:

@Entity
@Table(name="GROUPS")
public class Groups...

Everything works fine:

2012-01-12 17:52:46,489 INFO [org.hibernate.cfg.AnnotationBinder] (http-0.0.0.0-8080-2) Binding entity from annotated class: package.server .persistence.base.entity.Groups 2012-01-12 17:52:46,490 INFO [org.hibernate.cfg.annotations.EntityBinder] (http-0.0.0.0-8080-2) Bind entity package.server.persistence.base.entity.Groups on table GROUPS

edit: if I made tests with jUnit entities are correctly configured, even if they have the "new line" on annotation. Thus, it seems a jboss issue.

Please, any help will be much appreciated.

1

There are 1 answers

2
jere On

this is, like you said, a bug in hibernate-tools. i ran into it when using jboss 6 in a previous project of mine as well.

it's currently unresolved and marked as a fix for hibernate 3.3.0beta1 but sadly there's no workaround or solution (at least that i know of) for it so far... guess you'll just have to wait