About join

51-60 of 200Refresh
Forum
31

How do I achieve a Deep Fetch using JOIN FETCH?

know that I can express one level of eager fetch in JPQL as follows: SELECT c FROM C JOIN FETCH c.bList WHERE c.id=:id But when I attempt to take it to the 2nd level: SELECT c FROM C JOIN FETCH c.bList JOIN FETCH c.bList.aList WHERE c.id=:id I get an error along the lines of: Invalid fetch path
Forum
31

LazyInitialization / join fetch

descrica2_2_3_ from the User usuario0_ left outer join on area area1_ usuario0_.codigo_area = area1_.codigo left outer join on User usuario2_ usuario0_.codigo_chefe = usuario2_.codigo left outer join company empresa3_ on usuario2_.codigo_empresa = empresa3_.codigo left outer join on specialty especialid4
Forum
31

Query with FETCH JOIN returns multiple results instead of one.

jpqlResult = em.createQuery( "SELECT d FROM Demand d JOIN FETCH d.services WHERE d=:demand ... with DISTINCT: SELECT DISTINCT d FROM Demand d JOIN FETCH d.services WHERE d=:demand You are probably ... Department d LEFT JOIN FETCH d.employees WHERE d.deptno = 1 "A fetch join has the same join semantics
Forum
30

Issue with Casting / Joins

MyEntity(); entity.getEmbeddeds().put("test", new EmbeddedA); ... // Try to query using join From from = criteria.from(MyEntity.class); MapJoin join = from.joinMap("embeddeds"); Path pathToEmbeddedAName = join.value().get("name") <-- fails with attribute "name" not found
Forum
30

InternalError on multiple AND and JOIN Query

Hi, Using objectdb 2.2.8_06. Running the following query: SELECT DISTINCT $1 FROM CDI $1 JOIN $1.contactDetails $2 JOIN $2.addresses $3 JOIN $3.attributeList $4 JOIN $2.phoneNumbers $5 JOIN $5.attributeList $6 WHERE ((($4.name='suburb') AND ($4.valueAsString='Los Angeles')) AND (($6.name='areacode
Forum
30

Lazy Init / Eager / Join Fetch collection strategy ? What to choose ?

,join fetch seems to be the right choice. What about ObjectDb ? The implementation is totally different. Is an "All eager strategy" more efficient that many join fetch ( cartesian product + distinct ... all strategy" Or "Fetch Join strategy" for ObjectDb ? Regards, Xirt > Is an "All eager strategy
Forum
30

Possible issue for JPQL "LEFT [OUTER] JOIN"

Possible issue for JPQL "LEFT [OUTER] JOIN" is doing "[INNER] JOIN".   Thanks. Thank ... work with the following JPQL queries string:     - "SELECT a,b FROM A a LEFT OUTER JOIN a.listB b ... ] [A4, null]??? NULL is only for single-valued field.     - "SELECT a,b FROM A a LEFT OUTER JOIN a.listB
Forum
30

How to use JOIN FETCH?

JOIN FETCH to avoid excessive round trips to the database: SELECT c FROM Country c JOIN FETCH c ... .   TypedQuery q = em.createQuery(         "select p from Person p join fetch p.addressHistory ... then this is normal for JOIN FETCH and you can remove duplication by using SELECT DISTINCT. The main problem
Forum
30

Multiple joins did not return expected result

a specific calendar by its id like: SELECT event FROM Calendar c1, SharedCalendar c2 INNER JOIN c1.events AS event INNER JOIN c2.original.events AS event WHERE c1.id=?1 OR c2.id=?1 Unfortunately ... JOIN c1.events AS event1 INNER JOIN c2.original.events AS event2 WHERE c1.id=?1 OR c2.id=?1 instead
Forum
30

Detaching objects after JOIN FETCH

Hi, I have a question about detaching objects after issuing query with JOIN FETCH. Let's say I ... to fetch all B classes with all A classes skipping lazy loading: select b from B b join fetch b ... is closed, B.aClasses is always null. I thought, that after join fetch and CascadeType.DETACH list