}
private void addKeyFields(IModelEntity dataMartEntity) {
PersistentClass classMapping;
ClassMetadata classMetadata;
Type identifierType;
getDataSource().getHibernateConfiguration().buildMappings();//must be called
classMapping = getDataSource().getHibernateConfiguration().getClassMapping(dataMartEntity.getType());
if(classMapping == null ){
System.out.println("class mapping for entity [" + dataMartEntity.getType() + "] not found");
Iterator<PersistentClass> it = getDataSource().getHibernateConfiguration().getClassMappings();
while(it.hasNext()) {
PersistentClass pc = it.next();
System.out.println("-> [" + pc.getClass().getName() + "] not found");
}
}
classMetadata = getDataSource().getHibernateSessionFactory().getClassMetadata(dataMartEntity.getType());
identifierType = classMetadata.getIdentifierType();
List identifierPropertyNames = new ArrayList();
String[] propertyClass = null;
String[] type = null;
int[] scale = null;
int[] precision = null;
String identifierPropertyName = classMetadata.getIdentifierPropertyName();
if (identifierType.isComponentType()) {
ComponentType componentIdentifierType = (ComponentType)identifierType;
String[] subPropertyNames = componentIdentifierType.getPropertyNames();