[Building Sakai] Create tool with tables

Matthew Jones jonespm at umich.edu
Wed Jul 13 09:42:28 PDT 2011


Agreed, nothing is "magical" but I don't think it's super well documented
either.

There is a helper function (ddl) in sqlService [1] that some projects (like
assignment[2] ) use on their init(). Some just check the auto.ddl property
and process their sql files if it is set. It uses the "getVendor" call so it
can use the appropriate (oracle/hsqldb/mysql) sql files.

If you're using hibernate in your project and the auto.ddl property is
enabled, then it turns on hibernate schemaUpdate.

[1]
http://qa1-nl.sakaiproject.org/codereview/trunk/api/org/sakaiproject/db/api/SqlService.java.html
[2]
https://source.sakaiproject.org/svn/assignment/trunk/assignment-impl/impl/src/java/org/sakaiproject/assignment/impl/DbAssignmentService.java

On Tue, Jul 12, 2011 at 7:15 PM, Steve Swinsburg
<steve.swinsburg at gmail.com>wrote:

> Hi Paul,
>
> In your service startup (init) just run the SQL to create the tables. You
> can check the vendor used as it is set in sakai.properties, and then just
> run the appropriate SQL.
>
> The hbm.xml you see are the Hibernate mappings, but in your case you don't
> need this if you are managing the SQL yourself (hopefully using something
> like Spring JDBC).
>
> cheers,
> Steve
>
>
> On 13/07/2011, at 7:29 AM, Paul Mungai wrote:
>
> > > Kindly advise on the necessary steps to adding an sql table in a new
> tool.
> >
> > I already have the sql as shown:
> >
> > mytool/mytool-impl/impl/src/sql/mysql/sakai_mytool.sql
> > mytool/mytool-impl/impl/src/sql/oracle/sakai_mytool.sql
> > mytool/mytool-impl/impl/src/sql/hsqldb/sakai_mytool.sql
> >
> > What more do I need to do to make this work?
> >
> > I realized some modules have *.hdb.xml. Is this necessary?
> >
> > Unfortunately none of the documentation on confluence addresses the
> creation of new tables.
> >
> > Regards,
> > Paul Mungai
> > _______________________________________________
> > sakai-dev mailing list
> > sakai-dev at collab.sakaiproject.org
> > http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
> >
> > TO UNSUBSCRIBE: send email to
> sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of
> "unsubscribe"
>
> _______________________________________________
> sakai-dev mailing list
> sakai-dev at collab.sakaiproject.org
> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>
> TO UNSUBSCRIBE: send email to
> sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of
> "unsubscribe"
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20110713/735c658a/attachment.html 


More information about the sakai-dev mailing list