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

HibernateDomainExporter and composite-element #219

Closed
lallafa opened this Issue Aug 22, 2012 · 1 comment

Comments

Projects
None yet
2 participants
@lallafa

lallafa commented Aug 22, 2012

Our hibernate mapping uses composite-elements which leads to errors in the generated Q classes.

  <class name="Contact" table="CONTACT" mutable="false">
    <id name="id" column="ID">
      <generator class="increment" />
    </id>
    <property name="name" column="name" not-null="true" />
    <list name="phoneNumbers" table="CONTACT_PHONE_NUMBER" lazy="false">
        <key column="CONTACT_ID"/>
        <list-index column="INDEX" base="0"/>
        <composite-element class="PhoneNumber">
            <property name="type"/>
            <property name="number" />
        </composite-element>
    </list>
  </class>
public class Contact {

    protected long id;
    protected String name;
    protected List<PhoneNumber> phoneNumbers;

    public long getId() { return id; }
    public void setId(long id) { this.id = id; }

    public String getName() { return name; }
    public void setName(String name) { this.name = name; }

    public List<PhoneNumber> getPhoneNumbers() { return phoneNumbers; }
    public void setPhoneNumbers(List<PhoneNumber> phoneNumbers) {  this.phoneNumbers = phoneNumbers;  }
}

public class PhoneNumber {

    protected String type;
    protected String number;

    public String getNumber() { return number; }
    public void setNumber(String number) { this.number = number; }

    public String getType() { return type; }
    public void setType(String type) { this.type = type; }
}

The code generated Contact.phoneNumbers is:

@Generated("com.mysema.query.codegen.EntitySerializer")
public class QContact extends EntityPathBase<Contact> {
    ...
    public final ListPath<PhoneNumber, Path<PhoneNumber>> phoneNumbers = this.<PhoneNumber, Path<PhoneNumber>>createList("phoneNumbers", PhoneNumber.class, Path.class);
    ...
}

The errors are:

QContact.java:[25,43] type parameter com.mysema.query.types.Path<PhoneNumber> is not within its bound
QContact.java:[25,77] <A,E>createList(java.lang.String,java.lang.Class<? super A>,java.lang.Class<? super E>) in com.mysema.query.types.path.BeanPath<Contact> cannot be applied to <PhoneNumber,com.mysema.query.types.Path<PhoneNumber>>(java.lang.String,java.lang.Class<PhoneNumber>,java.lang.Class<com.mysema.query.types.Path>)

timowest added a commit that referenced this issue Aug 22, 2012

@timowest

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Sep 10, 2012

Member

Released in 2.7.3

Member

timowest commented Sep 10, 2012

Released in 2.7.3

@timowest timowest closed this Sep 10, 2012

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