@EdmSingleton("SingletonWithName") public class NamedSingleton {
public void addEntityType(Class<?> cls, EntityType entityType) { EdmSingleton singletonAnno = cls.getAnnotation(EdmSingleton.class); if (singletonAnno == null) { return; } String singletonName = singletonAnno.name(); if (isNullOrEmpty(singletonName)) { singletonName = singletonAnno.value(); if (isNullOrEmpty(singletonName)) { // Use simple name of entity type if no name for the singleton is specified singletonName = entityType.getName(); } } String entityTypeName = entityType.getFullyQualifiedName(); LOG.debug("Creating Singleton named: {} for entity type: {}", singletonName, entityTypeName); builders.put(entityTypeName, new SingletonImpl.Builder() .setName(singletonName) .setTypeName(entityTypeName)); }
entityName = singleton.value();
@EdmSingleton public class SingletonSample {
public void addEntityType(Class<?> cls, EntityType entityType) { EdmSingleton singletonAnno = cls.getAnnotation(EdmSingleton.class); if (singletonAnno == null) { return; } String singletonName = singletonAnno.name(); if (isNullOrEmpty(singletonName)) { singletonName = singletonAnno.value(); if (isNullOrEmpty(singletonName)) { // Use simple name of entity type if no name for the singleton is specified singletonName = entityType.getName(); } } String entityTypeName = entityType.getFullyQualifiedName(); LOG.debug("Creating Singleton named: {} for entity type: {}", singletonName, entityTypeName); builders.put(entityTypeName, new SingletonImpl.Builder() .setName(singletonName) .setTypeName(entityTypeName)); }
@EdmSingleton("SingletonWithName") public class NamedSingleton {
@EdmSingleton public class SingletonSample {
/** * Entity singleton helper class. */ @EdmEntity @EdmSingleton private class EntitySingletonSample { @EdmProperty private String field; } }