[hibernate-issues] [Hibernate-JIRA] Commented: (HBX-849) Tools does not insert @Type in POJOs for user types defined in reveng.xml
Reiner Saddey (JIRA)
noreply at atlassian.com
Tue Jan 26 09:21:30 EST 2010
[ http://opensource.atlassian.com/projects/hibernate/browse/HBX-849?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=35343#action_35343 ]
Reiner Saddey commented on HBX-849:
-----------------------------------
Mea culpa Max, as I just don't know how to provide a formal patch file I've attached it to this bug as a "normal" SVN patch file: [^HBX-849.patch]
> Tools does not insert @Type in POJOs for user types defined in reveng.xml
> -------------------------------------------------------------------------
>
> Key: HBX-849
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-849
> Project: Hibernate Tools
> Issue Type: Patch
> Components: hbm2java, reverse-engineer
> Environment: jboss-seam-1.1.0.GA, MySQL
> Reporter: Zeljko Trogrlic
> Assignee: Anthony Patricio
> Attachments: BasicPOJOClass.java, BasicPOJOClass.java, Ejb3PropertyGetAnnotation.ftl, HBX-849.patch, POJOClass.java
>
>
> I have created reveng.xml file:
> <hibernate-reverse-engineering>
> <table
> catalog="configuration"
> name="userdb_domain_acl">
> <column name="enabled" type="com.siemens.msm.model.mapping.BooleanEnumType" exclude="false"/>
> </table>
> </hibernate-reverse-engineering>
> and included it in build.xml:
> <jdbcconfiguration propertyfile="build.properties"
> packagename="${model.package}"
> revengfile="${project.home}/reveng.xml"/>
> Generated POJO attribute has proper type, but user type information is missing:
> @Column(name = "enabled")
> @Length(max = 42)
> public Boolean getEnabled() {
> ....
> so Hibernate reports error:
> 3:49:31,397 INFO [TableMetadata] table found: configuration.userdb_domain_acl
> 13:49:31,397 INFO [TableMetadata] columns: [id, enabled, tablename, domain]
> 13:49:31,397 WARN [ServiceController] Problem starting service persistence.units:ear=msmgui.ear,unitName=msmgui
> javax.persistence.PersistenceException: org.hibernate.HibernateException: Wrong column type: enabled, expected: varchar(
> 2)
> at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:698)
> at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:127)
> at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:264)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> Annotations should look like this:
> @Column(name = "enabled")
> @Type(type="booleanEnum")
> public Boolean getEnabled() {
> ...
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list