File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes JodaTime Map Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "JodaTime Map" Watch "JodaTime Map" New topic
Author

JodaTime Map

Alesandro Lang
Greenhorn

Joined: May 20, 2011
Posts: 5
Hello,

I want to save a java.util.Map to the Database with JPA. The Key Object is from org.joda.time.LocalDate the Value Object is an Integer. I tried a lot of stuff with the help of JodaTime-Hibernate.

e.G.


It would be great if there is a solution which is not hibernate specific.
Alesandro Lang
Greenhorn

Joined: May 20, 2011
Posts: 5
@CollectionOfElements is deprecated now Iam using @ElementCollection

-> org.hibernate.MappingException: collection index mapping has wrong number of columns
Alesandro Lang
Greenhorn

Joined: May 20, 2011
Posts: 5
My workaround at the end of the day was to save java.util.Date and convert it to LocalDate .
I uses the @PrePersist and @PostLoad Annotations for this.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JodaTime Map