Search in sources :

Example 1 with ManyToMany

use of org.hibernate.jpamodelgen.xml.jaxb.ManyToMany in project hibernate-orm by hibernate.

the class XmlMetaEntity method parseAttributes.

private void parseAttributes(Attributes attributes) {
    XmlMetaSingleAttribute attribute;
    for (Id id : attributes.getId()) {
        ElementKind elementKind = getElementKind(id.getAccess());
        String type = getType(id.getName(), null, elementKind);
        if (type != null) {
            attribute = new XmlMetaSingleAttribute(this, id.getName(), type);
            members.add(attribute);
        }
    }
    if (attributes.getEmbeddedId() != null) {
        EmbeddedId embeddedId = attributes.getEmbeddedId();
        ElementKind elementKind = getElementKind(embeddedId.getAccess());
        String type = getType(embeddedId.getName(), null, elementKind);
        if (type != null) {
            attribute = new XmlMetaSingleAttribute(this, embeddedId.getName(), type);
            members.add(attribute);
        }
    }
    for (Basic basic : attributes.getBasic()) {
        parseBasic(basic);
    }
    for (ManyToOne manyToOne : attributes.getManyToOne()) {
        parseManyToOne(manyToOne);
    }
    for (OneToOne oneToOne : attributes.getOneToOne()) {
        parseOneToOne(oneToOne);
    }
    for (ManyToMany manyToMany : attributes.getManyToMany()) {
        if (parseManyToMany(manyToMany)) {
            break;
        }
    }
    for (OneToMany oneToMany : attributes.getOneToMany()) {
        if (parseOneToMany(oneToMany)) {
            break;
        }
    }
    for (ElementCollection collection : attributes.getElementCollection()) {
        if (parseElementCollection(collection)) {
            break;
        }
    }
    for (Embedded embedded : attributes.getEmbedded()) {
        parseEmbedded(embedded);
    }
}
Also used : ElementKind(javax.lang.model.element.ElementKind) Basic(org.hibernate.jpamodelgen.xml.jaxb.Basic) OneToOne(org.hibernate.jpamodelgen.xml.jaxb.OneToOne) EmbeddedId(org.hibernate.jpamodelgen.xml.jaxb.EmbeddedId) ManyToMany(org.hibernate.jpamodelgen.xml.jaxb.ManyToMany) EmbeddedId(org.hibernate.jpamodelgen.xml.jaxb.EmbeddedId) Id(org.hibernate.jpamodelgen.xml.jaxb.Id) ElementCollection(org.hibernate.jpamodelgen.xml.jaxb.ElementCollection) Embedded(org.hibernate.jpamodelgen.xml.jaxb.Embedded) OneToMany(org.hibernate.jpamodelgen.xml.jaxb.OneToMany) ManyToOne(org.hibernate.jpamodelgen.xml.jaxb.ManyToOne)

Aggregations

ElementKind (javax.lang.model.element.ElementKind)1 Basic (org.hibernate.jpamodelgen.xml.jaxb.Basic)1 ElementCollection (org.hibernate.jpamodelgen.xml.jaxb.ElementCollection)1 Embedded (org.hibernate.jpamodelgen.xml.jaxb.Embedded)1 EmbeddedId (org.hibernate.jpamodelgen.xml.jaxb.EmbeddedId)1 Id (org.hibernate.jpamodelgen.xml.jaxb.Id)1 ManyToMany (org.hibernate.jpamodelgen.xml.jaxb.ManyToMany)1 ManyToOne (org.hibernate.jpamodelgen.xml.jaxb.ManyToOne)1 OneToMany (org.hibernate.jpamodelgen.xml.jaxb.OneToMany)1 OneToOne (org.hibernate.jpamodelgen.xml.jaxb.OneToOne)1