String entitySetName = edmEntitySet.name(); if (isNullOrEmpty(entitySetName)) { entitySetName = edmEntitySet.value();
public void addEntityType(Class<?> cls, EntityType entityType) { EdmEntitySet entitySetAnno = cls.getAnnotation(EdmEntitySet.class); if (entitySetAnno == null) { return; } String entitySetName = entitySetAnno.name(); if (isNullOrEmpty(entitySetName)) { entitySetName = entitySetAnno.value(); if (isNullOrEmpty(entitySetName)) { // Use automatically pluralized simple name of entity type if no name for the entity set is specified entitySetName = pluralize(entityType.getName()); } } String entityTypeName = entityType.getFullyQualifiedName(); LOG.trace("Creating EntitySet named: {} for entity type: {}", entitySetName, entityTypeName); builders.put(entityTypeName, new EntitySetImpl.Builder() .setName(entitySetName) .setTypeName(entityTypeName) .setIsIncludedInServiceDocument(entitySetAnno.includedInServiceDocument())); }
public void addEntityType(Class<?> cls, EntityType entityType) { EdmEntitySet entitySetAnno = cls.getAnnotation(EdmEntitySet.class); if (entitySetAnno == null) { return; } String entitySetName = entitySetAnno.name(); if (isNullOrEmpty(entitySetName)) { entitySetName = entitySetAnno.value(); if (isNullOrEmpty(entitySetName)) { // Use automatically pluralized simple name of entity type if no name for the entity set is specified entitySetName = pluralize(entityType.getName()); } } String entityTypeName = entityType.getFullyQualifiedName(); LOG.trace("Creating EntitySet named: {} for entity type: {}", entitySetName, entityTypeName); builders.put(entityTypeName, new EntitySetImpl.Builder() .setName(entitySetName) .setTypeName(entityTypeName) .setIsIncludedInServiceDocument(entitySetAnno.includedInServiceDocument())); }