Hi everybody,
I'm using Hibernate 3.3.2 with Oracle 10g.
I have a table A without primary key defined (don't tell me why, legacy system...).
A has 14 fields, so hb2ddl tool created two Classes: A and AId, where the latter is the set of all the table's fields. Among these fields, only 3 have the not null constraint.
The problem is: whenever I query the table, Hibernate finds the correct number of tuples, but if one ore more fields of a tuple were null, the entity is not instantiated and the criteria.list() return List has a null entry.
Does anybody can tell me why?
Here is an example taken from the logs (TRACE level). If CAPTION is not null I have
Code:
16:52:15,421 DEBUG AbstractBatcher:426 - about to open ResultSet (open ResultSets: 0, globally: 0)
16:52:15,423 TRACE BigDecimalType:193 - returning '2' as column: ALLINEAM1_0_0_
16:52:15,424 TRACE StringType:193 - returning 'column caption bla bla' as column: CAPTION0_0_
16:52:15,424 TRACE BigDecimalType:193 - returning '0' as column: COLINDEX0_0_
16:52:15,424 TRACE StringType:193 - returning 'colonnanome' as column: COLNAME0_0_
16:52:15,425 TRACE BigDecimalType:193 - returning '1' as column: COLORDER0_0_
16:52:15,425 TRACE BigDecimalType:193 - returning '2' as column: COLWIDTH0_0_
then more fields until the entity is created
If CAPTION is null
Code:
16:53:15,779 DEBUG AbstractBatcher:426 - about to open ResultSet (open ResultSets: 0, globally: 0)
16:53:15,781 TRACE BigDecimalType:193 - returning '2' as column: ALLINEAM1_0_0_
16:53:15,781 TRACE StringType:187 - returning null as column: CAPTION0_0_
16:53:15,784 DEBUG AbstractBatcher:433 - about to close ResultSet (open ResultSets: 1, globally: 1)
16:53:15,784 DEBUG AbstractBatcher:418 - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
16:53:15,784 TRACE AbstractBatcher:562 - closing statement
So at the first NULL met, the tuples seems to be abandoned
The table data type are all numbers or char or varchar, so the JPA entities have nothing in particular.
Any help would be really appreciated!
Thanks,
Ariminum