From: Katta <eti...@ya...> - 2004-09-11 20:51:17
|
Figured out. I realized that I need to use 'session.save' for the newly created object from Factory class. Thank you. --- Katta <eti...@ya...> wrote: > I feel that 'CustomerFactory.create()' doesn't seem > to > be working (I have Customer as Entity in model). > > Anything else, that I need to take care of? > > Thank you. > > > --- Katta <eti...@ya...> wrote: > > > After removing and reinitialzing the db-commands, > it > > seems that I am not getting that error anymore in > > JBoss. > > > > But, the new record doesn't seem to be created and > > fetched when accessed. > > > > Here are couple of files I am attaching. In this, > I > > am > > referring to CustomerManagerBeanImpl.java. > > > > Please let me know what is wrong? > > > > Thank you. > > > > > > --- Katta <eti...@ya...> wrote: > > > > > Hi, > > > > > > (1) Installed andromda-bin-3.0M3-SNAPSHOT > > > (2) Built all 'samples' successfully > > > (3) Created a test app (hibernate) > > > (4) Had a test model and generated code > > successfully > > > (5) I have also executed 'initializeSchema.cmd' > > > (JBoss > > > is already running) > > > (6) I changed couple of Impl.java files > > (Controller > > > Impl and Sessionbean Impl) to access Entity > > Factory > > > methods. > > > (7) When I access the app from Browser, it shows > > the > > > error as attached in the attachment (log.txt) > > file. > > > > > > Please help me what is wrong. > > > > > > Thank you. > > > > > > > __________________________________________________ > > > Do You Yahoo!? > > > Tired of spam? Yahoo! Mail has the best spam > > > protection around > > > http://mail.yahoo.com > 12:11:11,081 INFO > > [STDOUT] > > Hibernate: select > > > customer0_.ID as ID, customer0_.cl > > > ass as class, customer0_.FIRST_NAME as > FIRST_NAME, > > > customer0_.LAST_NAME as LAST_ > > > NAME from CUSTOMER customer0_ > > > 12:11:11,091 WARN [JDBCExceptionReporter] SQL > > > Error: -28, SQLState: S0022 > > > 12:11:11,091 ERROR [JDBCExceptionReporter] > Column > > > not found: CLASS in statement > > > [select customer0_.ID as ID, customer0_.class as > > > class, customer0_.FIRST_NAME as > > > FIRST_NAME, customer0_.LAST_NAME as LAST_NAME > > from > > > CUSTOMER customer0_] > > > 12:11:11,091 WARN [JDBCExceptionReporter] SQL > > > Error: -28, SQLState: S0022 > > > 12:11:11,091 ERROR [JDBCExceptionReporter] > Column > > > not found: CLASS in statement > > > [select customer0_.ID as ID, customer0_.class as > > > class, customer0_.FIRST_NAME as > > > FIRST_NAME, customer0_.LAST_NAME as LAST_NAME > > from > > > CUSTOMER customer0_] > > > 12:11:11,091 ERROR [JDBCExceptionReporter] Could > > not > > > execute query > > > java.sql.SQLException: Column not found: CLASS > in > > > statement [select customer0_.I > > > D as ID, customer0_.class as class, > > > customer0_.FIRST_NAME as FIRST_NAME, custome > > > r0_.LAST_NAME as LAST_NAME from CUSTOMER > > customer0_] > > > at org.hsqldb.Trace.getError(Unknown > > Source) > > > at org.hsqldb.Result.<init>(Unknown > > Source) > > > at > > > org.hsqldb.jdbcConnection.executeHSQL(Unknown > > > Source) > > > at > > org.hsqldb.jdbcConnection.execute(Unknown > > > Source) > > > at > > > org.hsqldb.jdbcStatement.fetchResult(Unknown > > Source) > > > at > > > org.hsqldb.jdbcStatement.executeQuery(Unknown > > > Source) > > > at > > > > > > org.hsqldb.jdbcPreparedStatement.executeQuery(Unknown > > > Source) > > > at > > > > > > org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery > > > (WrappedPreparedStatement.java:314) > > > at > > > > > > net.sf.hibernate.impl.BatcherImpl.getResultSet(BatcherImpl.java:87) > > > at > > > > > > net.sf.hibernate.loader.Loader.getResultSet(Loader.java:795) > > > at > > > > > > net.sf.hibernate.loader.Loader.doQuery(Loader.java:189) > > > at > > > > > > net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections > > > (Loader.java:133) > > > at > > > > > > net.sf.hibernate.loader.Loader.doList(Loader.java:950) > > > at > > > > > > net.sf.hibernate.loader.Loader.list(Loader.java:941) > > > at > > > > > > net.sf.hibernate.hql.QueryTranslator.list(QueryTranslator.java:834) > > > at > > > > > > net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1512) > > > at > > > > > > net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:39) > > > at > > > > > > com.sample.app.persistence.CustomerFactory.findAll(CustomerFactory.ja > > > va:61) > > > at > > > > > > com.sample.app.CustomerManagerBeanImpl.handleGetCustomers(CustomerMan > > > agerBeanImpl.java:33) > > > at > > > > > > com.sample.app.CustomerManagerBean.getCustomers(CustomerManagerBean.j > > > ava:328) > > > at > > > > > > sun.reflect.NativeMethodAccessorImpl.invoke0(Native > > > Method) > > > at > > > > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. > > > java:39) > > > at > > > > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces > > > sorImpl.java:25) > > > at > > > java.lang.reflect.Method.invoke(Method.java:324) > > > at > > > > > > org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(S > > > tatelessSessionContainer.java:683) > > > at > > > > > > === message truncated === __________________________________ Do you Yahoo!? New and Improved Yahoo! Mail - 100MB free storage! http://promotions.yahoo.com/new_mail |