Passing parameters to be used in Customizerhttps://www.eclipse.org/forums/index.php/mv/msg/210074/673589/#msg_673589
The class PropertyValue is an instanceof ParameterExpression which will be called when the customizer is invoked (the method "public Object getValue(AbstractRecord translationRow, AbstractSession session)" is called). I'm trying to get a property passed by the EntityManager, however I only receive the properties defined in persistence.xml. I use the following code to create the EntityManager is each query:
...
private static EntityManagerFactory factory;
...
public synchronized static EntityManager getEntityManager() {
if (factory == null) {
factory = Persistence.createEntityManagerFactory(PERSISTENCE_UNIT_NAME);
}
EntityManager entityManager = factory.createEntityManager();
}

With the previous code, a new EntityManager is created for each query, however when the "getValue" of ParameterExpression is called, only the ServerSession (the one created by the "Persistence.createEntityManagerFactory(PERSISTENCE_UNIT_NAME);") is received and only the properties defined in the persistence.xml are accessible.

How can I pass a property/parameter value to the Customizer that will be supplied dynamically per EntityManager in each query?

Many thanks,
Pedro Oliveira]]>Pedro Oliveira2011-05-24T08:17:12-00:00Re: Passing parameters to be used in Customizerhttps://www.eclipse.org/forums/index.php/mv/msg/210074/673745/#msg_673745
If you try calling beginEarlyTranaction() on the UnitOfWork associated with the EntityManager first, do you then get the ClientSession or UnitOfWork?

There has been some work done on this in the 2.3 release, you could try the 2.3 release candidate.