* ************************************************************
*/
@Override
public void build() throws ODataJPAModelException, ODataJPARuntimeException {
JPAEdmBuilder keyViewBuilder = null;
properties = new ArrayList<Property>();
List<Attribute<?, ?>> jpaAttributes = null;
String currentEntityName = null;
String targetEntityName = null;
String entityTypeName = null;
if (isBuildModeComplexType) {
jpaAttributes = sortInAscendingOrder(complexTypeView.getJPAEmbeddableType()
.getAttributes());
entityTypeName = complexTypeView.getJPAEmbeddableType().getJavaType()
.getSimpleName();
} else {
jpaAttributes = sortInAscendingOrder(entityTypeView.getJPAEntityType()
.getAttributes());
entityTypeName = entityTypeView.getJPAEntityType().getName();
}
for (Object jpaAttribute : jpaAttributes) {
currentAttribute = (Attribute<?, ?>) jpaAttribute;
// Check for need to Exclude
if (isExcluded((JPAEdmPropertyView) JPAEdmProperty.this, entityTypeName, currentAttribute.getName())) {
continue;
}
PersistentAttributeType attributeType = currentAttribute
.getPersistentAttributeType();
switch (attributeType) {
case BASIC:
currentSimpleProperty = new SimpleProperty();
JPAEdmNameBuilder
.build((JPAEdmPropertyView) JPAEdmProperty.this, isBuildModeComplexType);
EdmSimpleTypeKind simpleTypeKind = JPATypeConvertor
.convertToEdmSimpleType(currentAttribute
.getJavaType(), currentAttribute);
currentSimpleProperty.setType(simpleTypeKind);
JPAEdmFacets.setFacets(currentAttribute, currentSimpleProperty);
properties.add(currentSimpleProperty);
if (((SingularAttribute<?, ?>) currentAttribute).isId()) {
if (keyView == null) {
keyView = new JPAEdmKey(JPAEdmProperty.this);
keyViewBuilder = keyView.getBuilder();
}
keyViewBuilder.build();
}
break;
case EMBEDDED:
ComplexType complexType = complexTypeView