if ( mappedEntity.getTuplizerMap() != null ) {
userSuppliedTuplizerImpls.putAll( mappedEntity.getTuplizerMap() );
}
// Build the dynamic-map tuplizer...
Tuplizer dynamicMapTuplizer;
String tuplizerImplClassName = ( String ) userSuppliedTuplizerImpls.remove( EntityMode.MAP );
if ( tuplizerImplClassName == null ) {
dynamicMapTuplizer = entityTuplizerFactory.constructDefaultTuplizer( EntityMode.MAP, em, mappedEntity );
}
else {
dynamicMapTuplizer = entityTuplizerFactory.constructTuplizer( tuplizerImplClassName, em, mappedEntity );
}
// then the pojo tuplizer, using the dynamic-map tuplizer if no pojo representation is available
Tuplizer pojoTuplizer;
tuplizerImplClassName = ( String ) userSuppliedTuplizerImpls.remove( EntityMode.POJO );
if ( mappedEntity.hasPojoRepresentation() ) {
if ( tuplizerImplClassName == null ) {
pojoTuplizer = entityTuplizerFactory.constructDefaultTuplizer( EntityMode.POJO, em, mappedEntity );
}
else {
pojoTuplizer = entityTuplizerFactory.constructTuplizer( tuplizerImplClassName, em, mappedEntity );
}
}
else {
pojoTuplizer = dynamicMapTuplizer;
}
// then dom4j tuplizer, if dom4j representation is available
Tuplizer dom4jTuplizer;
tuplizerImplClassName = ( String ) userSuppliedTuplizerImpls.remove( EntityMode.DOM4J );
if ( mappedEntity.hasDom4jRepresentation() ) {
if ( tuplizerImplClassName == null ) {
dom4jTuplizer = entityTuplizerFactory.constructDefaultTuplizer( EntityMode.DOM4J, em, mappedEntity );
}