On Tue, Nov 25, 2008 at 11:24 AM, Derek Chen-Becker
<[EMAIL PROTECTED]>wrote:
> We just had a bit of a discussion on integrating JPA with the new Record
> stuff over on the committers list and unintentionally got into some
> substance discussion that would be better handled on the main list. Let me
> sum up:
> First off, the new Record stuff looks great! It's lean, it's mean and it's
> clean. There is still some work to do on fleshing out some implementation
> details and maybe fleshing out some of the base Field support (I'm doing a
> BigDecimal-based field for a book example, would people want to see that?),
> but what's there so far is very nice; David and Marius have done a great
> job.
>
Fields with custom type mappings are pretty important, and unfortunately
they're not in the base JPA spec. Hibernate has its @Type annotation, so
whatever solution we come up with should be extensible to the degree that it
be able to accommodate such extensions.
>
> The issue with JPA, specifically, is that the way it's designed, it infers
> persistent fields on an instance either via getter/setter pairs or via
> annotations on fields.
>
Remember that additionally in JPA, a bare unannotated field on an object
will be inferred as persistent unless annotated @Transient (or, in java,
unless it is declared with the "transient" modifier)
> Record, for reasons that I think are completely legitimate, uses instance
> objects instead for field definition. These two approaches aren't mutually
> exclusive, but it does complicate things a bit from the JPA perspective. The
> simplest approach I can think of is to merely add the appropriate
> getter/setter pairs that delegate to the Record object fields, like this:
>
> class MyEntity extends Record[MyEntity] {
> object name extends StringField(this,100)
>
> // getter/setter used only by the JPA provider
> @Column{val name = "my_name_"}
> def getName() = name.value
> def setName(newVal : String) = name.set(newVal)
> }
>
I haven't had time to look at Record yet, but could you elaborate on the
reasons for using object for field definitions? It seems like this would
make mapping class hierarchies problematic, although I may be
misunderstanding.
Kris
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Lift" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---