java.lang.NullPointerException at org.hibernate.cfg.Ejb3Column.getName(Ejb3Column.java:250) at org.hibernate.cfg.annotations.SimpleValueBinder.setType(SimpleValueBinder.java:218) at org.hibernate.cfg.annotations.PropertyBinder.makePropertyAndValue(PropertyBinder.java:185) ...
I think the problem is in the SimpleValueBinder.setType and a simple change should fix this:
Bulk rejecting stale issues. If this is still a legitimate issue on ORM 4, feel free to comment and attach a test case. I'll address responses case-by-case. Thanks!
If this is still a legitimate bug in ORM 4, please provide either a test case that reproduces it or enough detail (entities, mappings, snippets, etc.) to show that it still fails on 4. If nothing is received within 3 months or so, we'll be automatically closing them.
Thank you!
Ondrej MedekJune 22, 2011 at 12:16 PM
Or maybe what about to fix org.hibernate.mapping.Column.getName() to return the formula when the Column is created from Formula? I see the method Column.getName() is used at more places in the Hibernate code where is may be useful.
Hi,
see https://forum.hibernate.org/viewtopic.php?f=1&t=1002718:
@Formula("(my_sql_statement)")
@Type(type="MyEnum")
private MyEnum myField = null;
causes
java.lang.NullPointerException
at org.hibernate.cfg.Ejb3Column.getName(Ejb3Column.java:250)
at org.hibernate.cfg.annotations.SimpleValueBinder.setType(SimpleValueBinder.java:218)
at org.hibernate.cfg.annotations.PropertyBinder.makePropertyAndValue(PropertyBinder.java:185)
...
I think the problem is in the SimpleValueBinder.setType and a simple change should fix this:
typeParameters.setProperty( EnumType.COLUMN, columns[0].getName() );
+ typeParameters.setProperty( EnumType.COLUMN, columns[0].getMappingColumn() == null ? null : columns[0].getName() );