These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: How does JPA infer data type of attributes
PostPosted: Wed Dec 14, 2011 11:04 pm 
Newbie

Joined: Wed Dec 14, 2011 11:00 pm
Posts: 2
A typical JPA entity looks like:

@Entity
public class Person {
@Id
private int id;
private String name;
private int age;
private Calendar anniversary;
...
}
Note that the data type is not annotated on any of the member attributes.

I just read a note around Hibernate being not so usable with Scala's data types and wondered if we could write some adaptors. I know we can write UserTypes for Scala types and UserCollectionTypes for Scala's collections so adaptors may be possible.

The question I have is can I configure these data types somehow so JPA will automatically associate them with corresponding Scala types (e.g. BigDecimal's user type with BigDecimal attributes), without having to annotate each attribute with @Type?

or is there an out-of-the-box solution available for scala types anyways?


Top
 Profile  
 
 Post subject: Re: How does JPA infer data type of attributes
PostPosted: Mon Dec 19, 2011 4:49 am 
Newbie

Joined: Wed Dec 14, 2011 11:00 pm
Posts: 2
is there a way/ forum to seek answers to such questions that don't get answered for some time? e.g. from the contributors to the hibernate source code?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.