[EJB 3.0] - EJBQL : inherintace problem.
by joe480
Hello,
the problem: jpql query
I have 7 classes:
1.
@Inheritance(strategy = InheritanceType.JOINED)
@DiscriminatorColumn(name = "person_typ", discriminatorType = DiscriminatorType.STRING, length = 1)
@DiscriminatorValue("P")
public class Person
2. JuristischePerson(JP) extends Person - @DiscriminatorValue("J")
3. Naturliche(NP) extends Person - @DiscriminatorValue("N")
4. Verein(V) extends Person - @DiscriminatorValue("V")
by these 4 classes
5. VerNehmer 1to1 relation to Person
6. Halter 1to1 relation to Person
7. The Main class:
Evb 1to1 relation to VerNehmer
1to1 relation to Halter
I am using now a query to retrieve all evbs:
select e from Evb e left join e.halter h left join h.person p
Note:
1.I need the left joins because halter is sometimes null and also person in halter is sometimes null.
2.Person has general properties. More specific are juristische person with its name and so on...
Example for a problem:
JurisischePerson has a name property. Person does not.
I need to retrieve all evbs which the person of halter is FOR example a juristische person and has a name "Bank*" but also it can be another type like naturliche person which name could also be "Bank*"
In a query you can see the halter has only a person not JP, or NP,...
I would need something like this to ONLY ilustrate(I know that this is errorous):
select e from Evb e left join e.halter h left join h.person p as JuristischePerson jp, as NaturlischePerson np, as Verein v where jp.jurName like 'Bank%' or np.natName like 'Bank%' or v.verName like 'Bank%'.
Simply:
I need to have an alias for different types of person(s)- people to have the possibility to check if the name is what I am looking for.
Thanks.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4160149#4160149
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4160149
17 years, 10 months
[JBoss jBPM] - Re: job executor explained in a nutshell
by jpechane@redhat.com
Hi,
in my opinion READ_COMMITTED is the correct level of isolation for optimistic locking.
Morover in the forst post Tom contradicts himself
anonymous wrote : The required isolation level should be set to REPEATABLE_READ for hibernate's optimistic locking to work correctly. That isolation level will guarantee that
anonymous wrote : Non-Repeatable reads are a problem for optimistic locking and therefor, isolation level READ_COMMITTED is required if you configure more then 1 job executor thread
What I think is the problem with Exceutors is that they report the StaleObjectExcepetion even if it is quite expected result in such case.
Maybe for tables with jobs we should think about pessimistic locking as the conflicts can be quite frequent.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4160133#4160133
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4160133
17 years, 10 months