Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Converter not being picked up despite having autoApply=true

På torsdag 04. juli 2013 kl. 15:26:23, skrev Guy Pelletier <guy.pelletier@xxxxxxxxxx>:
Hi Andreas,

Not knowing the full details of the spring package scan tool, I suspect the @Converter class is not being returned from this scan and would explain why it is not being applied by EclipseLink.

Perhaps you could try including a persistence.xml file as a test and make sure the converter is listed there.

<class>JodaDateTimeConverter</class>


Also, if you have debugging capabilities, you could try looking at initPersistenceUnitClasses from org.eclipse.persistence.internal.jpa.metadata.MetadataProcessor. That is where the @Converter would be picked up if found.
 
Adding the following persistence.xml makes it work, both ddl-creation and inserting/retrieving:
 
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="2.1">
        <persistence-unit name="default">
                <class>no.officenet.test.hibernatetest.infrastructure.jpa.JodaDateTimeConverter</class>
        </persistence-unit>
</persistence>
 
So it seems it's Spring's package-scanning tool which needs to be updated to also add @Converter classes?
 
--
Andreas Joseph Krogh <andreak@xxxxxxxxxxxx>      mob: +47 909 56 963
Senior Software Developer / CTO - OfficeNet AS - http://www.officenet.no
Public key: http://home.officenet.no/~andreak/public_key.asc
 

Back to the top