Well, following the example I posted, if you're writing the getters and
setters then those should be visible (and usable) just fine from Java. The
biggest issue would be that you would need the Record traits (as well as the
Scala library) in your classpath for any of these cases. Off the top of my
head I can't think of any other issues with this particular setup.
Derek

On Tue, Nov 25, 2008 at 1:43 PM, Francois Bertrand <[EMAIL PROTECTED]>wrote:

>
> Hi Derek:
>
> Sorry, I have no suggestion, but I can make the solution even harder,
> because I think that the following requirement will be very common:
>
>  The JPA classes should be usable from Java code, from non-liftweb
> Scala code and,.of course, from Liftweb code (ideally, the JPA classes
> shoudn't have any dependency on Liftweb classes or traits).
>
> It was a requirement for my first (and only) real application that
> used Liftweb, so you may consider it.
>
> Sorry again!
> Francois
>
>
>
> On Nov 25, 3:24 pm, "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.
> >
> > 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 liftweb@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to