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.
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. 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)
}
This should work, but it does add quite a bit of what is essentially
boilerplate to the code. I'm hoping that I can find some way to automate or
generate the appropriate getter/setter pairs for the fields. If anyone has
any suggestions I would love to hear it.
Thanks,
Derek
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---