/**
* Returns the identifier type of a mapped class
*/
public Type getIdentifierType(String entityName) throws MappingException {
PersistentClass pc = classes.get( entityName );
if ( pc == null ) {
throw new MappingException( "persistent class not known: " + entityName );
}
return pc.getIdentifier().getType();
}
public String getIdentifierPropertyName(String entityName) throws MappingException {
final PersistentClass pc = classes.get( entityName );
if ( pc == null ) {
throw new MappingException( "persistent class not known: " + entityName );
}
if ( !pc.hasIdentifierProperty() ) {
return null;
}
return pc.getIdentifierProperty().getName();
}
public Type getReferencedPropertyType(String entityName, String propertyName) throws MappingException {
final PersistentClass pc = classes.get( entityName );
if ( pc == null ) {
throw new MappingException( "persistent class not known: " + entityName );
}
Property prop = pc.getReferencedProperty( propertyName );
if ( prop == null ) {
throw new MappingException(
"property not known: " +
entityName + '.' + propertyName
);