I have a master_data table, which has 100 rows of data. I created a view master_data_view in the database, selecting few columns in the master_data table.
Now In the java code.
String queryString = "from MasterDataView"; List<MasterDataView> data = entityManager.createQuery(queryString).getResultList();
I get list with the size of 100, but all are null values. Where did the data go.
I then switched on the DEBUG log hibernate, and got hold of the native SQL that gets executed on the database. This SQL fetches me all the records when i run it on the Database console.
One thing i noticed in the debug log is
2010-04-16 11:52:23,372 DEBUG [org.hibernate.loader.Loader] result row: null
Why is this inconsistent behavior when executed through EntityManger.
I use Sybase for database, Jboss for AS, The EntityManager is from javax.persistence
|