com.taggercat.metadata
Class MetaDataReaderImpl

java.lang.Object
  extended by com.taggercat.metadata.MetaDataReaderImpl
All Implemented Interfaces:
MetaDataReader, java.io.Serializable

public class MetaDataReaderImpl
extends java.lang.Object
implements MetaDataReader, java.io.Serializable

This class is used to read the runtime metadata from the system tables, and merge in any additional Metadata from the Hibernate configuration.

See Also:
Serialized Form
 

Constructor Summary
MetaDataReaderImpl()
           
 
Method Summary
 java.util.Map getDerivations()
           
 java.lang.String getEntityNameForEditPageName(java.lang.String pageName)
          Get the primary entity name for the specified default edit page name.
 java.lang.String getEntityNameForSearchPageName(java.lang.String pageName)
          Get the primary entity name for the specified default search page name.
 java.util.Map<java.lang.String,MetaEntity> getMetaData()
           
 java.util.List<MetaEntity> getMetaEntities()
           
 MetaEntity getMetaEntity(java.lang.String entityName)
           
 java.util.Map<java.lang.String,MetaProperty> getMetaProperties(java.lang.String entityName)
           
 MetaProperty getMetaProperty(java.lang.String entityName, java.lang.String propertyName)
           
 java.lang.String getTenantName()
           
 void listEntities(java.lang.String filter)
           
 void listProperties(java.lang.String entityName)
          This is a debug type method that Lists the properties on the specified entity to System.out.
static void main(java.lang.String[] args)
           
 java.util.Map<java.lang.String,MetaEntity> readMetaData(org.hibernate.cfg.Configuration hbn8Config, org.hibernate.SessionFactory sessionFactory, java.lang.String tenantName)
           
 java.util.Map<java.lang.String,MetaEntity> reload(org.hibernate.SessionFactory sessionFactory)
          Reloads the metadata from the System tables, but does not use the mapping files.
 void setTenantName(java.lang.String tenantName)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MetaDataReaderImpl

public MetaDataReaderImpl()
Method Detail

readMetaData

public java.util.Map<java.lang.String,MetaEntity> readMetaData(org.hibernate.cfg.Configuration hbn8Config,
                                                               org.hibernate.SessionFactory sessionFactory,
                                                               java.lang.String tenantName)
                                                        throws java.lang.Exception
Specified by:
readMetaData in interface MetaDataReader
Throws:
java.lang.Exception

reload

public java.util.Map<java.lang.String,MetaEntity> reload(org.hibernate.SessionFactory sessionFactory)
                                                  throws java.lang.Exception
Description copied from interface: MetaDataReader
Reloads the metadata from the System tables, but does not use the mapping files. This is experimental at this time.

Specified by:
reload in interface MetaDataReader
Throws:
java.lang.Exception
Parameters:
sessionFactory - the session factory
Returns:
the metadata map

getEntityNameForSearchPageName

public java.lang.String getEntityNameForSearchPageName(java.lang.String pageName)
Get the primary entity name for the specified default search page name.

Specified by:
getEntityNameForSearchPageName in interface MetaDataReader
Parameters:
pageName -
Returns:
the entity name if found, otherwise null

getEntityNameForEditPageName

public java.lang.String getEntityNameForEditPageName(java.lang.String pageName)
Get the primary entity name for the specified default edit page name.

Specified by:
getEntityNameForEditPageName in interface MetaDataReader
Parameters:
pageName -
Returns:
the entity name if found, otherwise null

listEntities

public void listEntities(java.lang.String filter)
Specified by:
listEntities in interface MetaDataReader

listProperties

public void listProperties(java.lang.String entityName)
Description copied from interface: MetaDataReader
This is a debug type method that Lists the properties on the specified entity to System.out.

Specified by:
listProperties in interface MetaDataReader

getMetaProperty

public MetaProperty getMetaProperty(java.lang.String entityName,
                                    java.lang.String propertyName)
Specified by:
getMetaProperty in interface MetaDataReader

getMetaProperties

public java.util.Map<java.lang.String,MetaProperty> getMetaProperties(java.lang.String entityName)
Specified by:
getMetaProperties in interface MetaDataReader

getMetaEntity

public MetaEntity getMetaEntity(java.lang.String entityName)
Specified by:
getMetaEntity in interface MetaDataReader

getMetaEntities

public java.util.List<MetaEntity> getMetaEntities()
Specified by:
getMetaEntities in interface MetaDataReader

getMetaData

public java.util.Map<java.lang.String,MetaEntity> getMetaData()
Specified by:
getMetaData in interface MetaDataReader

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception
Parameters:
args -

getDerivations

public java.util.Map getDerivations()
Specified by:
getDerivations in interface MetaDataReader
Returns:
the derivations

setTenantName

public void setTenantName(java.lang.String tenantName)

getTenantName

public java.lang.String getTenantName()