Grails 2.4 and hibernate4 errors with run-app

It’s a bug, it seems that you can leave it that way and will cause no problem, but if you don’t want to see the message here are some solutions: (Edit: Option 2 seems to work better (see comments in this post)) 1.- singleSession configuration from DataSource.groovy https://jira.grails.org/browse/GRAILS-11198 2.- overriding the H2 dialect: public class … Read more

How to generate a ddl creation script with a modern Spring Boot + Data JPA and Hibernate setup?

Ah, right after I posted this question a section of the spring data docs caught my eye: 73.5 Configure JPA properties In addition all properties in spring.jpa.properties.* are passed through as normal JPA properties (with the prefix stripped) when the local EntityManagerFactory is created. So, to answer my own question: prefix the javax.persistence properties with … Read more

Configure Jackson to omit lazy-loading attributes in Spring Boot

With recent versions of Spring Boot this is much easier. Any beans of type com.fasterxml.jackson.databind.Module will be automatically registered with the auto-configured Jackson2ObjectMapperBuilder and applied to any ObjectMapper instances that it creates. This provides a global mechanism for contributing custom modules when you add new features to your application. 74.3 Customize the Jackson ObjectMapper First … Read more

what is the right path to refer a jar file in jpa persistence.xml in a web app?

Taking a look at jsr always works! 8.2.1.6.3 Jar Files One or more JAR files may be specified using the jar-file elements instead of, or in addition to the mapping files specified in the mapping-file elements. If specified, these JAR files will >be searched for managed persistence classes, and any mapping metadata annotations found on … Read more

JPA Uppercase table names

maybe because you are using MYSQL5DIALECT there’s a Postgres Dialect just used post it like this and for the improved naming strategy use EJB3 like Spring boot JPA insert in TABLE with uppercase name with Hibernate spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect hope it works for you

Hibernate ID Generator

A cursory search of Google for ‘hibernate custom id generator tutorial’ turned up the following possibilities. I’ve excluded those that don’t look useful and summarized the content of each. http://www.devx.com/Java/Article/30396 – covers the issues of generating an ID before the data is persisted (and hence does not yet have a business key). http://docs.jboss.org/hibernate/core/3.6/reference/en-US/html_single/#mapping-declaration – the … Read more