Add behavior (relationships) to grails plugin domain classes from main application?

46 views Asked by At

I have a Grails plugin I've created which is intended to support a number of applications. This plugin has an Employee domain object. The problem is that, when used in the main application, domain objects from that application need to refer back to the Employee object. So, my main application might have an Address which belongsTo the Employee class from the plugin.

How can one handle this properly in Grails 2.5.0?

Thanks in advance.

1

There are 1 answers

0
Armaiti On

It looks like that your main and plugin depend on each other. In this case you should add the plugin location of one to another:

grails.plugin.location.<PLUGIN-NAME> = "<PATH TO YOUR PLUGIN>" Ex: "../myPlugin" assuming it is located on the same folder structure as the plugin

and in your plugin

grails.plugin.location.<APP-NAME>= "<PATH TO YOUR APP>" EX: "../myApp"