OK, the code is merged in and the latest version is attached. I made a few
minor modifications to the JPA code that Oliver sent:

1. I made the openEM and closeEM methods abstract and protected. The idea is
that the JPA class shouldn't be tied to the way the user wants to access
JPA. Rather, when they implement the JPA class they can provide their own
hooks to do direct access, IoC, or JNDI, etc.

2. I added a convenience method for createNamedQuery so that you can pass
parameters in when you create the query. A very minor change but it saves a
little typing when you use it a lot.

I've also changed the module naming per Oliver's suggestion. I'll test
against the other DBs this afternoon, but so far I've had no issues with
HSQLDB.

Derek

On Tue, Sep 9, 2008 at 8:35 AM, Derek Chen-Becker <[EMAIL PROTECTED]>wrote:

> Looks like I missed a lot in the two days I was gone :). I'm going to look
> at Oliver's code and merge it. As for Tim's problem with the insertions, the
> AUTO ID generation should usually just work. I don't have a SQL Server
> instance to try it out on, but after I merge the code I'll test it again
> with HSQL, PostgreSQL and MySQL to make sure that it works there. If so, it
> may be something specific to the SQL Server dialect.
>
> Derek
>
>
> On Tue, Sep 9, 2008 at 5:09 AM, Oliver Lambert <[EMAIL PROTECTED]> wrote:
>
>>
>>
>> On 09/09/2008, at 7:47 PM, Tim Perrett wrote:
>>
>> >
>> > I agree - its strange and not what we would expect.
>> >
>> > What version of SQL server are you running? Im using 2005 Enterprise
>> > here...
>> >
>> I think thats what they are using at my company
>>
>>
>> > Its just a really strange thing, the 100 is always ignored... I think
>> > it just needs a 2nd parameter there, even if its going to ignore it.
>> > Thats certainly what it looks like from the SQL thats being run
>> > anyway. I would have thought the GenerationType.IDENTITY would mean
>> > that it knows not to use it in SQL inserts/updates, but obviously not.
>> >
>> I assume that you have run a simple unit test to do an insert with
>> persist e.g.
>>   def testOK = {
>>
>>     val na = new Author()
>>     na.name = "HELLO THERE!!!!!"
>>     Model.persist(na)
>>
>>     val authors = Model.createNamedQuery[Author]
>> ("findAllAuthors").getResultList()
>>
>>      authors.foreach(author => {
>>         println("name: "+author.name)
>>         author.books.foreach(book => println("   title: "+book.title))
>>       })
>>   }
>>
>> If you are still having problems, "mvn clean" your project, zip it up
>> and mail it to me - I'll run it tomorrow morning, when I get to work
>>
>> Oliver
>>
>>
>> > Cheers
>> >
>> > Tim
>> > >
>>
>>
>> >>
>>
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Attachment: jpademo.tar.gz
Description: GNU Zip compressed data

Reply via email to