/** * Instantiate the object by executing the method on the transformer. */ protected Object instantiate() throws DescriptorException { return instantiate(getObject(), getSession()); }
/** * Triggers UnitOfWork valueholders directly without triggering the wrapped * valueholder (this). * <p> * When in transaction and/or for pessimistic locking the UnitOfWorkValueHolder * needs to be triggered directly without triggering the wrapped valueholder. * However only the wrapped valueholder knows how to trigger the indirection, * i.e. it may be a batchValueHolder, and it stores all the info like the row * and the query. * Note: This method is not thread-safe. It must be used in a synchronized manner */ public Object instantiateForUnitOfWorkValueHolder(UnitOfWorkValueHolder unitOfWorkValueHolder) { return instantiate(getObject(), unitOfWorkValueHolder.getUnitOfWork()); }
/** * INTERNAL: * Return the value to be stored in the object's attribute. * This value is determined by invoking the appropriate * method on the object and passing it the row and session. * In this case, wrap the row in a ValueHolder for later use. */ public Object valueFromMethod(Object object, AbstractRecord row, AbstractSession session) { return new TransformerBasedValueHolder(this.getTransformationMapping().getAttributeTransformer(), object, row, session); }
protected Object instantiate(Object object, AbstractSession session) throws DescriptorException { try { return transformer.buildAttributeValue(getRow(), object, session); } catch (DescriptorException ex) { Throwable nestedException = ex.getInternalException(); if (nestedException instanceof IllegalAccessException) { throw DescriptorException.illegalAccessWhileInstantiatingMethodBasedProxy(nestedException); } else if (nestedException instanceof IllegalArgumentException) { throw DescriptorException.illegalArgumentWhileInstantiatingMethodBasedProxy(nestedException); } else if (nestedException instanceof InvocationTargetException) { throw DescriptorException.targetInvocationWhileInstantiatingMethodBasedProxy(nestedException); } else { throw ex; } } }
/** * Triggers UnitOfWork valueholders directly without triggering the wrapped * valueholder (this). * <p> * When in transaction and/or for pessimistic locking the UnitOfWorkValueHolder * needs to be triggered directly without triggering the wrapped valueholder. * However only the wrapped valueholder knows how to trigger the indirection, * i.e. it may be a batchValueHolder, and it stores all the info like the row * and the query. * Note: This method is not thread-safe. It must be used in a synchronized manner */ public Object instantiateForUnitOfWorkValueHolder(UnitOfWorkValueHolder unitOfWorkValueHolder) { return instantiate(getObject(), unitOfWorkValueHolder.getUnitOfWork()); }
/** * INTERNAL: * Return the value to be stored in the object's attribute. * This value is determined by invoking the appropriate * method on the object and passing it the row and session. * In this case, wrap the row in a ValueHolder for later use. */ public Object valueFromMethod(Object object, AbstractRecord row, AbstractSession session) { return new TransformerBasedValueHolder(this.getTransformationMapping().getAttributeTransformer(), object, row, session); }
protected Object instantiate(Object object, AbstractSession session) throws DescriptorException { try { return transformer.buildAttributeValue(getRow(), object, session); } catch (DescriptorException ex) { Throwable nestedException = ex.getInternalException(); if (nestedException instanceof IllegalAccessException) { throw DescriptorException.illegalAccessWhileInstantiatingMethodBasedProxy(nestedException); } else if (nestedException instanceof IllegalArgumentException) { throw DescriptorException.illegalArgumentWhileInstantiatingMethodBasedProxy(nestedException); } else if (nestedException instanceof InvocationTargetException) { throw DescriptorException.targetInvocationWhileInstantiatingMethodBasedProxy(nestedException); } else { throw ex; } } }
/** * Instantiate the object by executing the method on the transformer. */ protected Object instantiate() throws DescriptorException { return instantiate(getObject(), getSession()); }
/** * Triggers UnitOfWork valueholders directly without triggering the wrapped * valueholder (this). * <p> * When in transaction and/or for pessimistic locking the UnitOfWorkValueHolder * needs to be triggered directly without triggering the wrapped valueholder. * However only the wrapped valueholder knows how to trigger the indirection, * i.e. it may be a batchValueHolder, and it stores all the info like the row * and the query. * Note: This method is not thread-safe. It must be used in a synchronized manner */ public Object instantiateForUnitOfWorkValueHolder(UnitOfWorkValueHolder unitOfWorkValueHolder) { return instantiate(getObject(), unitOfWorkValueHolder.getUnitOfWork()); }
/** * INTERNAL: * Return the value to be stored in the object's attribute. * This value is determined by invoking the appropriate * method on the object and passing it the row and session. * In this case, wrap the row in a ValueHolder for later use. */ public Object valueFromMethod(Object object, AbstractRecord row, AbstractSession session) { return new TransformerBasedValueHolder(this.getTransformationMapping().getAttributeTransformer(), object, row, session); }
protected Object instantiate(Object object, AbstractSession session) throws DescriptorException { try { return transformer.buildAttributeValue(getRow(), object, session); } catch (DescriptorException ex) { Throwable nestedException = ex.getInternalException(); if (nestedException instanceof IllegalAccessException) { throw DescriptorException.illegalAccessWhileInstantiatingMethodBasedProxy(nestedException); } else if (nestedException instanceof IllegalArgumentException) { throw DescriptorException.illegalArgumentWhileInstantiatingMethodBasedProxy(nestedException); } else if (nestedException instanceof InvocationTargetException) { throw DescriptorException.targetInvocationWhileInstantiatingMethodBasedProxy(nestedException); } else { throw ex; } } }
/** * Instantiate the object by executing the method on the transformer. */ protected Object instantiate() throws DescriptorException { return instantiate(getObject(), getSession()); }
/** * INTERNAL: * Return the value to be stored in the object's attribute. * This value is determined by invoking the appropriate method on the object and passing it the * row and session. */ public Object valueFromMethod(Object object, AbstractRecord row, AbstractSession session) { ValueHolderInterface valueHolder = new TransformerBasedValueHolder(this.getTransformationMapping().getAttributeTransformer(), object, row, session); return ProxyIndirectionHandler.newProxyInstance(object.getClass(), targetInterfaces, valueHolder); }
/** * INTERNAL: * Return the value to be stored in the object's attribute. * This value is determined by invoking the appropriate method on the object and passing it the * row and session. */ public Object valueFromMethod(Object object, AbstractRecord row, AbstractSession session) { ValueHolderInterface valueHolder = new TransformerBasedValueHolder(this.getTransformationMapping().getAttributeTransformer(), object, row, session); return ProxyIndirectionHandler.newProxyInstance(object.getClass(), targetInterfaces, valueHolder); }
/** * INTERNAL: * Return the value to be stored in the object's attribute. * This value is determined by invoking the appropriate method on the object and passing it the * row and session. */ public Object valueFromMethod(Object object, AbstractRecord row, AbstractSession session) { ValueHolderInterface valueHolder = new TransformerBasedValueHolder(this.getTransformationMapping().getAttributeTransformer(), object, row, session); return ProxyIndirectionHandler.newProxyInstance(object.getClass(), targetInterfaces, valueHolder); }