[hibernate-issues] [Hibernate-JIRA] Created: (HCANN-25) Can't have an @Formula attribute in an @EmbeddedId

Nicholas White (JIRA) noreply at atlassian.com
Wed Jun 2 06:45:35 EDT 2010


Can't have an @Formula attribute in an @EmbeddedId
--------------------------------------------------

                 Key: HCANN-25
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HCANN-25
             Project: Hibernate Commons Annotations
          Issue Type: Bug
    Affects Versions: 3.2.0
            Reporter: Nicholas White


If a class that will be used as an embedded id has a column that is defined by an @Formula attribute, hibernate throws a NPE. This is because the below method in org.hibernate.cfg.Ejb3Column doesn't check if the mappingColumn is null (which it is when the column is defined by a formula) before dereferencing it.

	public void forceNotNull() {
		mappingColumn.setNullable( false );
	}

To fix, change the method to:


	public void forceNotNull() {
		if (mappingColumn != null) {
			mappingColumn.setNullable( false );
		}
	}


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list