private String buildEntityTypes(AnnotationEntitySetFactory entitySetFactory, AnnotationSingletonFactory singletonFactory) { AnnotationEntityTypeFactory entityTypeFactory = new AnnotationEntityTypeFactory(TYPE_NAME_RESOLVER); String entityContainerName = null; for (Class<?> entityClass : entityClasses) { EntityType entityType = entityTypeFactory.build(entityClass); getSchemaBuilder(entityType.getNamespace()).addType(entityType); if (isNullOrEmpty(entityContainerName)) { EdmEntity edmEntity = entityClass.getAnnotation(EdmEntity.class); if (edmEntity != null) { entityContainerName = edmEntity.containerName(); } } // Create and add EntitySet if an @EdmEntitySet annotation is present on the entity class entitySetFactory.addEntityType(entityClass, entityType); // Create and add Singleton if an @EdmSingleton annotation is present on the entity class singletonFactory.addEntityType(entityClass, entityType); } return entityContainerName; }
private String buildEntityTypes(AnnotationEntitySetFactory entitySetFactory, AnnotationSingletonFactory singletonFactory) { AnnotationEntityTypeFactory entityTypeFactory = new AnnotationEntityTypeFactory(TYPE_NAME_RESOLVER); String entityContainerName = null; for (Class<?> entityClass : entityClasses) { EntityType entityType = entityTypeFactory.build(entityClass); getSchemaBuilder(entityType.getNamespace()).addType(entityType); if (isNullOrEmpty(entityContainerName)) { EdmEntity edmEntity = entityClass.getAnnotation(EdmEntity.class); if (edmEntity != null) { entityContainerName = edmEntity.containerName(); } } // Create and add EntitySet if an @EdmEntitySet annotation is present on the entity class entitySetFactory.addEntityType(entityClass, entityType); // Create and add Singleton if an @EdmSingleton annotation is present on the entity class singletonFactory.addEntityType(entityClass, entityType); } return entityContainerName; }