TopLink 11g JPA - @ObjectTypeConverter
Dears,
I am using TopLink 11g JPA, my questions are:
- I have database column [GENDER VARCHAR2(1)] and attribute gender which contains either ("Male" or "Female"). I want to do conversion such as:
Object "Male" <==> Table "M"
Object "Female" <==> Table "F"
I have the following ObjectTypeConverter:
@ObjectTypeConverter (
name="genderConverter",
dataType=java.lang.String.class,
objectType=java.lang.String.class,
conversionValues={
@ConversionValue(dataValue="M", objectValue="Male"),
@ConversionValue(dataValue="F", objectValue="Female")}
)
public class EmployeeEntity implements Serializable {
@Convert("genderConverter")
@Column (name="GENDER")
private String gender;
==>
1) The code mentioned above compiles fine and the employee created without any error, but the conversion is not working.
2) I am not able to find any complete/detailed example on TopLink 11g/JPA. Most of the examples on the Web uses eclipselink and not TopLink 11g/JPA.
3) What is the difference between Customizer & Converter.
Looking for your support...
Thanks