Attribute type checking on field with @Converter

I've created custom type for entity field and made a @Converter for it, But Idea 13.1 claims about 'Attribute type checking'
attribute-type-check-with-converter.png
I created a test project on github.
Is it my fault or Idea does not support this feature of JPA 2.1?

13.1.1 IntelliJ IDEA 13.1.1
Build #IU-135.480, built on March 21, 2014
JRE : 1.7.0_51-b13 amd64
VM: Java HotSpot(TM) 64-Bit Server VM by Oracle Corporation

2 comments
Comment actions Permalink

JavaDoc says: The simplest type of mapping to a database column. The

Basic
annotation can be applied to a persistent property or instance variable of any of the following types: Java primitive types, wrappers of the primitive types,
String
,
java.math.BigInteger
,
java.math.BigDecimal
,
java.util.Date
,
java.util.Calendar
,
java.sql.Date
,
java.sql.Time
,
java.sql.Timestamp
,
byte[]
,
Byte[]
,
char[]
,
Character[]
, enums, and any other type that implements
java.io.Serializable
.

Does your class CustomConverted implements java.io.Serializable?
0
Comment actions Permalink

andrey.vokin wrote:

JavaDoc says: The simplest type of mapping to a database column. The

Basic
annotation can be applied to a persistent property or instance variable of any of the following types: Java primitive types, wrappers of the primitive types,
String
,
java.math.BigInteger
,
java.math.BigDecimal
,
java.util.Date
,
java.util.Calendar
,
java.sql.Date
,
java.sql.Time
,
java.sql.Timestamp
,
byte[]
,
Byte[]
,
char[]
,
Character[]
, enums, and any other type that implements
java.io.Serializable
.

Does your class CustomConverted implements java.io.Serializable?

No CustomConverted does not implements Serializable. But it has a @Converter assigned.

JPA 2.1 Specification, section 3.8 says: An attribute converter must implement  

javax.persistence.AttributeConverter 
interface. A converter implementation class must be annotated with the
Converter
annotation or defined in the XML descriptor as a converter. If the value of the
autoApply
element of the Converter annotation is
true
, the converter will be applied to all attributes of the target type, including to basic attribute values that are contained within other, more complex attribute types.
0

Please sign in to leave a comment.