use of org.eclipse.persistence.internal.jpa.metadata.structures.ArrayAccessor in project eclipselink by eclipse-ee4j.
the class JPAMetadataGenerator method generateEmbeddable.
/**
* Generate an Embeddable for the given OracleArrayTypeMetadata, and add
* it to the list of Embeddables on the XMLEntityMappings instance.
*/
protected void generateEmbeddable(OracleArrayTypeMetadata arrayTypeMetadata, CompositeDatabaseTypeWithEnclosedType dbType) {
// avoid double-processing
if (!embeddableAlreadyProcessed(arrayTypeMetadata.getJavaType())) {
EmbeddableAccessor embeddable = initEmbeddable(arrayTypeMetadata.getJavaType());
ArrayAccessor array;
if (dbType.getEnclosedType().isComposite()) {
array = generateArrayAccessor(ITEMS_FLD_STR, ITEMS_COL_STR, arrayTypeMetadata.getNestedType(), getGeneratedJavaClassName(arrayTypeMetadata.getNestedType(), defaultPackage));
} else {
array = generateArrayAccessor(ITEMS_FLD_STR, ITEMS_COL_STR, dbType.getEnclosedType().getTypeName());
}
embeddable.getAttributes().getArrays().add(array);
// set on the XMLEntityMappings instance
xmlEntityMappings.getEmbeddables().add(embeddable);
// track to avoid double processing
getGeneratedEmbeddables().add(arrayTypeMetadata.getJavaType());
}
}
use of org.eclipse.persistence.internal.jpa.metadata.structures.ArrayAccessor in project eclipselink by eclipse-ee4j.
the class XmlEntityMappingsGenerator method processArrayMapping.
/**
* Generate a MappingAccessor for a given ArrayMapping.
*/
protected static ArrayAccessor processArrayMapping(ArrayMapping mapping) {
ArrayAccessor arrayAccessor = new ArrayAccessor();
arrayAccessor.setName(mapping.getAttributeName());
arrayAccessor.setDatabaseType(mapping.getStructureName());
arrayAccessor.setAttributeType(ARRAYLIST_STR);
arrayAccessor.setTargetClassName(mapping.getStructureName());
ColumnMetadata column = new ColumnMetadata();
column.setName(mapping.getField().getName());
arrayAccessor.setColumn(column);
return arrayAccessor;
}
use of org.eclipse.persistence.internal.jpa.metadata.structures.ArrayAccessor in project eclipselink by eclipse-ee4j.
the class XmlEntityMappingsGenerator method processObjectArrayMapping.
/**
* Generate a MappingAccessor for a given ObjectArrayMapping.
*/
protected static ArrayAccessor processObjectArrayMapping(ObjectArrayMapping mapping) {
ArrayAccessor arrayAccessor = new ArrayAccessor();
arrayAccessor.setName(mapping.getAttributeName());
arrayAccessor.setDatabaseType(mapping.getStructureName());
arrayAccessor.setTargetClassName(mapping.getReferenceClassName());
arrayAccessor.setAttributeType(ARRAYLIST_STR);
ColumnMetadata column = new ColumnMetadata();
column.setName(mapping.getField().getName());
arrayAccessor.setColumn(column);
return arrayAccessor;
}
Aggregations