1 9 package org.jboss.portal.setup.impl.dl.dbloader.hibernate; 10 11 12 import org.hibernate.engine.Mapping; 13 import org.hibernate.cfg.Mappings; 14 import org.hibernate.type.Type; 15 import org.hibernate.MappingException; 16 import org.hibernate.mapping.PersistentClass; 17 18 24 public class MappingImpl implements Mapping 25 { 26 MappingImpl(Mappings mappings) 27 { 28 m_mappings = mappings; 29 } 30 31 Mappings m_mappings; 32 33 36 public Type getIdentifierType(String persistentClass) throws MappingException 37 { 38 39 PersistentClass cl = m_mappings.getClass(persistentClass); 40 return m_mappings.getClass(persistentClass).getIdentifier().getType(); 41 42 } 43 44 public String getIdentifierPropertyName(String persistentClass) throws MappingException 45 { 46 return m_mappings.getClass(persistentClass).getIdentifierProperty().getName(); 47 } 48 49 public Type getPropertyType(String persistentClass, String propertyName) throws MappingException 50 { 51 PersistentClass cl = m_mappings.getClass(persistentClass); 52 return m_mappings.getClass(persistentClass).getProperty(propertyName).getType(); 53 } 54 55 } 56 | Popular Tags |