any utility to automatically create models classes from an existing database?

226 views
Skip to first unread message

sas

unread,
Jul 16, 2011, 3:36:18 PM7/16/11
to play-framework
just out of my lazyness, has anybody develped some script or utility
to automatically create the models classes from an existing
database???

it shouldn't be to difficult...

saludos

sas

Nicolas Leroux

unread,
Jul 16, 2011, 4:19:52 PM7/16/11
to play-fr...@googlegroups.com
The db module attempts to just do that (however it might be buggy with some db)...

Nicolas

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

Marc Deschamps

unread,
Jul 17, 2011, 2:27:47 AM7/17/11
to play-fr...@googlegroups.com
Look at my jpagen module, it can do that with Oracle or MySQL.


play install jpagen

Lukas Eder

unread,
Jul 17, 2011, 4:57:26 AM7/17/11
to play-framework
I would be quite interested in such an addition using the jOOQ
database framework
http://www.jooq.org

This has also been requested recently by another jOOQ/Play user:
http://groups.google.com/group/play-framework/browse_thread/thread/2fa927c66ef355d9

jOOQ already includes source code generation for the database meta-
model. Currently 11 RDBMS are supported (DB2, Derby, H2, HSQLDB,
MySQL, Ingres, Postgres, Oracle, SQL Server, SQLite, Sybase). Support
for SQL Azure and Firebird will be added soon. Using the jooq-meta
module, vendor-specific database dictionary views and tables can be
navigated uniformly and in a much easier way than using JDBC's
DatabaseMetaData (which isn't fully/correctly implemented by most JDBC
drivers anyway). Source code generation for Play model classes should
be an easy additional step.

Any such contributions would be very welcome

Rakesh Waghela

unread,
Jul 17, 2011, 5:21:48 AM7/17/11
to play-fr...@googlegroups.com
Lukas.. take a look at source code of SienaProject, the developer of Siena Plugin does nice integration with Play !..
You might get a lead in it.

I also checked out http://www.querydsl.com/

I believe you guys are doing really interesting work on relational-db front. Any plan for combining the powers of QueryDSL and JOOQ ?
I have seen discussion between you guys..

Lukas Eder

unread,
Jul 17, 2011, 5:35:21 AM7/17/11
to play-framework
Rakesh,

> Lukas.. take a look at source code of SienaProject, the developer of Siena
> Plugin does nice integration with Play !..

Thanks for the pointer to the Siena Project! Looks like a nice place
to start getting ideas about interfacing the jOOQ/Play

> I also checked outhttp://www.querydsl.com/
>
> I believe you guys are doing really interesting work on relational-db front.
> Any plan for combining the powers of QueryDSL and JOOQ ?
> I have seen discussion between you guys..

QueryDSL has a different focus than jOOQ. While basic querying works
in similar ways for both frameworks (see also JaQu by H2), jOOQ aims
at integrating SQL and vendor-specific extensions fully into Java,
this includes complex data types and stored procedures, etc. QueryDSL
wants to provide a single API for many backends, similar to what
SienaProject does, but with a much more elaborate fluent API. jOOQ's
only "backend" will remain SQL.

Apart from the different focus, unfortunately, Timo Westkämper from
QueryDSL does not see a way of merging the two projects right now, as
QueryDSL is a strategic product for Mysema. With JaQu it may be
different, as Thomas Mueller from H2 currently has no time for making
JaQu evolve, himself:

http://groups.google.com/group/h2-database/browse_thread/thread/f5c805bf6174e118

Rakesh Waghela

unread,
Jul 17, 2011, 6:25:08 AM7/17/11
to play-fr...@googlegroups.com
Prompt response.. Lukas :)

Anyways.. looking forward to a Play ! integration of JOOQ. :) Seems you have started naturally focusing on Play ! side...
I am sure it will be a heavy lifting for JOOQ to be with Play !

Lukas Eder

unread,
Jul 17, 2011, 6:33:58 AM7/17/11
to play-framework
> Anyways.. looking forward to a Play ! integration of JOOQ. :)

Thanks for the support, Rakesh!

> Seems you have started naturally focusing on Play ! side...

I have recently attended to a very convincing talk about Play ! at the
Jazoon conference in Zurich. I feel, Play ! is an even more intuitive
alternative to the rather complex JSF stack, than Wicket.

> I am sure it will be a heavy lifting for JOOQ to be with Play !

I think so, too!
Reply all
Reply to author
Forward
0 new messages