Class JPADefaultEdmNameBuilder

java.lang.Object
com.sap.olingo.jpa.metadata.core.edm.mapper.impl.JPADefaultEdmNameBuilder
All Implemented Interfaces:
JPAEdmNameBuilder

public final class JPADefaultEdmNameBuilder extends Object implements JPAEdmNameBuilder
  • Constructor Details

    • JPADefaultEdmNameBuilder

      public JPADefaultEdmNameBuilder(String namespace)
  • Method Details

    • firstToLower

      public static String firstToLower(String substring)
    • firstToUpper

      public static String firstToUpper(String jpaAttributeName)
    • buildComplexTypeName

      public final String buildComplexTypeName(javax.persistence.metamodel.EmbeddableType<?> jpaEnbeddedType)
      EDM Complex Type Name - RULE:

      Use JPA Embeddable Type Simple Name as Complex Type Name

      Specified by:
      buildComplexTypeName in interface JPAEdmNameBuilder
      Returns:
    • buildContainerName

      public String buildContainerName()
      EDM EntityContainer Name - RULE:

      The Entity Container Name is build of EDM Namespace + Literal "Container". Container names are simple identifiers, so contain only letter, digits and underscores. However namespaces can contain also dots => eliminate dots and convert to camel case.

      Specified by:
      buildContainerName in interface JPAEdmNameBuilder
      Returns:
      non empty unique name of an Entity Set
    • buildEntitySetName

      public final String buildEntitySetName(String entityTypeName)
      EDM EntitySet Name - RULE:

      Use plural of entity type name. The naming bases on the assumption that English nouns are used.
      Entity Set Name = JPA Entity Type Name + Literal "s"

      Specified by:
      buildEntitySetName in interface JPAEdmNameBuilder
      Returns:
      non empty unique name of an Entity Set
    • buildEntityTypeName

      public String buildEntityTypeName(javax.persistence.metamodel.EntityType<?> jpaEntityType)
      EDM EntityType Name - RULE:

      Use JPA Entity Name as EDM Entity Type Name

      Specified by:
      buildEntityTypeName in interface JPAEdmNameBuilder
      Returns:
      non empty unique name of an Entity Type
    • getNamespace

      public final String getNamespace()
      Specified by:
      getNamespace in interface JPAEdmNameBuilder
      Returns:
      name space to a schema
    • buildNaviPropertyName

      public final String buildNaviPropertyName(javax.persistence.metamodel.Attribute<?,​?> jpaAttribute)
      EDM Navigation Property Name - RULE:

      OData requires: "The name of the navigation property MUST be unique within the set of structural and navigation properties of the containing structured type and any of its base types." This is fulfilled by taking the property name it self.

      Specified by:
      buildNaviPropertyName in interface JPAEdmNameBuilder
      Parameters:
      jpaAttribute -
      Returns:
    • buildPropertyName

      public final String buildPropertyName(String jpaAttributeName)
      EDM Property Name - RULE:

      OData Property Names are represented in Camel Case. The first character of JPA Attribute Name is converted to an UpperCase Character.

      Specified by:
      buildPropertyName in interface JPAEdmNameBuilder
      Parameters:
      jpaAttributeName -
      Returns:
    • buildOperationName

      public final String buildOperationName(String internalOperationName)
      Convert the internal name of a java based operation into the external entity data model name.
      Specified by:
      buildOperationName in interface JPAEdmNameBuilder
      Parameters:
      internalOperationName -
      Returns:
    • buildEnumerationTypeName

      public final String buildEnumerationTypeName(Class<? extends Enum<?>> javaEnum)
      Convert the internal java class name of an enumeration into the external entity data model name.
      Specified by:
      buildEnumerationTypeName in interface JPAEdmNameBuilder
      Parameters:
      javaEnum -
      Returns: