I have 2 simple tables called ITEM ( primry key ID CHAR(10)) and BID (FK ITEM_ID CHAR(10) references ID(ITEM)).
Both primary key and foreign keys are CHAR(10) In the entity I have a bidirectional one to many relationship( Item to Bid [1..N])
Hibernate is not retrieving the list of Bids from Item instance. I am doing eager fetching.The generated sql is just fine but the list is empty.
For Example say ITEM table has got a row with Primary key "ONE"
and BID Table has got 3 rows with BID.ITEM_ID as "ONE"
itemObject.getBids("ONE"); -----> returns an Empty List
How ever if I pad the input with spaces and make its length 10, I can get the Bid collection from Item. itemObject.getBids("ONE[7 spaces padding]"); -----> returns a list of 3 Bids
I know that this is happening for CHAR datatype, does anyone knows how to solve this?
The detailed source code is in my previous posting in Hibernate forum
http://forum.hibernate.org/viewtopic.php?t=986258&highlight= "Topic: Hibernate problem with Fixed Length CHAR"