I think that it happened because spring wrapped a proxy around your
bean, and then hibernate couldn`t recognize its class and which table it
should look for. I`m not sure if you can get around it, but I agree with
Igor that you should create your domain objects with new, rather than
inject them.
you should be doing cat=new cat() anyways. i assume the "default" cat
is a singleton in your application context, in which case you do not
want it to be persisted anyways.
-igor
On Tue, Feb 22, 2011 at 1:59 PM, ookpalm<[email protected]> wrote:
Hi
I have a question about wicket spring.
My project is setup with Wicket-Spring plus using Hibernate annotation. I
created a Dao object says "CatDao" and created a entity for relational
mapping with hibernate says "Cat". Both are created by using Spring
applicationContext file.
On my page says "AddCat" I show the default values of "Cat" object that I
set in my applicationContext which is rendered correctly in textFields
(Wicket-spring works correctly). But when I use the command
catDao.store(cat); The following error happens:
Last cause: Unknown entity: WICKET_com.ook.Cat$$EnhancerByCGLIB$$d80b8019
I commented out the @SpringBean annotation of the varriable Cat in my AddCat
page and used the operator "new" directly to the Cat object like
Cat cat = new Cat();
The CatDao still remains the same
@SpringBean
CatDao catDao;
now the command catDao.store(cat); works fine. Data are written to the
Database. I have no clue how to solve this.
Please help.
--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/Wicket-Spring-Hibernate-dao-tp3320134p3320134.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]