private Class resolveComponentClass() { try { return getComponentClass(); } catch ( Exception e ) { return null; } }
javaType = component.getComponentClass();
public PojoInstantiator(Component component, ReflectionOptimizer.InstantiationOptimizer optimizer) { this( component.getComponentClass(), optimizer ); }
@Override protected void setComponentClass(Component component) { this.componentClass = component.getComponentClass(); }
private void checkCompositeIdentifier() { if ( getIdentifier() instanceof Component ) { Component id = (Component) getIdentifier(); if ( !id.isDynamic() ) { final Class idClass = id.getComponentClass(); if ( idClass != null ) { final String idComponentClassName = idClass.getName(); if ( !ReflectHelper.overridesEquals( idClass ) ) { LOG.compositeIdClassDoesNotOverrideEquals( idComponentClassName ); } if ( !ReflectHelper.overridesHashCode( idClass ) ) { LOG.compositeIdClassDoesNotOverrideHashCode( idComponentClassName ); } if ( !Serializable.class.isAssignableFrom( idClass ) ) { throw new MappingException( "Composite-id class must implement Serializable: " + idComponentClassName ); } } } } }
); if ( property.isComposite() && propertyDesc.isCascaded() ) { Class<?> componentClass = ( (Component) property.getValue() ).getComponentClass();
private Class resolveComponentClass() { try { return getComponentClass(); } catch ( Exception e ) { return null; } }
/** * Constructs a new {@code ProxyInstantiator} instance. * * @param component * the hibernate component to build this instantiator for. */ @SuppressWarnings("unchecked") public ProxyInstantiator(Component component) { componentContract = component.getComponentClass(); }
private Class resolveComponentClass() { try { return getComponentClass(); } catch ( Exception e ) { return null; } }
private Class resolveComponentClass() { try { return getComponentClass(); } catch (Exception e) { return null; } }
private static void applyDDL(String prefix, PersistentClass persistentClass, Class<?> clazz, ValidatorFactory factory, Set<Class<?>> groups, boolean activateNotNull) { final BeanDescriptor descriptor = factory.getValidator().getConstraintsForClass( clazz ); //no bean level constraints can be applied, go to the properties for ( PropertyDescriptor propertyDesc : descriptor.getConstrainedProperties() ) { Property property = findPropertyByName( persistentClass, prefix + propertyDesc.getPropertyName() ); boolean hasNotNull = false; if ( property != null ) { hasNotNull = applyConstraints( propertyDesc.getConstraintDescriptors(), property, propertyDesc, groups, activateNotNull ); if ( property.isComposite() && propertyDesc.isCascaded() ) { Class<?> componentClass = ( ( Component ) property.getValue() ).getComponentClass(); /* * we can apply not null if the upper component let's us activate not null * and if the property is not null. * Otherwise, all sub columns should be left nullable */ final boolean canSetNotNullOnColumns = activateNotNull && hasNotNull; applyDDL( prefix + propertyDesc.getPropertyName() + ".", persistentClass, componentClass, factory, groups, canSetNotNullOnColumns ); } //FIXME add collection of components } } }
protected Instantiator buildInstantiator(Component component) { return new PojoInstantiator( component.getComponentClass(), null, fastClass, false ); } protected Getter buildGetter(Component component, Property prop) {
protected Getter buildGetter(Component component, Property prop) { return prop.getGetter( component.getComponentClass() ); } protected Setter buildSetter(Component component, Property prop) {
protected Setter buildSetter(Component component, Property prop) { return prop.getSetter( component.getComponentClass() ); }
public PojoInstantiator(Component component, ReflectionOptimizer.InstantiationOptimizer optimizer) { this.mappedClass = component.getComponentClass(); this.isAbstract = ReflectHelper.isAbstractClass( mappedClass ); this.optimizer = optimizer; this.proxyInterface = null; this.embeddedIdentifier = false; try { constructor = ReflectHelper.getDefaultConstructor(mappedClass); } catch ( PropertyNotFoundException pnfe ) { LOG.noDefaultConstructor(mappedClass.getName()); constructor = null; } }
public ProxiedInstantiator(Component component) { proxiedClass = component.getComponentClass(); if ( proxiedClass.isInterface() ) { factory = Environment.getBytecodeProvider() .getProxyFactoryFactory() .buildBasicProxyFactory( null, new Class[] { proxiedClass } ); } else { factory = Environment.getBytecodeProvider() .getProxyFactoryFactory() .buildBasicProxyFactory( proxiedClass, null ); } }
public ProxiedInstantiator(Component component) { proxiedClass = component.getComponentClass(); if ( proxiedClass.isInterface() ) { factory = Environment.getBytecodeProvider() .getProxyFactoryFactory() .buildBasicProxyFactory( null, new Class[] { proxiedClass } ); } else { factory = Environment.getBytecodeProvider() .getProxyFactoryFactory() .buildBasicProxyFactory( proxiedClass, null ); } }
private void checkCompositeIdentifier() { if ( getIdentifier() instanceof Component ) { Component id = (Component) getIdentifier(); if ( !id.isDynamic() ) { final Class idClass = id.getComponentClass(); final String idComponendClassName = idClass.getName(); if (idClass != null && !ReflectHelper.overridesEquals(idClass)) LOG.compositeIdClassDoesNotOverrideEquals( idComponendClassName ); if (!ReflectHelper.overridesHashCode(idClass)) LOG.compositeIdClassDoesNotOverrideHashCode( idComponendClassName ); if (!Serializable.class.isAssignableFrom(idClass)) throw new MappingException( "Composite-id class must implement Serializable: " + idComponendClassName); } } }
protected Instantiator buildInstantiator(Component component) { if ( component.isEmbedded() && ReflectHelper.isAbstractClass( component.getComponentClass() ) ) { return new ProxiedInstantiator( component ); } if ( optimizer == null ) { return new PojoInstantiator( component, null ); } else { return new PojoInstantiator( component, optimizer.getInstantiationOptimizer() ); } }
protected Instantiator buildInstantiator(Component component) { if ( component.isEmbedded() && ReflectHelper.isAbstractClass( component.getComponentClass() ) ) { return new ProxiedInstantiator( component ); } if ( optimizer == null ) { return new PojoInstantiator( component, null ); } else { return new PojoInstantiator( component, optimizer.getInstantiationOptimizer() ); } }