kaleidos / grails-postgresql-extensions

Grails plugin to use postgresql native elements such as arrays, hstores,...
Apache License 2.0
78 stars 63 forks source link

Config setting no longer true by default #84

Closed bobbywarner closed 8 years ago

bobbywarner commented 8 years ago

With previous versions of the plugin, you did not have to specify the sequence_per_table config setting and it would default to true. Looks like now you do have to explicitly set it otherwise you get a NPE on this line -- https://github.com/kaleidos/grails-postgresql-extensions/blob/master/src/main/groovy/net/kaleidos/hibernate/PostgresqlExtensionsDialect.java#L60

Caused by: java.lang.ClassCastException: org.grails.config.NavigableMap$NullSafeNavigator cannot be cast to java.lang.Boolean
     at net.kaleidos.hibernate.PostgresqlExtensionsDialect$TableNameSequenceGenerator.configure(PostgresqlExtensionsDialect.java:60) ~[postgresql-extensions-4.6.4.jar:na]
     at org.hibernate.id.factory.internal.DefaultIdentifierGeneratorFactory.createIdentifierGenerator(DefaultIdentifierGeneratorFactory.java:117) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]```
ilopmar commented 8 years ago

I've done some tests and it's not a problem of the plugin but something related to Grails. I tried with a very simple project (https://github.com/ilopmar/pg-extensions-grails3-jsonb-example-app) and with Grails 3.0.10 or above the problem exist. You can clone the project, change the grails version to 3.0.9 with sdk and in gradle.properties and the project starts without problems.

I need to dig into grails source code to see what has changed and then check the values correctly in the plugin.

bobbywarner commented 8 years ago

@ilopmar Ah, ok. Sounds good. Thanks!

ilopmar commented 8 years ago

It seems that this commit may be related to the change: https://github.com/grails/grails-core/commit/50cf2449787809d8779d2a7b5c5dba9b7173046a

ilopmar commented 8 years ago

Fixed in 4.6.5 :smile: