public Object getPropertyValue(Object component, int i) throws HibernateException { return getters[i].get( component ); }
@Override protected Object executeForIntermediateField(String field, Object result) throws InstantiationException, IllegalAccessException { // set intermediate object association Getter getter = propertyAccessor.getGetter(result.getClass(), field); Setter setter = propertyAccessor.getSetter(result.getClass(), field); Object associate = getter.get(result); if (associate == null) { // there is no instance yet in referenced field associate = getter.getReturnType().newInstance(); } setter.set(result, associate, null); return associate; } }.resolve(alias, i);
@Ignore("need to convert, was originally written for the old value holder design (TextString, etc)") @Test public void testGetter() { obj.setString(expected); NakedPropertyAccessor accessor = new NakedPropertyAccessor(); Getter getter = accessor.getGetter(SimpleObject.class, "string"); assertEquals("string", expected, getter.get(obj)); assertEquals("string", expected, getter.getForInsert(obj, null, null)); }
public Object getParent(Object component) { return parentGetter.get( component ); }
public Query setProperties(Object bean) throws HibernateException { Class clazz = bean.getClass(); String[] params = getNamedParameters(); for (int i = 0; i < params.length; i++) { String namedParam = params[i]; try { Getter getter = ReflectHelper.getGetter(clazz, namedParam); Class retType = getter.getReturnType(); final Object object = getter.get( bean ); if ( Collection.class.isAssignableFrom(retType) ) { setParameterList( namedParam, (Collection) object ); } else if ( retType.isArray() ) { setParameterList( namedParam, (Object[]) object ); } else { setParameter( namedParam, object, guessType( getter.getReturnType() ) ); } } catch (PropertyNotFoundException pnfe) {} } return this; }
public Object getPropertyValue(Object entity, int i) throws HibernateException { return getters[i].get( entity ); }
public Query setProperties(Object bean) throws HibernateException { Class clazz = bean.getClass(); String[] params = getNamedParameters(); for (int i = 0; i < params.length; i++) { String namedParam = params[i]; try { Getter getter = ReflectHelper.getGetter( clazz, namedParam ); Class retType = getter.getReturnType(); final Object object = getter.get( bean ); if ( Collection.class.isAssignableFrom( retType ) ) { setParameterList( namedParam, ( Collection ) object ); } else if ( retType.isArray() ) { setParameterList( namedParam, ( Object[] ) object ); } else { setParameter( namedParam, object, determineType( namedParam, retType ) ); } } catch (PropertyNotFoundException pnfe) { // ignore } } return this; }
public Object getParent(Object component) { return parentGetter.get( component ); }
public Object getPropertyValue(Object component, int i) throws HibernateException { return getters[i].get( component ); }
public Object getPropertyValue(Object component, int i) throws HibernateException { return getters[i].get( component ); }
public Object getPropertyValue(Object entity, int i) throws HibernateException { return getters[i].get( entity ); }
public Object getParent(Object component) { return parentGetter.get( component ); }
public Object getPropertyValue(Object entity, int i) throws HibernateException { return getters[i].get( entity ); }
@SuppressWarnings( "unchecked" ) private void validateSubElements( ValidatableElement element, Object entity, List<InvalidValue> consolidatedInvalidValues ) { if ( element != null ) { for ( ValidatableElement subElement : element.subElements ) { Object component = subElement.getter.get( entity ); InvalidValue[] invalidValues = subElement.validator.getInvalidValues( component ); for ( InvalidValue invalidValue : invalidValues ) { consolidatedInvalidValues.add( invalidValue ); } validateSubElements( subElement, component, consolidatedInvalidValues ); } } }
public Object getVersion(Object entity) throws HibernateException { if ( !entityMetamodel.isVersioned() ) return null; return getters[ entityMetamodel.getVersionPropertyIndex() ].get( entity ); }
public Object getVersion(Object entity) throws HibernateException { if ( !entityMetamodel.isVersioned() ) return null; return getters[ entityMetamodel.getVersionPropertyIndex() ].get( entity ); }
public Object getVersion(Object entity) throws HibernateException { if ( !entityMetamodel.isVersioned() ) return null; return getters[ entityMetamodel.getVersionPropertyIndex() ].get( entity ); }
public Object[] getPropertyValues(Object entity) throws HibernateException { boolean getAll = shouldGetAllProperties( entity ); final int span = entityMetamodel.getPropertySpan(); final Object[] result = new Object[span]; for ( int j = 0; j < span; j++ ) { StandardProperty property = entityMetamodel.getProperties()[j]; if ( getAll || !property.isLazy() ) { result[j] = getters[j].get( entity ); } else { result[j] = LazyPropertyInitializer.UNFETCHED_PROPERTY; } } return result; }
public Object[] getPropertyValues(Object entity) throws HibernateException { boolean getAll = shouldGetAllProperties( entity ); final int span = entityMetamodel.getPropertySpan(); final Object[] result = new Object[span]; for ( int j = 0; j < span; j++ ) { StandardProperty property = entityMetamodel.getProperties()[j]; if ( getAll || !property.isLazy() ) { result[j] = getters[j].get( entity ); } else { result[j] = LazyPropertyInitializer.UNFETCHED_PROPERTY; } } return result; }
public Object[] getPropertyValues(Object entity) throws HibernateException { boolean getAll = shouldGetAllProperties( entity ); final int span = entityMetamodel.getPropertySpan(); final Object[] result = new Object[span]; for ( int j = 0; j < span; j++ ) { StandardProperty property = entityMetamodel.getProperties()[j]; if ( getAll || !property.isLazy() ) { result[j] = getters[j].get( entity ); } else { result[j] = LazyPropertyInitializer.UNFETCHED_PROPERTY; } } return result; }