English 中文(简体)
如何再利用铁路应用领域类别?
原标题:How to reuse Grails application s domain classes?
  • 时间:2011-07-06 15:30:21
  •  标签:
  • grails

我已经建立了铁路公司申请。 出于某些原因,我需要为某个人设立另一个专才申请,以修改数据库数据。

  1. Is it possible to package Grails application as a JAR library, so that the console application can reuse those domain classes?
  2. Or, I add/create some classes in Grails application and package it as a JAR and run as console application?
问题回答

If no better answer, probably I will use the batch-launcher plugin to do that.

You can put the domain classes in a JAR and tell Grails that these are your domain classes by adding a Hibernate XML file (in grails-app/conf/hibernate) that refers to the classes in this JAR. You can use this JAR in any other Java/Groovy application, but obviously they ll only have the persistence methods (dynamic finders, save(), etc.) when used in a Grails app.





相关问题
grails + gwt request handling via controllers

I am new to gwt. I am trying to integrate gwt+grails.Can anybody provide me a good example for handling the request using grails controllers and not a custom servlet.I will be really thankful if ...

Error loading the grails gwt module xml

I ve installed the plugin from this article by Peter http://www.cacoethes.co.uk/blog/groovyandgrails/the-command-pattern-w.... While compile time its not able to find the module file which is present ...

Sorting Objects Based on Custom Domain Class Methods

I have a domain class, in which I ve defined some methods which give the object a score based on different algorithms (eg. popularity). I now want to retrieve a list of these objects sorted by one of ...

Grails Packaging and Naming Conventions

Packaging Controllers, Services,etc. i.e. - com.company.controllers - com.company.services Is this a good practice or should be avoided by all means?? Another worth mentioning problem I encountered ...

Hibernate/GORM: collection was not processed by flush()

I have an integration test in my Grails application that fails when I try to save an entity of type Member invitingMember.save(flush: true) This raises the following exception org.hibernate....

热门标签