Hello,
Is it possible to work with abstract classes in Grails, like in Java!? It seems to me that it's possible with Groovy, but with Grails I have a compilation problem when I declare a class as "abstract"...
I am using the STS IDE for the development, when I save a class as "abstract", I have this message, before the server shuts down:
I understand that we cannot generate a view for an abstract class... but then how to deal with abstract classes in Grails?Code:2011-02-06 18:24:48,793 [main] ERROR context.GrailsContextLoader - Error executing bootstraps: Error creating bean with name 'messageSource': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is java.lang.NullPointerException org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'messageSource': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is java.lang.NullPointerException at org.grails.tomcat.TomcatServer.start(TomcatServer.groovy:212)
I have a class A, and I want to say that it has as attributes a set of objects belonging to the abstract class B:
Is it possible with Grails!? I guess the answer is yes... well I hope... but how!?Code:abstract class B { static constraints = { } } class A { static constraints = { } static hasMany = [b:B] }
Thanks a lot.


Reply With Quote