Problem with HibernateDomainExporter and bidirectional one-to-many associations #234

mirkosertic opened this Issue Sep 20, 2012 · 1 comment


None yet
2 participants

There is a problem with Hibernate bidirectional references:

Caused by: java.lang.IllegalArgumentException: No property found for ch.bedag.gba.capitastra.model.beschreibung.GbPlan._ch.bedag.gba.capitastra.model.beschreibung.GbPlanMaster.versionsBackref
at com.mysema.query.jpa.codegen.HibernateDomainExporter.getType(
at com.mysema.query.jpa.codegen.HibernateDomainExporter.handleProperty(
at com.mysema.query.jpa.codegen.HibernateDomainExporter.collectTypes(
at com.mysema.query.jpa.codegen.HibernateDomainExporter.execute(
at ch.bedag.gba.maven.plugin.querydsl.HibernateExportMojo.execute(

The exporter should check org.hibernate.mapping.Property.isBackRef() for every discovered property. If it is a backref, it must be ignored.

Iterator<?> properties = pc.getDeclaredPropertyIterator();
while (properties.hasNext()) {
    org.hibernate.mapping.Property theProperty = (org.hibernate.mapping.Property);
    if (!theProperty.isBackRef()) {
        handleProperty(entityType, pc.getMappedClass(), theProperty);

This comment has been minimized.

Show comment
Hide comment

timowest Sep 29, 2012


Released in 2.8.0


timowest commented Sep 29, 2012

Released in 2.8.0

@timowest timowest closed this Sep 29, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment