Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Persistent property wrongly recognized as custom type #238

Closed
mirkosertic opened this issue Sep 25, 2012 · 5 comments
Closed

Persistent property wrongly recognized as custom type #238

mirkosertic opened this issue Sep 25, 2012 · 5 comments

Comments

@mirkosertic
Copy link

@mirkosertic mirkosertic commented Sep 25, 2012

Given the following code construct and xml mapping:

public interface ISomething {
}

public class Something implements ISomething {
}

public class Otherthing {
  private ISomething property
}
<hibernate-mapping default-access="field">
    <class name="Otherthing " table="lala">
        <many-to-one name="property" class="Something" lazy="false" fetch="join">
            <column name="SOMETHING_ID" length="40" />
        </many-to-one>

                      </class>
</hibernate-mapping>

Gives the following code:

    // custom
    public final Path<ISomething> property= new Path(forProperty("property"));

which does not compile at all.

timowest added a commit that referenced this issue Sep 25, 2012
@timowest
Copy link
Member

@timowest timowest commented Sep 25, 2012

This is now properly handled like this

public final QSomething property = new QSomething(forProperty("property"));
@mirkosertic
Copy link
Author

@mirkosertic mirkosertic commented Sep 26, 2012

Your fix introduced another problem:

Caused by: org.hibernate.MappingException: Could not determine type for: ch.bedag.gba.capitastra.dao.hibernate.usertypes.GenericEnumUserType, at table: Praefix, for columns: [org.hibernate.mapping.Column(idType)]
at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:306)
at org.hibernate.mapping.Property.getType(Property.java:82)
at com.mysema.query.jpa.codegen.HibernateDomainExporter.handleProperty(HibernateDomainExporter.java:322)
at com.mysema.query.jpa.codegen.HibernateDomainExporter.collectTypes(HibernateDomainExporter.java:311)
at com.mysema.query.jpa.codegen.HibernateDomainExporter.execute(HibernateDomainExporter.java:230)
at ch.bedag.gba.maven.plugin.querydsl.HibernateExportMojo.execute(HibernateExportMojo.java:62)

This worked in the previous version.

@timowest
Copy link
Member

@timowest timowest commented Sep 29, 2012

The property types are needed now. I tried an Enum mapping with the standard Hibernate user type for enums and it worked

<class name="Entity">
  <id name="id">
    <generator class="native"/>
  </id>

  <property name="status">
    <type name="org.hibernate.type.EnumType">
       <param name="enumClass">com.mysema.query.jpa.domain13.Status</param>
    </type>
  </property>
</class>
timowest added a commit that referenced this issue Sep 29, 2012
@timowest
Copy link
Member

@timowest timowest commented Sep 29, 2012

Please open a new ticket if this can't be fixed in the configuration.

@timowest
Copy link
Member

@timowest timowest commented Sep 29, 2012

Released in 2.8.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants