Tag Archive 'Groovy'

Groovy and ORM

Posted by pebuchmann_super on 27 Mar 2009 | Tagged as: Software Development

Great article on groovy’s Object Relational Mapper GORM and the difference between using ORM inĀ  statically typed languages as opposed to a dynamical envrionment such as Groovy.

Groovy and JPA

Posted by pebuchmann_super on 21 Mar 2009 | Tagged as: Software Development

Tutorial about how to use Hibernate from within Groovy making use of Groovy Templating: import javax.persistence.* class JpaTemplate { EntityManagerFactory emf EntityManager em JpaTemplate(pu) { if (!pu) pu = “default” emf = Persistence.createEntityManagerFactory(pu) } void doInEntityManager(c, shutdown) { em = emf.createEntityManager() em.getTransaction().begin() c(em) em.getTransaction().commit() em.close() if (shutdown) shutdown() } void shutdown() { emf.close() } } [...]