After I upgraded my hibernate from 3.3.2 to 3.5.1 the implementation of MultipleHiLoPerTableGenerator configure method had changed.
When I try to configure an MultipleHiLoPerTableGenerator I get a NullPointerException at line 229 in its configure method:
Code:
227 ObjectNameNormalizer normalizer = ( ObjectNameNormalizer ) params.get( IDENTIFIER_NORMALIZER );
228
229 tableName = normalizer.normalizeIdentifierQuoting( PropertiesHelper.getString( ID_TABLE, params, DEFAULT_TABLE ) );
It seems to me that I now need to set the property identifier_normalizer as well as the other usual table, primary_key_column, primary_key_length etc.. However I have no idea what value to set for the identifier_normalizer. I can't find any documentation for this new field.
This is my code for setting up the generator:
Code:
Properties props = new Properties();
props.put("max_lo", "0");
props.put("table", "MYTABLE");
props.put("primary_key_column", "MYTABLECOLUMN1");
props.put("primary_key_length", "18");
props.put("value_column", "MYTABLECOLUMN2");
props.put("identifier_normalizer", WHAT TO PUT HERE);
Dialect dialect = (Dialect) Class.forName("org.hibernate.dialect.Oracle10gDialect").newInstance();
MultipleHiLoPerTableGenerator agrGenerator = new MultipleHiLoPerTableGenerator();
props.put("primary_key_value", "PARAMNAME1");
agrGenerator.configure(Hibernate.LONG, props, dialect);