Play with plain JDBC or iBatis (MyBatis)

549 views
Skip to first unread message

carlhempel

unread,
Apr 20, 2011, 10:43:31 PM4/20/11
to play-framework
I love Play! I don't love JPA and or Hibernate. Can I disable the JPA/
Hibernate stuff and use iBatis or plain JDBC ... without doing a crazy
hacks?

Thanks!
Message has been deleted
Message has been deleted

Alex Gran

unread,
Apr 20, 2011, 11:57:14 PM4/20/11
to play-framework
yes, you can do that,
In fact I've asked similar question earlier

http://groups.google.com/group/play-framework/browse_thread/thread/c8257d526547af65/6db9d711e89a56df

I added relevant spring JDBC jars into lib folder, configured beans
and initialized it from OnApplicationStart job. worked like charm !.
As you must be knowing, you can avoid a lot of boiler plate code if
you use a managed jdbc framework like spring jdbctemplate instead of
plain JDBC.

-al

Pascal Voitot Dev

unread,
Apr 21, 2011, 2:28:21 AM4/21/11
to play-fr...@googlegroups.com
if you want to try something else than JPA, I can also propose the framework I work on : Siena (sienaproject.com , the doc is a bit outdated as the code has been recently refactored and enhanced with lots of new APIs and it's being tested).
A complete version should be available very soon for Play1.2 and MySQL/Postgres/GAE as I'm currently working on the play plugin (previous versions only works with GAE).
It's directly based on JDBC for SQL implementations and tries to draw a line between SQL and NoSQL...

Pascal


--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To post to this group, send email to play-fr...@googlegroups.com.
To unsubscribe from this group, send email to play-framewor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.


felipera

unread,
May 2, 2011, 11:08:34 PM5/2/11
to play-framework
I just had to do something like that and it turned out to be pretty
easy, I re-wrote Play's JPA to talk to a legacy backend (JBoss MDBs).
By the way thank you Pascal, your code helped me on my journey. I
wanted to still be able to use the CRUD module and I knew you had done
something similar with Siena.

Have a great one,
Felipe

On Apr 21, 2:28 am, Pascal Voitot Dev <pascal.voitot....@gmail.com>
wrote:
> if you want to try something else than JPA, I can also propose the framework
> I work on : Siena (sienaproject.com , the doc is a bit outdated as the code
> has been recently refactored and enhanced with lots of new APIs and it's
> being tested).
> A complete version should be available very soon for Play1.2 and
> MySQL/Postgres/GAE as I'm currently working on the play plugin (previous
> versions only works with GAE).
> It's directly based on JDBC for SQL implementations and tries to draw a line
> between SQL and NoSQL...
>
> Pascal
>

felipera

unread,
May 2, 2011, 11:13:21 PM5/2/11
to play-framework
By the way I forgot to mention you might want to look into ebean, I
hadn't heard about it until I found a comment about it inside Play's
JPA code. If I remember correctly it was a hack that had to be done to
make Hibernate work so I decided to look into it; it looks pretty
straight forward: http://www.avaje.org/ebean/introquery.html

Pascal Voitot Dev

unread,
May 3, 2011, 2:44:19 AM5/3/11
to play-fr...@googlegroups.com
On Tue, May 3, 2011 at 5:13 AM, felipera <feli...@gmail.com> wrote:
By the way I forgot to mention you might want to look into ebean, I
hadn't heard about it until I found a comment about it inside Play's
JPA code. If I remember correctly it was a hack that had to be done to
make Hibernate work so I decided to look into it; it looks pretty
straight forward: http://www.avaje.org/ebean/introquery.html


Yes it seems good, I didn't know it precisely and it's interesting to see that I have added the same kind of concepts in Siena recently and it's quite reassuring, I'm not completely in the wrong way ;).
It's funny to see how much people try to flee away from JPA and stuff like that :D
For Siena, besides trying to bridge SQL/NoSQL, we also try to go in a slighter different direction than just reproducing SQL ORM using the active record design: we try to give practical solutions to needs, use cases we identify... The API as an application enabler, not just a way to talk to a DB from a OO language...

Pascal
 
Reply all
Reply to author
Forward
0 new messages