You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by Norman Maurer <no...@apache.org> on 2010/02/03 08:03:26 UTC

[server] switching from "self-written" sql to JPA

Hi all,

now with Spring its really easy to inject a EntityManager so I would
like to propose to change our handwritten SQL stuff with JPA (using
OpenJPA as default).  This will give us support of many db vendors out
of the box and relay on a Standard.


What do you think ?

Bye,
Norman

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Re: [server] switching from "self-written" sql to JPA

Posted by Norman Maurer <no...@googlemail.com>.
2010/2/3 Stefano Bagnara <ap...@bago.org>:
> 2010/2/3 Norman Maurer <no...@apache.org>:
>> Hi all,
>>
>> now with Spring its really easy to inject a EntityManager so I would
>> like to propose to change our handwritten SQL stuff with JPA (using
>> OpenJPA as default).  This will give us support of many db vendors out
>> of the box and relay on a Standard.
>>
>>
>> What do you think ?
>
> What JDBC are you talking about ? the Mail/UserRepository stuff?
> VirtuserTable? All of them?
>
> I'm not sure "change" is the right approach for all of them now. For
> Repositories we can simply add a JPA version to the current DB(JDBC)
> and FILE versions, right?
>
> I'm not sure that JPA will allow us to use the same very
> schema/content we are using with JDBC (schema is created
> automatically, we have serialized attributes, we "intelligently" avoid
> useless updates, we lazy load the body, we have a custom locking
> method). I think moving to JPA the current services does not worth it.
> I guess working on a different spoolmanager and a different mail store
> would be better invested.
>
> Stefano

+1

But add least for the UsersRepository we could do it..

Bye,
Norman

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Re: [server] switching from "self-written" sql to JPA

Posted by Norman Maurer <no...@googlemail.com>.
Sorry I missed a comment..



2010/2/3 Stefano Bagnara <ap...@bago.org>:
> 2010/2/3 Norman Maurer <no...@apache.org>:
>> Hi all,
>>
>> now with Spring its really easy to inject a EntityManager so I would
>> like to propose to change our handwritten SQL stuff with JPA (using
>> OpenJPA as default).  This will give us support of many db vendors out
>> of the box and relay on a Standard.
>>
>>
>> What do you think ?
>
> What JDBC are you talking about ? the Mail/UserRepository stuff?
> VirtuserTable? All of them?

I would first tackle UsersRepository and VirtualUserTable.

Bye,
Norman

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Re: [server] switching from "self-written" sql to JPA

Posted by Stefano Bagnara <ap...@bago.org>.
2010/2/3 Norman Maurer <no...@apache.org>:
> Hi all,
>
> now with Spring its really easy to inject a EntityManager so I would
> like to propose to change our handwritten SQL stuff with JPA (using
> OpenJPA as default).  This will give us support of many db vendors out
> of the box and relay on a Standard.
>
>
> What do you think ?

What JDBC are you talking about ? the Mail/UserRepository stuff?
VirtuserTable? All of them?

I'm not sure "change" is the right approach for all of them now. For
Repositories we can simply add a JPA version to the current DB(JDBC)
and FILE versions, right?

I'm not sure that JPA will allow us to use the same very
schema/content we are using with JDBC (schema is created
automatically, we have serialized attributes, we "intelligently" avoid
useless updates, we lazy load the body, we have a custom locking
method). I think moving to JPA the current services does not worth it.
I guess working on a different spoolmanager and a different mail store
would be better invested.

Stefano

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Re: [server] switching from "self-written" sql to JPA

Posted by Norman Maurer <no...@googlemail.com>.
True,

but what about the JDBCMailRepository/JDBCSpoolRepository (maybe not
worth the hassle because we want to rewrite the whole stuff anyway ?).
Rewrite the UserRepository should not be to hard ( there is already
the code in trunk).


Bye,
Norman


2010/2/3 Robert Burrell Donkin <ro...@gmail.com>:
> On Wed, Feb 3, 2010 at 7:03 AM, Norman Maurer <no...@apache.org> wrote:
>> Hi all,
>>
>> now with Spring its really easy to inject a EntityManager so I would
>> like to propose to change our handwritten SQL stuff with JPA (using
>> OpenJPA as default).  This will give us support of many db vendors out
>> of the box and relay on a Standard.
>>
>>
>> What do you think ?
>
> +1
>
> IIRC the naive bayes mailet uses handwritten SQL. i would prefer to
> break that out into a separate product (machine learning mailets?)
> retaining direct SQL for the moment. in general, i think that moving
> out the mailets that use direct SQL and porting them at leisure would
> be easier that porting them at once.
>
> - robert
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
> For additional commands, e-mail: server-dev-help@james.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Re: [server] switching from "self-written" sql to JPA

Posted by Robert Burrell Donkin <ro...@gmail.com>.
On Wed, Feb 3, 2010 at 7:03 AM, Norman Maurer <no...@apache.org> wrote:
> Hi all,
>
> now with Spring its really easy to inject a EntityManager so I would
> like to propose to change our handwritten SQL stuff with JPA (using
> OpenJPA as default).  This will give us support of many db vendors out
> of the box and relay on a Standard.
>
>
> What do you think ?

+1

IIRC the naive bayes mailet uses handwritten SQL. i would prefer to
break that out into a separate product (machine learning mailets?)
retaining direct SQL for the moment. in general, i think that moving
out the mailets that use direct SQL and porting them at leisure would
be easier that porting them at once.

- robert

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org