Class SingleEntityTypeGenerator

java.lang.Object
de.hybris.platform.odata2services.odata.schema.entity.SingleEntityTypeGenerator
All Implemented Interfaces:
EntityTypeGenerator, SchemaElementGenerator<List<org.apache.olingo.odata2.api.edm.provider.EntityType>,IntegrationObjectItemModel>
Direct Known Subclasses:
ComposedEntityTypeGenerator, LocalizedEntityTypeGenerator

@Deprecated(since="2211.FP1", forRemoval=true) public abstract class SingleEntityTypeGenerator extends Object implements EntityTypeGenerator
Deprecated, for removal: This API element is subject to removal in a future version.
Base implementation class for entity type generators, which generate either a single entity type or no entity types depending on certain conditions.
  • Constructor Details

    • SingleEntityTypeGenerator

      public SingleEntityTypeGenerator()
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • generate

      public List<org.apache.olingo.odata2.api.edm.provider.EntityType> generate(IntegrationObjectItemModel item)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Generates the schema element whose type is defined by T. Implementation checks whether this generator is applicable to the specified item by calling isApplicable(IntegrationObjectItemModel) and depending on the result proceeds to generateEntityType(IntegrationObjectItemModel) or returns an empty list.
      Specified by:
      generate in interface SchemaElementGenerator<List<org.apache.olingo.odata2.api.edm.provider.EntityType>,IntegrationObjectItemModel>
      Parameters:
      item - an item, for which an EDMX entity type has to be generated
      Returns:
      a list with a single generated entity type or an empty list, if this generator is not isApplicable().
    • isApplicable

      protected abstract boolean isApplicable(IntegrationObjectItemModel item)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Determines whether this generator is applicable to the specified item and can generate at least a single EDMX entity type.
      Parameters:
      item - an item, based on which the decision has to be made.
      Returns:
      true, if at least one entity type can be generated for the given item; false, otherwise.
    • generateEntityType

      protected org.apache.olingo.odata2.api.edm.provider.EntityType generateEntityType(IntegrationObjectItemModel item)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Generates a single entity type for the specified item delegating the entity parts creation to:
      • generateEntityTypeName(IntegrationObjectItemModel)
      • for the entity type name generation
      • propertiesGenerator
      • for the entity type properties generation
      • keyGenerator
      • for the entity type key generation. If the key is not generated, i.e. !Optional<Key>.isPresent(), an IllegalStateException is thrown.
      Parameters:
      item - an item to generate the EDMX entity type for.
      Returns:
      the generated entity type.
      Subclasses make sure never return null from this method. If item cannot be generated, then isApplicable(IntegrationObjectItemModel) should return false instead.
    • generateKey

      protected org.apache.olingo.odata2.api.edm.provider.Key generateKey(String name, List<org.apache.olingo.odata2.api.edm.provider.Property> properties)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • generateEntityTypeName

      protected abstract String generateEntityTypeName(IntegrationObjectItemModel item)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Generates name for the entity type being generated.
      Parameters:
      item - item, for which entity type is being generated.
      Returns:
      a valid EDMX entity type name.
    • setPropertiesGenerator

      public void setPropertiesGenerator(AbstractPropertyListGenerator generator)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • setKeyGenerator

      public void setKeyGenerator(KeyGenerator generator)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getPropertiesGenerator

      protected AbstractPropertyListGenerator getPropertiesGenerator()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getKeyGenerator

      protected KeyGenerator getKeyGenerator()
      Deprecated, for removal: This API element is subject to removal in a future version.