private static Constructor getConstructor(PersistentClass persistentClass) { if ( persistentClass == null || !persistentClass.hasPojoRepresentation() ) { return null; } try { return ReflectHelper.getDefaultConstructor( persistentClass.getMappedClass() ); } catch (Throwable t) { return null; } }
private static Getter getGetter(Property mappingProperty) { if ( mappingProperty == null || !mappingProperty.getPersistentClass().hasPojoRepresentation() ) { return null; } final PropertyAccessStrategyResolver propertyAccessStrategyResolver = mappingProperty.getPersistentClass().getServiceRegistry().getService( PropertyAccessStrategyResolver.class ); final PropertyAccessStrategy propertyAccessStrategy = propertyAccessStrategyResolver.resolvePropertyAccessStrategy( mappingProperty.getClass(), mappingProperty.getPropertyAccessorName(), EntityMode.POJO ); final PropertyAccess propertyAccess = propertyAccessStrategy.buildPropertyAccess( mappingProperty.getPersistentClass().getMappedClass(), mappingProperty.getName() ); return propertyAccess.getGetter(); }
if ( persistentClass.hasPojoRepresentation() ) { bytecodeEnhancementMetadata = BytecodeEnhancementMetadataPojoImpl.from( persistentClass ); !persistentClass.hasPojoRepresentation() || !ReflectHelper.isFinalClass( persistentClass.getProxyInterface() ) ); if ( persistentClass.isAbstract() == null ) { isAbstract = persistentClass.hasPojoRepresentation() && ReflectHelper.isAbstractClass( persistentClass.getMappedClass() ); if ( !isAbstract && persistentClass.hasPojoRepresentation() && ReflectHelper.isAbstractClass( persistentClass.getMappedClass() ) ) { LOG.entityMappedAsNonAbstract(name); if ( persistentClass.hasPojoRepresentation() ) { entityNameByInheritenceClassMap.put( persistentClass.getMappedClass(), persistentClass.getEntityName() ); iter = persistentClass.getSubclassIterator(); entityMode = persistentClass.hasPojoRepresentation() ? EntityMode.POJO : EntityMode.MAP; final EntityTuplizerFactory entityTuplizerFactory = sessionFactory.getSessionFactoryOptions().getEntityTuplizerFactory(); final String tuplizerClassName = persistentClass.getTuplizerImplClassName( entityMode );
if ( componentBinding.getOwner().hasPojoRepresentation() ) { log.debugf( "Binding virtual component [%s] to owner class [%s]", role, componentBinding.getOwner().getClassName() ); componentBinding.setComponentClassName( componentBinding.getOwner().getClassName() ); componentBinding.setComponentClassName( explicitComponentClassName ); else if ( componentBinding.getOwner().hasPojoRepresentation() ) { log.tracef( "Attempting to determine component class by reflection %s", role ); final Class reflectedComponentClass;
public String getClassName(PersistentClass pc) { if (pc.hasPojoRepresentation() ) { return pc.getClassName(); } else { // todo: return null? throw new RuntimeException(pc + " does not have a pojo rep."); } }
public String getProxyInterfaceName(PersistentClass pc) { if (pc.hasPojoRepresentation() ) { return pc.getProxyInterfaceName(); } else { throw new RuntimeException(pc + " does not have a pojo rep."); } }
private static Constructor getConstructor(PersistentClass persistentClass) { if ( persistentClass == null || !persistentClass.hasPojoRepresentation() ) { return null; } try { return ReflectHelper.getDefaultConstructor( persistentClass.getMappedClass() ); } catch( Throwable t ) { return null; } }
private static Constructor getConstructor(PersistentClass persistentClass) { if ( persistentClass == null || !persistentClass.hasPojoRepresentation() ) { return null; } try { return ReflectHelper.getDefaultConstructor( persistentClass.getMappedClass() ); } catch( Throwable t ) { return null; } }
public String getClassName(PersistentClass pc) { if (pc.hasPojoRepresentation() ) { return pc.getClassName(); } else { // todo: return null? throw new ExporterException(pc + " does not have a pojo rep."); } }
public String getProxyInterfaceName(PersistentClass pc) { if (pc.hasPojoRepresentation() ) { return pc.getProxyInterfaceName(); } else { throw new ExporterException(pc + " does not have a pojo rep."); } }
private static Constructor getConstructor(PersistentClass persistentClass) { if ( persistentClass == null || !persistentClass.hasPojoRepresentation() ) { return null; } try { return ReflectHelper.getDefaultConstructor( persistentClass.getMappedClass() ); } catch( Throwable t ) { return null; } }
private static Constructor getConstructor(PersistentClass persistentClass) { if ( persistentClass == null || !persistentClass.hasPojoRepresentation() ) { return null; } try { return ReflectHelper.getDefaultConstructor( persistentClass.getMappedClass() ); } catch( Throwable t ) { return null; } }
/** * Generate a TuplizerLookup based on the given entity mapping and metamodel * definitions. * * @param mappedEntity The entity mapping definition. * @param em The entity metamodel definition. * @return A TuplizerLookup containing the appropriate Tuplizers. */ public static TuplizerLookup create(PersistentClass mappedEntity, EntityMetamodel em) { Tuplizer dynamicMapTuplizer = new DynamicMapTuplizer( em, mappedEntity ); Tuplizer pojoTuplizer = mappedEntity.hasPojoRepresentation() ? new PojoTuplizer( em, mappedEntity ) : dynamicMapTuplizer; Tuplizer dom4jTuplizer = mappedEntity.hasDom4jRepresentation() ? new Dom4jTuplizer( em, mappedEntity ) : null; return new TuplizerLookup(pojoTuplizer, dynamicMapTuplizer, dom4jTuplizer); }
private static Getter getGetter(Property mappingProperty) { if ( mappingProperty == null || !mappingProperty.getPersistentClass().hasPojoRepresentation() ) { return null; } PropertyAccessor pa = PropertyAccessorFactory.getPropertyAccessor( mappingProperty, EntityMode.POJO ); return pa.getGetter( mappingProperty.getPersistentClass().getMappedClass(), mappingProperty.getName() ); }
private static Getter getGetter(Property mappingProperty) { if ( mappingProperty == null || !mappingProperty.getPersistentClass().hasPojoRepresentation() ) { return null; } PropertyAccessor pa = PropertyAccessorFactory.getPropertyAccessor( mappingProperty, EntityMode.POJO ); return pa.getGetter( mappingProperty.getPersistentClass().getMappedClass(), mappingProperty.getName() ); }
private static Getter getGetter(Property mappingProperty) { if ( mappingProperty == null || !mappingProperty.getPersistentClass().hasPojoRepresentation() ) { return null; } PropertyAccessor pa = PropertyAccessorFactory.getPropertyAccessor( mappingProperty, EntityMode.POJO ); return pa.getGetter( mappingProperty.getPersistentClass().getMappedClass(), mappingProperty.getName() ); }
private static Getter getGetter(Property mappingProperty) { if ( mappingProperty == null || !mappingProperty.getPersistentClass().hasPojoRepresentation() ) { return null; } PropertyAccessor pa = PropertyAccessorFactory.getPropertyAccessor( mappingProperty, EntityMode.POJO ); return pa.getGetter( mappingProperty.getPersistentClass().getMappedClass(), mappingProperty.getName() ); }
/** * Generate a TuplizerLookup based on the given component mapping definition. * * @param component The component mapping definition. * @return A TuplizerLookup containing the appropriate Tuplizers. */ public static TuplizerLookup create(Component component) { PersistentClass owner = component.getOwner(); Tuplizer dmt = new DynamicMapComponentTuplizer(component); Tuplizer pt = owner.hasPojoRepresentation() && component.hasPojoRepresentation() ? new PojoComponentTuplizer(component) : dmt; Tuplizer d4jt = owner.hasDom4jRepresentation() ? new Dom4jComponentTuplizer(component) : null; return new TuplizerLookup(pt, dmt, d4jt); }
if ( component.getOwner().hasPojoRepresentation() ) { component.setComponentClassName( component.getOwner().getClassName() ); if ( component.getOwner().hasPojoRepresentation() ) { Class reflectedClass = reflectedPropertyClass( ownerClassName, parentProperty ); if ( reflectedClass != null ) {
boolean lazyAvailable = persistentClass.hasPojoRepresentation() && InterceptFieldEnabled.class.isAssignableFrom( persistentClass.getMappedClass() ); boolean hasLazy = false; mutable = persistentClass.isMutable(); isAbstract = persistentClass.isAbstract() || ( persistentClass.hasPojoRepresentation() && ReflectHelper.isAbstractClass( persistentClass.getMappedClass() ) );