FAQ
Shouldn't it throw an exception with a descriptive message? Silently
ignoring it isn't especially helpful.
On Thu, Apr 2, 2015 at 8:27 AM Andrus Adamchik (JIRA) wrote:


[ https://issues.apache.org/jira/browse/CAY-1996?page=com.
atlassian.jira.plugin.system.issuetabpanels:comment-
tabpanel&focusedCommentId=14392733#comment-14392733 ]

Andrus Adamchik commented on CAY-1996:
--------------------------------------

Good catch [~SavvaKolbachev]. This is data rows we are talking about.
Adding a prefetch to a SelectQuery via string path doesn't work
---------------------------------------------------------------

Key: CAY-1996
URL: https://issues.apache.org/jira/browse/CAY-1996
Project: Cayenne
Issue Type: Bug
Components: Core Library
Affects Versions: 4.0.M2
Environment: MySQL 5.5.40-MariaDB-36.1, InnoDB, Mac OS X 10.10,
Java 8u40 (build 1.8.0_40-b27)
Reporter: Hugi Thordarson
Assignee: Savva Kolbachev

Adding a prefetch to a selectQuery via the relationship's name only
doesn't seem to work.
Entity "SMReceipt" has a to-one relationship "shop" to the entity
"SMShop". The first fetch performs a prefetch as expceted, the second fetch
performs no prefetching.
----------------------------------
FETCH 1 (working)
----------------------------------
SelectQuery<DataRow> q = SelectQuery.dataRowQuery( SMReceipt.class );
q.addPrefetch( SMReceipt.SHOP.joint() );
List<DataRow> list = objectContext.select( q );
----------------------------------
GENERATED SQL
----------------------------------
SELECT t0.creation_date, t0.date, t0.modification_date, t0.shop_id,
t0.storage_number, t0.text, t0.user_id, t0.id, t1.CITY_ID, t1.LOCATION,
t1.NAME, t1.CHAIN_ID, t1.SHOP_ID FROM strimillinn.fd_receipt t0 LEFT JOIN
strimillinn.fd_shop t1 ON (t0.shop_id = t1.SHOP_ID)
----------------------------------
FETCH 2 (not working)
----------------------------------
SelectQuery<DataRow> q = SelectQuery.dataRowQuery( SMReceipt.class );
q.addPrefetch( SMReceipt.SHOP.getName() );
List<DataRow> list = objectContext.select( q );
----------------------------------
GENERATED SQL
----------------------------------
SELECT t0.creation_date, t0.date, t0.modification_date, t0.shop_id,
t0.storage_number, t0.text, t0.user_id, t0.id FROM strimillinn.fd_receipt
t0



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 1 | next ›
Discussion Overview
groupdev @
categoriescayenne
postedApr 2, '15 at 2:31p
activeApr 2, '15 at 2:31p
posts1
users1
websitecayenne.apache.org

1 user in discussion

John Huss: 1 post

People

Translate

site design / logo © 2021 Grokbase