Hibernateでサンプルプログラムを実行しようとすると...次のエラーが発生しました...それらを修正するアイデアはありますか?
Hibernate: insert into USER_DETAILS (data, date, phonenumber, USER_NAME, USER_ID) values (?, ?, ?, ?, ?)
Exception in thread "main" org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:92)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:275)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:268)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:184)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1216)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:383)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:133)
at org.rathan.dto.Test.main(Test.java:31)
Caused by: java.sql.BatchUpdateException: ORA-01747: invalid user.table.column, table.column, or column specification
at oracle.jdbc.driver.DatabaseError.throwBatchUpdateException(DatabaseError.java:367)
at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:9119)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:70)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:268)
... 8 more
これが私のメインクラスです:
package org.rathan.dto;
import java.util.Date;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
public class Test {
public static void main(String[] args) {
System.out.println(1);
UserDetails user=new UserDetails();
System.out.println(2);
user.setUserid(100);
user.setUsername("Rathan");
//user.setSalary(10000);
user.setPhonenumber("9989242487");
user.setAddress("My Home address");
user.setData("blah....blah....blah....blah....blah....");
user.setDate(new Date());
System.out.println(3);
SessionFactory factory=new Configuration().configure().buildSessionFactory();
System.out.println(4);
Session session=factory.openSession();
System.out.println(5);
session.beginTransaction();
System.out.println(6);
session.save(user);
System.out.println(7);
session.getTransaction().commit();
System.out.println(8);
session.close();
}}
ここでは、System.out.println(7)まで実行できます。その後、エラーが発生しました。