[Building Sakai] Sakai BasicSQLService - Can we add dbUpdate() Methods?

Steve Swinsburg steve.swinsburg at gmail.com
Tue Jul 19 21:32:44 PDT 2011


That Spring wiring is for Hibernate as well which is why it is so heavy.

Here's the wiring from the archetype, find the bean labelled DAO.
https://source.sakaiproject.org/contrib//swinsburg/sakai-maven-archetype/archetype/trunk/src/main/resources/archetype-resources/pack/src/webapp/WEB-INF/components.xml

Then if your data is properly typed you can do:

getJdbcTemplate().update(SOME_STATEMENT,
	new Object[]{t.getName(), t.getDescription()}
);


cheers,
Steve




On 20/07/2011, at 1:46 PM, csev wrote:

> 
> On Jul 19, 2011, at 10:07 PM, Steve Swinsburg wrote:
> 
>> Agreed, for existing apps that are already heavily bound to Sakai's SqlService that wanted to make a change, this should be done. 
>> 
>> But for any new apps being developed, better directions can be taken in the persistence layer.
> 
> I found this page:
> 
> https://confluence.sakaiproject.org/display/BOOT/Spring+JDBC+Info
> 
> This a pretty direct example:
> 
> https://source.sakaiproject.org/contrib/programmerscafe/trunk/tasklist-simple/tool/src/java/org/sakaiproject/tool/tasklist/impl/TaskListManagerJdbcImpl.java
> 
> But this file is a little obtuse:
> 
> https://source.sakaiproject.org/contrib/programmerscafe/trunk/tasklist-simple/tool/src/webapp/WEB-INF/spring-beans.xml
> 
> Is there a simple direct way to get my hands on a properly provisioned jdbcTemplate so statements like the following work:
> 
> getJdbcTemplate().update(TASK_UPDATE_QUERY,
> 		new Object[] {t.getOwner(), t.getSiteId(), t.getTask(), t.getId()},
> 		new int[] {Types.VARCHAR, Types.VARCHAR, Types.CLOB, Types.BIGINT});
> I would also observe that the array of types is an extra effort beyond JDBC - seems a bit redundant to have to list each type.
> 
> /Chuck
> _______________________________________________
> 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/20110720/4b957088/attachment.html 


More information about the sakai-dev mailing list