public static String getEntityNameByEntityTypeName ( EntityDataModel entityDataModel , String entityTypeName ) throws ODataEdmException { for ( EntitySet entitySet : entityDataModel . getEntityContainer ( ) . getEntitySets ( ) ) { if ( entitySet . getTypeName ( ) . equals ( entityTypeName ) ) { return entitySet . getName ( ) ; } } //If not found in EntitySet, try to find in Singletons for ( Singleton singleton : entityDataModel . getEntityContainer ( ) . getSingletons ( ) ) { if ( singleton . getTypeName ( ) . equals ( entityTypeName ) ) { return singleton . getName ( ) ; } } throw new ODataSystemException ( "Entity name not found in the entity data model for type: " + entityTypeName ) ; }
Get the Entity Name for a given Entity Type name through the Entity Data Model . This looks for entity in both EntitySets and Singletons in the container