Groovy on Grails: GORM and BitSets?

Posted by Visionary Software Solutions on Stack Overflow See other posts from Stack Overflow or by Visionary Software Solutions
Published on 2009-11-15T23:57:41Z Indexed on 2010/04/12 20:03 UTC
Read the original article Hit count: 394

Filed under:
|
|
|

I don't see anything in the official documentation about unsupported persistence data types, so I'm working under the assumption that types available in the Groovy language should be handled. However, for the following domain class:

class DocGroupPermissions {

Workgroup workgroup;
Document document;
BitSet permissions = new BitSet(2)
public DocGroupPermissions() {}

void setPermissions(boolean canRead, boolean canWrite){
    setReadPermissions(canRead)
    setWritePermissions(canWrite)
}
BitSet getPermissions()
{
    return permissions
}
void setReadPermissions(boolean canRead)
{
    permissions.set(0,canRead)
}
void setWritePermissions(boolean canWrite)
{
    permissions.set(1,canWrite)
}

boolean getReadPermissions()
{
    return permissions.get(0)
}

boolean getWritePermissions()
{
    return permissions.get(1)
}


static belongsTo = [workgroup:Workgroup, document:Document]
static constraints = {
    workgroup(nullable:false, blank:false)
    document(nullable:false, blank:false)
}

}

I'm getting:

2009-11-15 16:46:12,298 [main] ERROR context.ContextLoader - Context initialization failed 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 org.hibernate.MappingException: An association from the table doc_group_permissions refers to an unmapped class: java.util.BitSet

Has anyone run into this before?

© Stack Overflow or respective owner

Related posts about grails

Related posts about gorm