|
On 9/27/06, D T <[hidden email]> wrote:
> Actually, on a related topic, does it handle multiple collections of a > given type? That is to say, something like the following? > > class Person { > def hasMany = [friends : Person, enemies: Person] > } > > (what happens to the add___() methods?) > > Or, if you'd like a non-self-referencing example: > > class Book { > def hasMany = [authors: Person, reviewers: Person] > } > > (again, what happens to the add___() methods?) > > Would it be necessary to have different types? It doesn't atm no, I think we need to have a different method that is more explicit for this. Something like: def b = new Book() b.addToAuthors(new Person(..)) b.addToReviewers(new Person(..)) Raise an issue against 0.4 for this if you can. Graeme > > - Daiji > > Graeme Rocher wrote: > > On 9/26/06, Alex Shneyderman <[hidden email]> wrote: > >> > It doesn't do "plurals" as they're a crap idea. Plurals assume > >> > everyone speaks english which they clearly do not. > >> > >> I had no assumption of this kind. I just read a lot of code ... > > > > Didn't mean to sound offensive, sorry :-) > > > >> > >> > But you example below does work, because it doesn't need it. It takes > >> > the "categories" name from the key in the hasMany map. > >> > >> I was asking more about addCategory method that is added by GORM. > >> I built grails a few days ago and yesterday had a need to pluralize. > >> Unfortunately, the add method did not work as I expected, hence my > >> question. > > > > Can you post example code so we can understand better what it is you > > wanted to achieve? > > > > Cheers > > Graeme > >> > >> --------------------------------------------------------------------- > >> To unsubscribe from this list please visit: > >> > >> http://xircles.codehaus.org/manage_email > >> > >> > > > > > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > > --------------------------------------------------------------------- > To unsubscribe from this list please visit: > > http://xircles.codehaus.org/manage_email > > -- Graeme Rocher Grails Project Lead http://grails.org --------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email |
|
In reply to this post by Kiran-2
On 26 Sep 2006, at 20:50, Kiran K.G. wrote: > hi Graeme, > > Actually I want to use GORM from a java application. Just GORM without > Grails. I looked at the "InteractiveShell" class with code like > > ApplicationContext ctx = GrailsUtil.bootstrapGrailsFromClassPath(); > GrailsApplication app = (GrailsApplication)ctx.getBean( > GrailsApplication.APPLICATION_ID); > etc...... > > This approach works. However I am interested in using a more leight > weight > approach without SpringFramework etc.. I'm afraid you can forget this... Spring is integral to GORM and Grails. For example, the automatically generated classes relating to domain classes are put into a spring context and located using the spring context etc. Spring is a good dependency to have :) It's a major enabler for Grails and GORM. Cheers --------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email |
|
> I'm afraid you can forget this... Spring is integral to GORM and
> Grails. For example, the automatically generated classes relating to > domain classes are put into a spring context and located using the > spring context etc. > > Spring is a good dependency to have :) > > It's a major enabler for Grails and GORM. > > Cheers my only problem with that is that grails depends on spring version 1.2.6 (i think). I now work for a copmany that uses Spring 1.1.5. I wanted to take their business layer and develop web on top of it, without all that Struts stuff. Spring 1.1.5 dependency is due to the fact that hibernate 1.2.8 (net.sf packages) is also a dependency. I wonder how replacable those dependencies in grails with the old versions? Anyone got any ideas/experience with it? Thanks, Alex. --------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email |
|
I am interested in extracting GORM from Grails as well. I would love to use it
in a Swing framework we have been working on. Graeme, do you think this is a possible goal? Pascal On Wednesday 27 September 2006 03:50, Alex Shneyderman wrote: > > I'm afraid you can forget this... Spring is integral to GORM and > > Grails. For example, the automatically generated classes relating to > > domain classes are put into a spring context and located using the > > spring context etc. > > > > Spring is a good dependency to have :) > > > > It's a major enabler for Grails and GORM. > > > > Cheers > > my only problem with that is that grails depends on spring version > 1.2.6 (i think). > > I now work for a copmany that uses Spring 1.1.5. I wanted to take > their business layer and develop web on top of it, without all that > Struts stuff. Spring 1.1.5 dependency is due to the fact that > hibernate 1.2.8 (net.sf packages) is also a dependency. > > I wonder how replacable those dependencies in grails with the old > versions? Anyone got any ideas/experience with it? > > Thanks, > Alex. > > --------------------------------------------------------------------- > To unsubscribe from this list please visit: > > http://xircles.codehaus.org/manage_email |
|
yes it is possible, it is mainly about configuring the correct
classpath. For example if you type grails console It loads a Swing-based interactive console that you can use to interact with GORM. This does exactly what i'm talking about and it calls a class called grails.ui.Console. The job of setting up the classpath is done in the ant build. I admit it is not easy to extract at the moment and that is something we can maybe work on, but the are other priorities at the moment so if a member of the community is interested in exploring this themselves it would be a valuable contribution Cheers On 9/27/06, Pascal DeMilly <[hidden email]> wrote: > I am interested in extracting GORM from Grails as well. I would love to use it > in a Swing framework we have been working on. > > Graeme, do you think this is a possible goal? > > Pascal > > On Wednesday 27 September 2006 03:50, Alex Shneyderman wrote: > > > I'm afraid you can forget this... Spring is integral to GORM and > > > Grails. For example, the automatically generated classes relating to > > > domain classes are put into a spring context and located using the > > > spring context etc. > > > > > > Spring is a good dependency to have :) > > > > > > It's a major enabler for Grails and GORM. > > > > > > Cheers > > > > my only problem with that is that grails depends on spring version > > 1.2.6 (i think). > > > > I now work for a copmany that uses Spring 1.1.5. I wanted to take > > their business layer and develop web on top of it, without all that > > Struts stuff. Spring 1.1.5 dependency is due to the fact that > > hibernate 1.2.8 (net.sf packages) is also a dependency. > > > > I wonder how replacable those dependencies in grails with the old > > versions? Anyone got any ideas/experience with it? > > > > Thanks, > > Alex. > > > > --------------------------------------------------------------------- > > To unsubscribe from this list please visit: > > > > http://xircles.codehaus.org/manage_email > > > -- Graeme Rocher Grails Project Lead http://grails.org --------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email |
|
In reply to this post by Jeff Brown-2
We will update the chapter to reflect the latest changes before print.
Dierk http://groovy.canoo.com/gina > -----Original Message----- > From: Jeff Brown [mailto:[hidden email]] > Sent: Dienstag, 26. September 2006 23:05 > To: [hidden email] > Subject: Re: [grails-user] GORM 2.0 in SVN > > > I just got chapter 16 of GINA from Manning. Is it too late (or too > early) to update the book to reflect this? I have thought all along > that having id and version be declared in every domain class explicitely > is very un-Groovy. It would be a shame if the improvement were made and > couldn't be included in what will be a lot of people's first > introduction to Grails. > > > > jb > > Graeme Rocher wrote: > > Hi all, > > > > I've committed a big improvement to GORM which is in SVN at the > > moment. Essentially you no longer need to specify > > id,version,toString,hashCode and equals. So a Book class is as simple > > as: > > > > class Book { > > String title > > } > > > > The rest is injected for you at compile time. This has been extended > > to the creation of relationships to. So an Author class is as simple > > as: > > > > class Author { > > String name > > def hasMany = [books:Book] > > } > > > > The "books" collection is automatically created for you if you dont > > specifiy it yourself. So you can start doing this immediately: > > > > def a = new Author(name:"Stephen King") > > .addBook(new Book(title:"The Shining")) > > .addBook(new Book(title:"The Stand")) > > > > a.books.each { println it.title } > > > > Give it a try if you're brave, be interested to have some feedback. > > Couple of things to note: > > > > 1) Its backwards compatabile with the old GORM > > 2) It only injects properties/methods if you don't specify them yourself > > > > Next job on the list is to support Many-from-many. > > > > > -- > Jeff Brown > [hidden email] > Principal Software Engineer > Object Computing Inc. > http://www.ociweb.com/ > > Autism Strikes 1 in 250 > Find The Cause ~ Find The Cure > http://www.autismspeaks.org/ > > > > --------------------------------------------------------------------- > To unsubscribe from this list please visit: > > http://xircles.codehaus.org/manage_email --------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email |
|
In reply to this post by graemer
I downloaded latests source today (Oct 10, 2006) and built grails
successfully on linux (still not working on Widows). it is a bit strange but I follow the example bit by bit and I get exceptions runing the following in the BootStrap: new Author (name:"Leo Tolstoy") .addBook (new Book (title:"War And Peace")) .addBook (new Book (title:"Anna Karenina")) .save() new Author (name:"Imre Kertez") .addBook (new Book (title:"Faithless")) .save() I see tables created and relations are set up correctly, and exceptions below in the logs. Anything I am doing wrong or theese features are in flux? -- Thanks, Alex. [groovy] FrameworkServlet 'grails': initialization started [groovy] org.mortbay.util.MultiException[org.codehaus.groovy.runtime.InvokerInvocationException: groovy.lang.MissingMethodException: No signature of method Author.addBook() is applicable for argument types: (Book) values: {Book : null}] [groovy] at org.mortbay.http.HttpServer.doStart(HttpServer.java:731) [groovy] at org.mortbay.util.Container.start(Container.java:72) [groovy] at gjdk.org.mortbay.jetty.Server_GroovyReflector.invoke(Unknown Source) [groovy] at groovy.lang.MetaMethod.invoke(MetaMethod.java:111) [groovy] at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:655) [groovy] at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:367) [groovy] at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:147) [groovy] at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:104) [groovy] at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethod(ScriptBytecodeAdapter.java:80) [groovy] at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeNoArgumentsMethod(ScriptBytecodeAdapter.java:154) [groovy] at Script1.run(Script1.groovy:12) [groovy] at org.codehaus.groovy.ant.Groovy.execGroovy(Groovy.java:369) [groovy] at org.codehaus.groovy.ant.Groovy.execute(Groovy.java:259) [groovy] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275) [groovy] at org.apache.tools.ant.Task.perform(Task.java:364) [groovy] at org.apache.tools.ant.Target.execute(Target.java:341) [groovy] at org.apache.tools.ant.Target.performTasks(Target.java:369) [groovy] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216) [groovy] at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:37) [groovy] at org.apache.tools.ant.Project.executeTargets(Project.java:1068) [groovy] at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:382) [groovy] at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:107) [groovy] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275) [groovy] at org.apache.tools.ant.Task.perform(Task.java:364) [groovy] at org.apache.tools.ant.Target.execute(Target.java:341) [groovy] at org.apache.tools.ant.Target.performTasks(Target.java:369) [groovy] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216) [groovy] at org.apache.tools.ant.Project.executeTarget(Project.java:1185) [groovy] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40) [groovy] at org.apache.tools.ant.Project.executeTargets(Project.java:1068) [groovy] at org.apache.tools.ant.Main.runBuild(Main.java:668) [groovy] at org.apache.tools.ant.Main.startAnt(Main.java:187) [groovy] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246) [groovy] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67) [groovy] org.codehaus.groovy.runtime.InvokerInvocationException: groovy.lang.MissingMethodException: No signature of method Author.addBook() is applicable for argument types: (Book) values: {Book : null} [groovy] at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:657) [groovy] at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:367) [groovy] at groovy.lang.Closure.call(Closure.java:175) [groovy] at org.codehaus.groovy.grails.commons.DefaultGrailsBootstrapClass.callInit(DefaultGrailsBootstrapClass.java:43) [groovy] at org.codehaus.groovy.grails.commons.GrailsConfigUtils.executeGrailsBootstraps(GrailsConfigUtils.java:96) [groovy] at org.codehaus.groovy.grails.web.servlet.GrailsDispatcherServlet.createWebApplicationContext(GrailsDispatcherServlet.java:69) [groovy] at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:251) [groovy] at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:220) [groovy] at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:112) [groovy] at javax.servlet.GenericServlet.init(GenericServlet.java:211) [groovy] at org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:383) [groovy] at org.mortbay.jetty.servlet.ServletHolder.start(ServletHolder.java:243) [groovy] at org.mortbay.jetty.servlet.ServletHandler.initializeServlets(ServletHandler.java:446) [groovy] at org.mortbay.jetty.servlet.WebApplicationHandler.initializeServlets(WebApplicationHandler.java:321) [groovy] at org.mortbay.jetty.servlet.WebApplicationContext.doStart(WebApplicationContext.java:511) [groovy] at org.mortbay.util.Container.start(Container.java:72) [groovy] at org.mortbay.http.HttpServer.doStart(HttpServer.java:753) [groovy] at org.mortbay.util.Container.start(Container.java:72) [groovy] at gjdk.org.mortbay.jetty.Server_GroovyReflector.invoke(Unknown Source) [groovy] at groovy.lang.MetaMethod.invoke(MetaMethod.java:111) [groovy] at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:655) [groovy] at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:367) [groovy] at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:147) [groovy] at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:104) [groovy] at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethod(ScriptBytecodeAdapter.java:80) [groovy] at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeNoArgumentsMethod(ScriptBytecodeAdapter.java:154) [groovy] at Script1.run(Script1.groovy:12) [groovy] at org.codehaus.groovy.ant.Groovy.execGroovy(Groovy.java:369) [groovy] at org.codehaus.groovy.ant.Groovy.execute(Groovy.java:259) [groovy] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275) [groovy] at org.apache.tools.ant.Task.perform(Task.java:364) [groovy] at org.apache.tools.ant.Target.execute(Target.java:341) [groovy] at org.apache.tools.ant.Target.performTasks(Target.java:369) [groovy] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216) [groovy] at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:37) [groovy] at org.apache.tools.ant.Project.executeTargets(Project.java:1068) [groovy] at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:382) [groovy] at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:107) [groovy] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275) [groovy] at org.apache.tools.ant.Task.perform(Task.java:364) [groovy] at org.apache.tools.ant.Target.execute(Target.java:341) [groovy] at org.apache.tools.ant.Target.performTasks(Target.java:369) [groovy] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216) [groovy] at org.apache.tools.ant.Project.executeTarget(Project.java:1185) [groovy] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40) [groovy] at org.apache.tools.ant.Project.executeTargets(Project.java:1068) [groovy] at org.apache.tools.ant.Main.runBuild(Main.java:668) [groovy] at org.apache.tools.ant.Main.startAnt(Main.java:187) [groovy] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246) [groovy] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67) [groovy] Caused by: groovy.lang.MissingMethodException: No signature of method Author.addBook() is applicable for argument types: (Book) values: {Book : null} [groovy] at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:379) [groovy] at org.codehaus.groovy.grails.commons.metaclass.DelegatingMetaClass.invokeMethod(DelegatingMetaClass.java:59) [groovy] at gjdk.org.codehaus.groovy.grails.commons.metaclass.DelegatingMetaClass_GroovyReflector.invoke(Unknown Source) [groovy] at groovy.lang.MetaMethod.invoke(MetaMethod.java:111) [groovy] at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:655) [groovy] at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:367) [groovy] at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:147) [groovy] at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:104) [groovy] at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethod(ScriptBytecodeAdapter.java:80) [groovy] at Author.invokeMethod(Author.groovy) [groovy] at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:164) [groovy] at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:104) [groovy] at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethod(ScriptBytecodeAdapter.java:80) [groovy] at BudgetBootStrap$_closure1.doCall(BudgetBootStrap:9) [groovy] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [groovy] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [groovy] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [groovy] at java.lang.reflect.Method.invoke(Method.java:324) [groovy] at org.codehaus.groovy.runtime.ReflectionMetaMethod.invoke(ReflectionMetaMethod.java:67) [groovy] at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:655) [groovy] ... 49 more [groovy] org.codehaus.groovy.runtime.InvokerInvocationException: groovy.lang.MissingMethodException: No signature of method Author.addBook() is applicable for argument types: (Book) values: {Book : null} [groovy] at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:657) [groovy] at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:367) [groovy] at groovy.lang.Closure.call(Closure.java:175) [groovy] at org.codehaus.groovy.grails.commons.DefaultGrailsBootstrapClass.callInit(DefaultGrailsBootstrapClass.java:43) [groovy] at org.codehaus.groovy.grails.commons.GrailsConfigUtils.executeGrailsBootstraps(GrailsConfigUtils.java:96) [groovy] at org.codehaus.groovy.grails.web.servlet.GrailsDispatcherServlet.createWebApplicationContext(GrailsDispatcherServlet.java:69) [groovy] at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:251) [groovy] at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:220) [groovy] at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:112) [groovy] at javax.servlet.GenericServlet.init(GenericServlet.java:211) [groovy] at org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:383) [groovy] at org.mortbay.jetty.servlet.ServletHolder.start(ServletHolder.java:243) [groovy] at org.mortbay.jetty.servlet.ServletHandler.initializeServlets(ServletHandler.java:446) [groovy] at org.mortbay.jetty.servlet.WebApplicationHandler.initializeServlets(WebApplicationHandler.java:321) [groovy] at org.mortbay.jetty.servlet.WebApplicationContext.doStart(WebApplicationContext.java:511) [groovy] at org.mortbay.util.Container.start(Container.java:72) [groovy] at org.mortbay.http.HttpServer.doStart(HttpServer.java:753) [groovy] at org.mortbay.util.Container.start(Container.java:72) [groovy] at gjdk.org.mortbay.jetty.Server_GroovyReflector.invoke(Unknown Source) [groovy] at groovy.lang.MetaMethod.invoke(MetaMethod.java:111) [groovy] at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:655) [groovy] at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:367) [groovy] at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:147) [groovy] at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:104) [groovy] at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethod(ScriptBytecodeAdapter.java:80) [groovy] at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeNoArgumentsMethod(ScriptBytecodeAdapter.java:154) [groovy] at Script1.run(Script1.groovy:12) [groovy] at org.codehaus.groovy.ant.Groovy.execGroovy(Groovy.java:369) [groovy] at org.codehaus.groovy.ant.Groovy.execute(Groovy.java:259) [groovy] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275) [groovy] at org.apache.tools.ant.Task.perform(Task.java:364) [groovy] at org.apache.tools.ant.Target.execute(Target.java:341) [groovy] at org.apache.tools.ant.Target.performTasks(Target.java:369) [groovy] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216) [groovy] at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:37) [groovy] at org.apache.tools.ant.Project.executeTargets(Project.java:1068) [groovy] at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:382) [groovy] at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:107) [groovy] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275) [groovy] at org.apache.tools.ant.Task.perform(Task.java:364) [groovy] at org.apache.tools.ant.Target.execute(Target.java:341) [groovy] at org.apache.tools.ant.Target.performTasks(Target.java:369) [groovy] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216) [groovy] at org.apache.tools.ant.Project.executeTarget(Project.java:1185) [groovy] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40) [groovy] at org.apache.tools.ant.Project.executeTargets(Project.java:1068) [groovy] at org.apache.tools.ant.Main.runBuild(Main.java:668) [groovy] at org.apache.tools.ant.Main.startAnt(Main.java:187) [groovy] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246) [groovy] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67) [groovy] Caused by: groovy.lang.MissingMethodException: No signature of method Author.addBook() is applicable for argument types: (Book) values: {Book : null} [groovy] at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:379) [groovy] at org.codehaus.groovy.grails.commons.metaclass.DelegatingMetaClass.invokeMethod(DelegatingMetaClass.java:59) [groovy] at gjdk.org.codehaus.groovy.grails.commons.metaclass.DelegatingMetaClass_GroovyReflector.invoke(Unknown Source) [groovy] at groovy.lang.MetaMethod.invoke(MetaMethod.java:111) [groovy] at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:655) [groovy] at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:367) [groovy] at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:147) [groovy] at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:104) [groovy] at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethod(ScriptBytecodeAdapter.java:80) [groovy] at Author.invokeMethod(Author.groovy) [groovy] at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:164) [groovy] at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:104) [groovy] at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethod(ScriptBytecodeAdapter.java:80) [groovy] at BudgetBootStrap$_closure1.doCall(BudgetBootStrap:9) [groovy] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [groovy] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [groovy] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [groovy] at java.lang.reflect.Method.invoke(Method.java:324) [groovy] at org.codehaus.groovy.runtime.ReflectionMetaMethod.invoke(ReflectionMetaMethod.java:67) [groovy] at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:655) [groovy] ... 49 more On 9/26/06, Graeme Rocher <[hidden email]> wrote: > Hi all, > > I've committed a big improvement to GORM which is in SVN at the > moment. Essentially you no longer need to specify > id,version,toString,hashCode and equals. So a Book class is as simple > as: > > class Book { > String title > } > > The rest is injected for you at compile time. This has been extended > to the creation of relationships to. So an Author class is as simple > as: > > class Author { > String name > def hasMany = [books:Book] > } > > The "books" collection is automatically created for you if you dont > specifiy it yourself. So you can start doing this immediately: > > def a = new Author(name:"Stephen King") > .addBook(new Book(title:"The Shining")) > .addBook(new Book(title:"The Stand")) > > a.books.each { println it.title } > > Give it a try if you're brave, be interested to have some feedback. > Couple of things to note: > > 1) Its backwards compatabile with the old GORM > 2) It only injects properties/methods if you don't specify them yourself > > Next job on the list is to support Many-from-many. > > -- > Graeme Rocher > Grails Project Lead > http://grails.org > > --------------------------------------------------------------------- > To unsubscribe from this list please visit: > > http://xircles.codehaus.org/manage_email > > --------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email |
| Powered by Nabble | Edit this page |
