Groovy « Development « JPA Q&A





1. Grails Hibernate H2 problem    stackoverflow.com

I have an application with two domain classes as follows:

DomainA : PK, name DomainB : PK, FK (points to DomainA.PK), name.
And when I try to ...

2. Grails: org.hibernate.TransientObjectException    stackoverflow.com

Simple Groovy\Grails code:

def start = {
        source.save()

        def result = getJson(hotelSite, eng + index, [:])
   ...

3. Why don't Domain class static methods work from inside a grails "service"?    stackoverflow.com

I want a grails service to be able to access Domain static methods, for queries, etc. For example, in a controller, I can call

IncomingCall.count()
to get the number of records in table "IncomingCall" but ...

4. Combine Hibernate class with @Bindable for SwingBuilder without Griffon?    stackoverflow.com

I have implemented a back-end for my application in Groovy/Gradle, and am now trying to implement a GUI. I am using Hibernate for my data storage (with HSQLDB) per http://groovy.codehaus.org/Using+Hibernate+with+Groovy (with ...

5. grails / gorm / org.hibernate.type at TRACE prints nothing    stackoverflow.com

I can't configure org.hibernate.type (logging bind variables used in hibernate prepared statements) using log4j.xml, but can using the log4j DSL in Config.groovy. We need to configure logging for different environments without ...

6. Tree structure in GORM (grails)    stackoverflow.com

I'm trying to define a tree structure in GORM. Here is my model:

class Tree {
    String name
    Level rootLevel

    static hasOne = ...

7. Using JPA domain classes in Grails    stackoverflow.com

I want to use a JPA domain model in an application developed using the latest Grails milestone (2.0.0.M1). The JPA domain classes are in the src\java directory of the application. Based on ...

8. uppercase first letter in play framework    stackoverflow.com

I have installed jpagen module in my system in play framework. Which successfully generates class files but i want to generate setter and getter functions too using for get function i'm ...

9. Calling Hibernate in background threads in grails    stackoverflow.com

I am trying to create a specific type of background processing setup in a grails application.

  • A fixed size thread pool exists only for the duration of the batch of jobs
  • A single ...





10. How to create a "view" domain object in Grails    stackoverflow.com

I'm trying to adapt a legacy database to a grails application and I'm not sure how can I do it on grails. I have a huge table (with columns colA, colB, ...

11. Hibernate+GroovyTestcase: Unable to figure out the error in the code below ..    stackoverflow.com

I am getting a test failure on the test below. Specifically it complains for "expect(mockSession.save(hibernateTransitInfo)).andReturn(hibernateTransitInfo)" and it complains "incompatible return type" Test code

void testCreateTransitFileInfo()
    {
     ...

12. Hibernate + Dynamic Groovy Class (Is this even possible)    coderanch.com

Hey all, Having a mental exercise right now. I've got a file on my computer called User.groovy package com.test; import javax.persistence.*; import java.util.HashSet; import java.util.Set; import com.test.DataUtils; @Entity @Table(name = "user") public class User { public test() { def manager = DataUtils.getInstance().createEntityManager() manager.getTransaction().begin() manager.persist new User(name: "Peter") manager.getTransaction().commit() } @Id @GeneratedValue(strategy = GenerationType.AUTO) @Column(name = "ID", nullable = false) Long id; ...