Using Grails GORM standalone - orm

I'm currently wondering how it is possible to use the Groovy ORM Layer from Grails standalone outside of the Grails Framework. There is a Documentation Entry for doing so, but the ZIP file only links to an empty page. I downloaded Grails 1.2-M3 but I couldn't find anything in the docs either.
Does anybody know what the current state is and how to accomplish this?

AFAIK it is possible to use GORM standalone since Grails 1.1.
This allows you to use GORM as your ORM without using the full Grails framework
However, I don't think it's possible to use GORM outside of Spring (which is the foundation on which Grails is built). To summarise:
You can use GORM without using Grails
You cannot use GORM without using Spring
A sample application demonstrating how to use GORM outside Grails is available here. If you want to browse the source code of this example in a browser (instead of checking it out from the SVN repository), start here.

As of Grails 2.3.6, GORM is officially supported as a standalone module. See the release notes for more details.

Related

How to exclude a plugin from development environment in Grails 3?

I would like to disable a specific plugin while running in development mode. Is there a generic way to achieve this in Grails 3.x?
I found the following solutions for Grails 2.x, but they won't work for Grails 3 since it uses Gradle instead of BuildConfig.groovy:
Exclude plugin for specific environment
Is it possible to exclude grails plugin from production environment?
Specifically, I am looking for a way to disable the LDAP sub-plugin for the Spring Security plugin, when running in local development mode.
UPDATE: I found that org.grails.plugins.DefaultGrailsPlugin has an isEnabled method, that returns a boolean based on whether the plugin's profiles list matches the set of active profiles (e.g. "development").
But the private method that initalizes the profiles list (evaluateProfiles) appears not to be called anywhere (it should probably be called in initialisePlugin, along with other evaluate* methods).

Not ableto migrate from eclipse 3.x to eclipse 4.x

We've an RCP application based on 3.x api we are trying to migrate it to eclipse 4.x.
The problem is some part of the code was using eclipse internal classes present in the workbench.jar . SO i added the workbench.jar JAR from the previous eclipse(HELIOS) to my new eclipse(KEPLER) this resolved the errors .But my application is not able to start.So just wanted to know is it the correct approach
1.Can I have two workbench.jar JARS(3.105 and 3.6) in my application.
2.If no then is there a way to search for the internal classes which I was using previously in the new jars I was mainly using the internal classes related to layout and prespectives(like : org.eclise.ui.internal.layyoutPart ,org.eclipse.internal.ui.perspectives)
3.Is there a way using which I can avoid rewriting the code.
Eclipse 4.x is a very substantial rewrite so there is very little chance that internal classes from 3.x are going to work. Multiple workbench jars is not going to work in any case.
The layout and perspective classes you mention do not exist in Eclipse 4.x, you are going to have to rewrite your code.
See also Eclipse API Rules of Engagement

Hibernate in Eclipse Plugin Development Project

Presently I work in eclipse plugin development project. Here, there is a need to persist the domain objects. Can hibernate be used for Java persistency in the existing ecore based model classes? If yes, what are the challenges has to be taken into consideration?
Thanks in advance.
http://www.eclipse.org/cdo/
That's probably what are you looking for.

Mocking framework for osgi/eclipse applications?

I am looking for mocking framework to use in my osgi/eclipse test fragments. I have looked at:
http://www.jmock.org/download.html
but since its not osgi I need to convert it manually. I have tried to google for some mocking frameworks that works with osgi out of the box but have not been able to find any, does osgi developers not use mocking?
One solution will be to create mock objects of OSGi objects (like BundleContext and ServiceReference). You can use any mocking framework for this and of course you don't have to run the test in an OSGi container. This will be OK for simple scenarios.
If you want to test inside a container, you have the following options:
Pax-Exam
Spring DM Testing facilities
Actually Mockito works quite good with OSGI applications, since it has OSGI manifest. You can simply add it to your target platform from the latest orbit repository. I managed to make Powermock also working for Eclipse Plugins and it is available as well as update site at https://code.google.com/p/powermock-osgi/

Using Enunciate with Grails

I am creating Web APIs, in a RESTful manner. Grails of course has good support for creating REST web services. Enunciate claims to help in the API part, where things like documentation, client libraries, etc are important.
The purpose of this post is to invite experiences on using Enunciate with Grails, or ideas on how that can be done.
There are two main issues using them together:
Enunciate works with JAX-RS, not the native implementation of REST by Grails. Thankfully there's a JAX-RS plugin available, but am not sure if Enunciate will be able to work with it.
Grails domain classes are in Groovy while Enunciate works with Java
source code (example).
Enunciate works with both Java source code and Java compiled bytecode to do its work. But if you don't have Java source code, Enunciate won't be able to pull stuff out of your JavaDocs to enhance its generated documentation. Given that, there should (theoretically) be a way to apply Enunciate to compiled Groovy bytecode, but your docs won't be as rich because Enunciate won't be able to see your JavaDoc documentation. I say theoretically because I don't have any personal experience with it nor do I know how painful it is to pull off.
There is an open issue at ENUNCIATE-356 to investigate this complexity. Note that ENUNCIATE-356 depends on ENUNCIATE-584, which might get some more traction soon, being driven by ENUNCIATE-585 as we move from using APT (introduced in Java 5, deprecated in Java 7) to the Javac tool (introduced in Java 6). It would be interesting to know whether the Javac tool supports languages other than Java, in which case we'd get Groovy support for free.