Hi,

Is your DAO marked with @Repository annotation?

e.g.
*@Repository("myDao")*
public class SomeDAO extends HibernateSessionDao implements IDao {


Plus in your client you need that @SpringBean,((Spring would inject it)

In my case I use a Service to get to the DAO - May not be necessary

@SpringBean( name = "serviceName")
private IService service;

The IService Impl is define like this


@Service("serviceName")

So Client calls the Service and the Service delegates to the DAO.

I think its something to do with the markup/annotation and probably missing
the configuration.

Hope this helps
niv


On Wed, Feb 23, 2011 at 6:26 AM, Dan Griffin <dangri...@gmail.com> wrote:

> 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<ookp...@gmail.com>  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: users-unsubscr...@wicket.apache.org
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>
>>>
>>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

Reply via email to