private void readObject(java.io.ObjectInputStream stream) throws ClassNotFoundException, IOException { stream.defaultReadObject(); constructor = ReflectHelper.getDefaultConstructor( mappedClass ); }
@Override public Object run() { try { return ReflectHelper.getDefaultConstructor( compositeIdClass ).newInstance(); } catch ( Exception e ) { throw new AuditException( e ); } } }
public PojoInstantiator(Class componentClass, ReflectionOptimizer.InstantiationOptimizer optimizer) { this.mappedClass = componentClass; this.isAbstract = ReflectHelper.isAbstractClass( mappedClass ); this.optimizer = optimizer; this.embeddedIdentifier = false; try { constructor = ReflectHelper.getDefaultConstructor(mappedClass); } catch ( PropertyNotFoundException pnfe ) { LOG.noDefaultConstructor(mappedClass.getName()); constructor = 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 PojoInstantiator( Class mappedClass, ReflectionOptimizer.InstantiationOptimizer optimizer, boolean embeddedIdentifier) { this.mappedClass = mappedClass; this.optimizer = optimizer; this.embeddedIdentifier = embeddedIdentifier; this.isAbstract = ReflectHelper.isAbstractClass( mappedClass ); try { constructor = ReflectHelper.getDefaultConstructor(mappedClass); } catch ( PropertyNotFoundException pnfe ) { LOG.noDefaultConstructor( mappedClass.getName() ); constructor = null; } }
@Override public T run() { try { return (T) ReflectHelper.getDefaultConstructor( collectionClass ).newInstance(); } catch (InstantiationException e) { throw new AuditException( e ); } catch (IllegalAccessException e) { throw new AuditException( e ); } catch (InvocationTargetException e) { throw new AuditException( e ); } } }
private static AuditStrategy initializeAuditStrategy( String auditStrategyName, Class<?> revisionInfoClass, PropertyData revisionInfoTimestampData, ServiceRegistry serviceRegistry) { AuditStrategy strategy; try { final Class<?> auditStrategyClass = loadClass( auditStrategyName, serviceRegistry ); strategy = (AuditStrategy) ReflectHelper.getDefaultConstructor( auditStrategyClass ).newInstance(); } catch (Exception e) { throw new MappingException( String.format( "Unable to create AuditStrategy [%s] instance.", auditStrategyName ), e ); } // Strategy-specific initialization strategy.postInitialize( revisionInfoClass, revisionInfoTimestampData, serviceRegistry ); return strategy; }
@Override public T run() { try { return (T) ReflectHelper.getDefaultConstructor( collectionClass ).newInstance(); } catch (InstantiationException e) { throw new AuditException( e ); } catch (IllegalAccessException e) { throw new AuditException( e ); } catch (InvocationTargetException e) { throw new AuditException( e ); } } }
@Override public Object run() { try { return ReflectHelper.getDefaultConstructor( componentClass ).newInstance(); } catch ( InstantiationException e ) { throw new AuditException( e ); } catch ( IllegalAccessException e ) { throw new AuditException( e ); } catch ( InvocationTargetException e ) { throw new AuditException( e ); } } }
@Override public void initialize(GeneratorType annotation, Class<?> propertyType) { Class<? extends ValueGenerator<?>> generatorType = annotation.type(); constructor = ReflectHelper.getDefaultConstructor( generatorType ); this.generationTiming = annotation.when().getEquivalent(); }
public DefaultRevisionInfoGenerator( String revisionInfoEntityName, Class<?> revisionInfoClass, Class<? extends RevisionListener> listenerClass, PropertyData revisionInfoTimestampData, boolean timestampAsDate, ServiceRegistry serviceRegistry) { this.revisionInfoEntityName = revisionInfoEntityName; this.timestampAsDate = timestampAsDate; this.revisionInfoClassConstructor = ReflectHelper.getDefaultConstructor( revisionInfoClass ); this.revisionTimestampSetter = ReflectionTools.getSetter( revisionInfoClass, revisionInfoTimestampData, serviceRegistry ); this.listenerManagedBean = resolveRevisionListenerBean( listenerClass, serviceRegistry ); this.sessionCacheCleaner = new SessionCacheCleaner(); }
@Override public Boolean run() { final Getter getter = ReflectionTools.getGetter( obj.getClass(), idPropertyData, getServiceRegistry() ); final Setter setter = ReflectionTools.getSetter( obj.getClass(), idPropertyData, getServiceRegistry() ); try { final Object subObj = ReflectHelper.getDefaultConstructor( getter.getReturnType() ).newInstance(); boolean ret = true; for ( IdMapper idMapper : ids.values() ) { ret &= idMapper.mapToEntityFromMap( subObj, data ); } if ( ret ) { setter.set( obj, subObj, null ); } return ret; } catch (Exception e) { throw new AuditException( e ); } } }
@Override public Object run() { try { final Object subObj = ReflectHelper.getDefaultConstructor( componentClass ).newInstance();
private void readObject(java.io.ObjectInputStream stream) throws ClassNotFoundException, IOException { stream.defaultReadObject(); constructor = ReflectHelper.getDefaultConstructor( mappedClass ); }
private void readObject(java.io.ObjectInputStream stream) throws ClassNotFoundException, IOException { stream.defaultReadObject(); constructor = ReflectHelper.getDefaultConstructor( mappedClass ); }
@Override public Object run() { try { return ReflectHelper.getDefaultConstructor( compositeIdClass ).newInstance(); } catch ( Exception e ) { throw new AuditException( e ); } } }
private static Constructor resolveConstructor(Class mappedPojoClass) { try { return ReflectHelper.getDefaultConstructor( mappedPojoClass); } catch ( PropertyNotFoundException pnfe ) { LOG.noDefaultConstructor( mappedPojoClass.getName() ); } 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; } }
@Override public void initialize(GeneratorType annotation, Class<?> propertyType) { Class<? extends ValueGenerator<?>> generatorType = annotation.type(); constructor = ReflectHelper.getDefaultConstructor( generatorType ); this.generationTiming = annotation.when().getEquivalent(); }
private static Constructor getConstructor(EntityBinding entityBinding) { if ( entityBinding == null || entityBinding.getEntity() == null ) { return null; } try { return ReflectHelper.getDefaultConstructor( entityBinding.getEntity().getClassReference() ); } catch( Throwable t ) { return null; } }