PersistenceException merging an entity with a Calendar field. 
--------------------------------------------------------------

                 Key: OPENJPA-139
                 URL: https://issues.apache.org/jira/browse/OPENJPA-139
             Project: OpenJPA
          Issue Type: Bug
          Components: kernel
            Reporter: Michael Dick


I get the following exception when I try to merge an entity which contains a 
java.util.Calendar field. 

<0|true|0.0.0> org.apache.openjpa.persistence.PersistenceException: 
mikedd.entities.CalendarEntity.cal
        at 
org.apache.openjpa.kernel.AttachStrategy.attachField(AttachStrategy.java:255)
        at 
org.apache.openjpa.kernel.VersionAttachStrategy.attach(VersionAttachStrategy.java:131)
        at 
org.apache.openjpa.kernel.AttachManager.attach(AttachManager.java:236)
        at org.apache.openjpa.kernel.AttachManager.attach(AttachManager.java:97)
        at org.apache.openjpa.kernel.BrokerImpl.attach(BrokerImpl.java:3141)
        at 
org.apache.openjpa.kernel.DelegatingBroker.attach(DelegatingBroker.java:1128)
        at 
org.apache.openjpa.persistence.EntityManagerImpl.merge(EntityManagerImpl.java:650)
        at mikedd.tests.TestCalendar.testMergeCalendar(TestCalendar.java:47)
        <snip>

I'm running the test in eclipse and my classpath probably isn't set up to 
properly display the openjpa version, 
output from svnversion -c : 406193:505052M

It looks like we're missing a case statement for JavaTypes.CALENDAR in 
org.apache.openjpa.kernelAttachStrategy.attachField. I added one under 
JavaTypes.DATE and that resolved the issue for me. 




-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to