Generated Qury : select templatede0_.TEMPLATEID as TEMPLATEID, templatede0_.TEMPLATETYPE as TEMPLATE2_, templatede0_.DETAILDESC as DETAILDESC, templatede0_.OWNERCODE as OWNERCODE from TEMPLATEDETAILS templatede0_
This qury retrieving two record when I executed in TOAD. But my list from Query object is empty.
Used Middlegen to generate Mapping files and beans. Table have one primary hey called templateid.
Thanks Sudhakar
sudhakar Tadepalli
Ranch Hand
Joined: Dec 27, 2001
Posts: 130
posted
0
FYI, I tried inserting and it workd fine.
sudhakar Tadepalli
Ranch Hand
Joined: Dec 27, 2001
Posts: 130
posted
0
I solved the puzzle. I have manually insterted records in the database and when tried retrieving got empty list, I tried insterting one record through save() method and tried searching , now I got one record back.
After I inserted records manually I ran commit; command also but not sure why hibernate not able to query the records which are manually inserted in db and only able to retrieve which are programatically inserted.
Originally posted by sudhakar Tadepalli: How to find out whether caching is on/off. I used middlegen to create mapping files and pojo's.
Sudhakar
Look at your mapping files. If you've added a <cache /> element to your class then you are asking Hibernate to use the second level cache. The first level cache is (of course) always used. It shouldn't be that though. Is the only difference from your first failed attempt and your second successful one that you forced a commit after running your insert statement in Toad? Because, if I remember right, Toad is configured by default not to commit after every statement.