Very well this solution (using composite-ids)
To try it, I have mounted the tables in Hypersonic SQL database source, I had been able to persist a pojo. But, when I had tried use Progress SQL, I have got this following message:
Quote:
15:26:09,085 WARN [JDBCExceptionReporter] SQL Error: 0, SQLState: 22001
15:26:09,085 ERROR [JDBCExceptionReporter] [JDBC Progress Driver]:String data, right truncated. Error in parameter 18.
15:26:09,100 ERROR [JDBCExceptionReporter] Could not synchronize database state with session
java.sql.SQLException: [JDBC Progress Driver]:String data, right truncated. Error in parameter 18.
at com.progress.sql.jdbc.JdbcProgress.createSQLException(JdbcProgress.java:6562)
at com.progress.sql.jdbc.JdbcProgress.standardError(JdbcProgress.java:6736)
at com.progress.sql.jdbc.JdbcProgress.SQLExecute(JdbcProgress.java:2790)
at com.progress.sql.jdbc.JdbcProgressPreparedStatement.execute(JdbcProgressPreparedStatement.java:238)
at com.progress.sql.jdbc.JdbcProgressPreparedStatement.executeUpdate(JdbcProgressPreparedStatement.java:144)
at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeUpdate(WrappedPreparedStatement.java:308)
at net.sf.hibernate.impl.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:22)
at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:478)
at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:454)
at net.sf.hibernate.impl.ScheduledInsertion.execute(ScheduledInsertion.java:20)
at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2100)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2061)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2005)
at br.com.toyota.dss.sessions.PersistencySessionBean.action(PersistencySessionBean.java:90)
at br.com.toyota.dss.sessions.PersistencySessionBean.add(PersistencySessionBean.java:136)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:660)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:77)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:107)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:237)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:98)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:130)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:208)
at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.java:313)
at org.jboss.ejb.Container.invoke(Container.java:738)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:383)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
at sun.rmi.transport.Transport$1.run(Transport.java:148)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:536)
What must I do ?