Grails 3.1.0.M2 Database Reverse Engineering - grails

Need of help.
I am new to Grails,
My question is How to do db-reverse-engineer.?
I did it in Grails 2.5.1 but I am struggling with Grails 3.1.0.M2 version.
Thanks in advance.

There's no plugin for Grails 3. I started to convert the older one but it's more work than I was expecting because it has to work with Hibernate 4, and the old plugin only works with Hibernate 3.
But the generated files wouldn't be any different in Grails 3 than in Grails 2 since GORM has stayed rather consistent. Since the plugin is only used at build time, and often only once or at most a few times, I recommend that you configure a Grails 2 app with the same database config settings and using the plugin there, then moving the generated files to your Grails 3 app.

Related

Is it possible to have different gorm versions in plugins within a grails 3 application?

I have a grails 3 application that makes heavy use of plugins. Some of these plugins provide domain classes. My application will not start unless every plugin has the same gorm version. This is an annoyance for locally developed plugins, but can be a significant problem for using third-party plugins.
There are more details in the stacktrace, but the relevant parts appear to be:
Caused by: org.grails.core.exceptions.GrailsRuntimeException: Failed to introspect class: class (my class name)
at grails.core.ArtefactHandlerAdapter.isArtefact(ArtefactHandlerAdapter.java:129)
at grails.core.DefaultGrailsApplication.addOverridableArtefact(DefaultGrailsApplication.java:772)
at org.grails.plugins.AbstractGrailsPluginManager.registerProvidedArtefacts(AbstractGrailsPluginManager.java:310)
I am currently using Grails 3.2.8 with GORM 6.1.3.RELEASE, but this happens with other non-matching versions for gorm as well.
If there is a better way to accomplish the bigger-picture goal, my big-picture goal is to use the grails ehcache plugin (currently at 3.0.0.M1) which requires gorm 6.1.x as a minimum. Per conversations on that plugin github site, there is no problem using gorm 6.1 with grails 3.2.x, though this is not the default.
Is there any way to run a grails 3 application, using plugins which provide domain objects, in which these plugins have different minor versions of gorm?
In case anyone else comes across this, the answer was basically "no".
The longer answer is "not as long as the groovy version is changing in non-backwards-compatible ways", and apparently that happens a lot.
There are some comments from Graeme here: https://github.com/grails/grails-core/issues/10693 but to summarize: you have to use the same version of gorm across plugins, and also make sure any third-party plugins you rely on are on the same version. This is only required for plugins that provide domain objects, at least!

Upgrading to Grails 3.2, now JSPs will not render

I am upgrading my application from Grails version 2.3.7 to version 3.2.2. My JSPs and other content like CSS and images all had to move from the old location of "web-app" to the new location of "src/main/resources/". Now, however, my JSPs will not load like they did before. For instance, my index page has always been http://hostname/app-name/homepage.jsp, and that always loaded just fine in Grails 2.x. Maybe there is just a configuration missing or something, does anyone have a suggestion. I have read the upgrade documentation, but have not found an answer to my problem.
As Grails 3 uses Spring Boot there is no default context. So your application should be served under http://hostname:port.
You can change it back to the previous URL as suggested in How do you change the application name in Grails 3?

Grails 3 does not have wrapper?

Does Grails 3.0.x no longer have the ability to create wrappers anymore?
The documentation doesn't seem to have the Grails wrapper section anymore.
Is there an alternative way which we can use the gradle wrapper to execute grails commands such as create-controller?
Does Grails 3.0.x no longer have the ability to create wrappers
anymore?
No.
Is there an alternative way which we can use the gradle wrapper to
execute grails commands such as create-controller?
Not for commands like create-controller, no.
We may re-introduce grailsw. File a feature request at https://github.com/grails/grails-core/issues if you would like to track that.
The Grails wrapper is back as of Grails 3.2.3:
http://docs.grails.org/3.2.x/guide/introduction.html#whatsNewGrailsWrapper
I have an app created with Grails 3.1.x, then upgraded to Grails 3.2.6, but the files such as 'grailsw' did not appear in my project root, and I'm not sure how to get them added via some command in the project.
When I create a new app using Grails 3.2.6, the new files are in the project root (grailsw, grailsw.bat, grails-wrapper.jar). I assume they can be copied over to an app like mine: a quick test of this worked for me.

Clustered cache in Grails 2.4.x

I need suggestions on cache clustering for Grails at the most recent version I can get.
I've been trying to set up Terracotta with Grails 2.4.4 but I can't manage to find a compatible version of its plugin (by the way, the Terracotta plugin page says it was last updated 6 years ago). Also I can't find any recent posts on cache clustering for grails.
I'm planning on using it also for session replication. I'm using Apache Shiro for authentication/authorization. But that shouldn't matter.
Ehcache has an embedded distributed solution based on RMI. I'm gonna give it a try but I'm not sure it'll work for web sessions in grails since the documentation says to use Terracotta.

Grails without gorm

I'm trying to create a grails app that has no database/hibernate/gorm/datasource configuration. In Rails, I can create a new app with the '--skip-active-record' command which will let me create controllers/models/etc without any database concerns.
I'm needing this because my controller just makes a couple rest calls and returns a result so there's no need for the database.
Is this possible? I saw Can I configure Grails with no datasource? but it seems to not work with Grails 2.3. I get this message: "To remove a plugin, delete it from BuildConfig.groovy and/or application.properties."
Is this possible? Thanks
The uninstall-plugin and install-plugin commands were deprecated in 2.2 and removed in 2.3.
To remove a plugin, delete it from BuildConfig.groovy and/or application.properties.
So you can just remove the hibernate plugin entry from BuildConfig.groovy. You probably also need to remove the cache plugin, and you should remove the database-migration plugin since you won't need it.

Resources