I am having trouble with Hibernate reading an Oracle database table.
I have created a sql script to create and populate a table that will be used to configure my software.
While testing to see if Hibernate will get any data from the table, I have noticed that if I input data into the table using hibernate, I can get this data back out using hibernate.
Any data inserted from the sql script will not be read by hibernate.
I have checked the config.hbn.xml file and Config.java class.
Like I said, it works when I have inserted data using hibernate, but not data I put in with a script.
The primary key is a long and the database the key is a number( 38, 0 )
The code I used is something like this -
Session s = factory.openSession();
try {
String SQL_QUERY = "from Config config";
Query query = s.createQuery(SQL_QUERY);
for (Iterator it = query.iterate(); it.hasNext();) {
Config con = (Config ) it.next();
System.out.println(": " + con.toString());
}
} catch (Exception e) {
System.out.println(e.getMessage());
}
s.close();
Any ideas would be appreciated.
|