Search in sources :

Example 1 with SunCmpMappings

use of org.apache.openejb.jee.sun.SunCmpMappings in project tomee by apache.

the class SunConversion method convertModule.

public void convertModule(final EjbModule ejbModule, final EntityMappings entityMappings) {
    final Map<String, EntityData> entities = new TreeMap<>();
    if (entityMappings != null) {
        for (final Entity entity : entityMappings.getEntity()) {
            entities.put(entity.getDescription(), new EntityData(entity));
        }
    }
    // merge data from sun-ejb-jar.xml file
    final SunEjbJar sunEjbJar = getSunEjbJar(ejbModule);
    mergeEjbConfig(ejbModule, sunEjbJar);
    mergeEntityMappings(entities, ejbModule.getModuleId(), ejbModule.getEjbJar(), ejbModule.getOpenejbJar(), sunEjbJar);
    // merge data from sun-cmp-mappings.xml file
    final SunCmpMappings sunCmpMappings = getSunCmpMappings(ejbModule);
    if (sunCmpMappings != null) {
        for (final SunCmpMapping sunCmpMapping : sunCmpMappings.getSunCmpMapping()) {
            mergeEntityMappings(entities, ejbModule.getModuleId(), ejbModule, entityMappings, sunCmpMapping);
        }
    }
}
Also used : SunCmpMapping(org.apache.openejb.jee.sun.SunCmpMapping) Entity(org.apache.openejb.jee.jpa.Entity) SunEjbJar(org.apache.openejb.jee.sun.SunEjbJar) TreeMap(java.util.TreeMap) SunCmpMappings(org.apache.openejb.jee.sun.SunCmpMappings)

Aggregations

TreeMap (java.util.TreeMap)1 Entity (org.apache.openejb.jee.jpa.Entity)1 SunCmpMapping (org.apache.openejb.jee.sun.SunCmpMapping)1 SunCmpMappings (org.apache.openejb.jee.sun.SunCmpMappings)1 SunEjbJar (org.apache.openejb.jee.sun.SunEjbJar)1