Examples of JPAEdmBuilder


Examples of org.apache.olingo.odata2.processor.api.jpa.access.JPAEdmBuilder

     * ************************************************************
     */
    @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
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.