|
Hi, Patrick Linskey wrote: As far as I know - we don't use the OpenJPA enhancer. What does the enhancer improve?Hi, Are you running the OpenJPA enhancer? the persistence.xml from our system:Can you post your persistence.xml file? <?xml version="1.0" encoding="UTF-8"?> <!-- JPA Persistence Test config file (taken from OpenJPA "hellojpa" example). --> <persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0"> <!-- A persistence unit is a set of listed persistent entities as well the configuration of an EntityManagerFactory. We configure each example in a separate persistence-unit. --> <persistence-unit name="lbsims" transaction-type="JTA"> <!-- transaction-type="RESOURCE_LOCAL|JTA"> --> <!-- The default provider can be OpenJPA, or some other product. This element is optional if OpenJPA is the only JPA provider in the current classloading environment. oracle.toplink.essentials.PersistenceProvider --> <provider> org.apache.openjpa.persistence.PersistenceProviderImpl </provider> <jta-data-source>jdbc_lbsims</jta-data-source> <!-- We must enumerate each entity in the persistence unit --> <class>com.lbslogics.ims.model.PositionLog</class> <class>com.lbslogics.ims.model.Material</class> <class>com.lbslogics.ims.model.StockPlace</class> <class>com.lbslogics.ims.model.Stock</class> <class>com.lbslogics.ims.model.Equipment</class> <class>com.lbslogics.ims.model.JobReport</class> <class>com.lbslogics.ims.model.JobEvent</class> <class>com.lbslogics.ims.model.JobMaterial</class> <!-- <xsd:element name="exclude-unlisted-classes" type="xsd:boolean" default="false" minOccurs="0"> <xsd:annotation> <xsd:documentation> When set to true then only listed classes and jars will be scanned for persistent classes, otherwise the enclosing jar or directory will also be scanned. Not applicable to Java SE persistence units. </xsd:documentation> </xsd:annotation> </xsd:element> --> <exclude-unlisted-classes>true</exclude-unlisted-classes> <properties> <!-- We can configure the default OpenJPA properties here. They happen to be commented out here since the provided examples all specify the values via System properties. --> <property name="openjpa.ConnectionFactoryMode" value="managed" /> <property name="openjpa.TransactionMode" value="managed"/> <!-- <property name="openjpa.Log" value="DefaultLevel=TRACE,SQL=TRACE" /> --> <!-- If you want to access a single EM from multiple threads, you should set the openjpa.Multithreaded property accordingly --> <property name="openjpa.Multithreaded" value="true"/> <property name="openjpa.ManagedRuntime" value="jndi(TransactionManagerName=java:comp/UserTransaction)" /> <!-- enable OpenJPA EMF data cache because we have only a single JVM <property name="openjpa.DataCache" value="true"/> <property name="openjpa.RemoteCommitProvider" value="sjvm"/> --> <!-- <property name="openjpa.ConnectionURL" value="jdbc:mysql://localhost:3307/lbsims?autoReconnect=true" /> <property name="openjpa.ConnectionDriverName" value="com.mysql.jdbc.Driver" /> <property name="openjpa.ConnectionUserName" value="root" /> <property name="openjpa.ConnectionPassword" value="" /> --> <!-- --> <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)"/> <!-- --> </properties> </persistence-unit> </persistence> the null-values fields where NON-NULL when i detached the objects and sent them to the web tier.Were the null-valued fields non-null when you detached objects and sent them to the web tier? thanks in advance, rené -PatrickOn 9/14/07, rené giretzlehner <[EMAIL PROTECTED]> wrote:Hi, I'm using 0.9.7 version. My problem is that when I merge detached objects via the entity-manager - ALL NULL-values which I set in the web-tier are being replaced by the values of the object-fields which are in the database. Is this behavior intended? Because it is necessary for me the reset some fields from the db-value to NULL again. Is it possible that I have made a mistake in the jpa-configuration - is there a section in the configuration where I can tell jpa to persist the NULL-values and NOT to overwrite them with the values from db? Thanks for your suggestions! All the best, rené |
- Overwritten Null-Values @ merge rené giretzlehner
- Re: Overwritten Null-Values @ merge Patrick Linskey
- Re: Overwritten Null-Values @ merge rené giretzlehner
- Re: Overwritten Null-Values @ merge rené giretzlehner
