Hi Rob!
Thanks for your example!
I'll gonna check your sample and try to get it working.It's likely not working 
in 3.0.0 right now, but we try to fix it for 3.0.1.
What you can do in the meantime is to use a ValueHandler instead. 
This is the OpenJPA specific version which predates the JPA @Converter logic.
rsandtner/openjpa-converter

| 
| 
| 
|  |  |

 |

 |
| 
|  | 
rsandtner/openjpa-converter

Contribute to rsandtner/openjpa-converter development by creating an account on 
GitHub.
 |

 |

 |




LieGrue,strub

    On Wednesday, 6 February 2019, 22:05:48 CET, Robert Scala 
<rsc...@buyersedgepurchasing.com> wrote:  
 
 Hello,

I'm trying OpenJPA 3.0.0 so I can use the AttributeConverter annotation.

But I'm having problems.  My converter is simple:

import javax.persistence.AttributeConverter;
import javax.persistence.Converter;

@Converter(autoApply = true)
public class StringInternConverter implements AttributeConverter<String, 
String>
{
     @Override
     public String convertToDatabaseColumn(String attribute)
     {
         return attribute;
     }

     @Override
     public String convertToEntityAttribute(String dbData)
     {
         return dbData != null ? dbData.intern(): null;
     }
}

The problem is that I can't get JPA to see this converter.  When I add 
it to persistence.xml like this:

     <!-- Converters -->
<class>com.be.db.jpa.StringInternConverter</class>

The enhancer complains that it StringInternConverter "does not have 
persistence metadata".

Is there a trick to get this to work?

Thanks,

Rob


-- 
Rob Scala
Buyers Edge, Inc.
351 North Frontage Road, Suite A210
New London, CT 06320
Phone: (860) 865-2127
  

Reply via email to