skusil som to takto:
DetachedCriteria criteria = DetachedCriteria.forClass(A.class);
criteria.add(Restrictions.in("id", getIds()));
List result = getHibernateTemplate().findByCriteria(criteria);
a zase som dostal tuto chybu:
...:Object with id: 4667772 was not of the specified subclass: sk.xxxxx.A
(Discriminator: 1 ); nested exception is
org.hibernate.WrongClassException: Object with id: 4667772 was not of the
specified subclass: sk.xxxxx.A (Discriminator: 1 )
chyba sa objavi hned po vykonani findByCriteria.
Ivan
--------- Original Message --------
From: Java <[email protected]>
To: Java <[email protected]>
Subject: Re: pouzitie discriminator v Hibernate
Date: 10/06/08 18:09
> Dne Tuesday 10 of June 2008 15:58:27 Ivan Polak napsal(a):
> > no praveze to nejako nefunguje: vypisuje to chybu:
> >
> > .....Object with id: 4667772 was not of the specified subclass:
sk.xxxx.A
> > (Discriminator: 1 ); nested exception is
> > org.hibernate.WrongClassException: Object with id: 4667772 was not of
the
> > specified subclass: sk.xxxxx.A (Discriminator: 1 )
>
> tak z toho nejsem 2x moudry ^^^
>
> jinak teÄ jsem vyzkou&scaron;el:
>
> for (Object o : session.createCriteria(Object.class).list()) {
> System.out.println(o.getClass().getSimpleName());
> }
>
> a vrátilo to pÄkný seznam v&scaron;ech možných entit...
>
> --
> Martin Beránek
>
>
________________________________________________
Message sent using Webmail 2.7.9