[Building Sakai] about insert data in the database

Steve Swinsburg s.swinsburg at lancaster.ac.uk
Tue May 12 15:49:58 PDT 2009


Hi,

You can use Hibernate to do this for you or you can do it yourself via  
JDBC. For Hibernate, in its simplest form you setup a Hibernate  
mapping file (hbm.xml) and a Java class for each table that you want  
in the database. The DAO simply abstracts the hibernate methods into a  
simple get/insert/delete fashion. I recommend this book to start with  
Hibernate:
http://books.google.com/books?id=0d12xElRjysC

As you read, keep in mind that Sakai already has the SessionFactory  
setup so you don't need to setup the configuration yourself, you can  
just inject it.

If you want some sample code, either use the app builder or see this  
quickstart:
https://source.sakaiproject.org/contrib/lancaster.ac.uk/wicket-tool-starter/



cheers,
Steve

---
Steve Swinsburg
Portal Systems Developer
Centre for e-Science
Lancaster University
Lancaster
LA1 4YT

email: s.swinsburg at lancaster.ac.uk
phone: +44 (0) 1524 594870

On 12/05/2009, at 6:33 PM, yolima u wrote:

>
> hi all,
>
> i have a doubt about how i have to insert data into the database.
> i have seen that in the code of the tool's web pages, sakai uses  
> beans (and
> they use the dao of the application) to set o get the data, but i  
> don't
> understand how insert into the data base. is with the *.hbm.xml?  
> where do
> sakai routed this files?  or something else?
> -- 
> View this message in context: http://www.nabble.com/about-insert-data-in-the-database-tp23506704p23506704.html
> Sent from the Sakai - Development mailing list archive at Nabble.com.
>
> _______________________________________________
> 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/20090512/2eae86f9/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2437 bytes
Desc: not available
Url : http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20090512/2eae86f9/attachment.bin 


More information about the sakai-dev mailing list