Note that there are some explanatory texts on larger screens.

plurals
  1. POGrails Mapping error when adding a new domain object
    primarykey
    data
    text
    <p>I have created a new domain object in an existing Grails 1.3.7 project.</p> <pre><code>package com.xfitlog class Implement { String name String description String abbreviation static belongsTo = [exercise : Exercise] static constraints = { name( nullable: false, unique: true ) description( nullable: false, maxSize: 2000 ) abbreviation( nullable: true ) } String toString() { "${name}" } } </code></pre> <p>This class links to the 'Implement' class.</p> <pre><code>class Exercise{ String name String description boolean isApproved Implement implement static constraints = { name ( nullable: false ) description ( nullable: false, maxSize: 5000 ) isApproved ( nullable: true ) implement ( nullable: true ) } String toString() { "${name}" } } </code></pre> <p>When I run grails run-app through the windows command prompt I get the following errors:</p> <blockquote> <p>Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 's essionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is org.h ibernate.MappingException: An association from the table exercise refers to an unmapped class: com.xfitlog.Implement ... 28 more Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is org.hibernate.MappingException : An association from the table exercise refers to an unmapped class: com.xfitlog.Implement ... 28 more Caused by: org.hibernate.MappingException: An association from the table exercise refers to an unmapped class: com.xfitlog.Implement ... 28 more Application context shutting down...</p> </blockquote> <p>I have tried creating a new project and adding these same domain classes and everything works fine. I don't know what has changed in my original project but something is messed up.</p> <p>Thank you for your help.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload