Java – how to use JPA2 to persist entities containing user type fields

I'm looking for a way to persist entities that contain user type fields

import org.joda.time.DateTime;

@Entity
public class Foo {

  @Id
  private Long id;

  private DateTime ts;
}

Solution

JPA cannot register custom attribute types. You must use something specific to the provider:

>Sleep: http://joda-time.sourceforge.net/contrib/hibernate/ > EclipseLink: http://code.google.com/p/joda-time-eclipselink-integration/ > OpenJPA: http://issues.apache.org/jira/browse/OPENJPA-473 (still open)

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>