[jira] [Updated] (CAY-2502) DataMap in DataNode tree view disappears after dbImport

2019-02-11 Thread Nikita Timofeev (JIRA)


 [ 
https://issues.apache.org/jira/browse/CAY-2502?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Nikita Timofeev updated CAY-2502:
-
Component/s: dbimport

> DataMap in DataNode tree view disappears after dbImport
> ---
>
> Key: CAY-2502
> URL: https://issues.apache.org/jira/browse/CAY-2502
> Project: Cayenne
>  Issue Type: Bug
>  Components: dbimport, Modeler
>Reporter: Arseni Bulatski
>Priority: Major
> Fix For: 4.1.M3
>
>
> DataMap in DataNode tree view disappears after dbImport. Link between dataMap 
> and dataNode exists.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (CAY-2494) Rename dbImport tag from 'config' to 'dbImport'

2019-02-11 Thread Nikita Timofeev (JIRA)


 [ 
https://issues.apache.org/jira/browse/CAY-2494?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Nikita Timofeev updated CAY-2494:
-
Component/s: dbimport

> Rename dbImport tag from 'config' to 'dbImport'
> ---
>
> Key: CAY-2494
> URL: https://issues.apache.org/jira/browse/CAY-2494
> Project: Cayenne
>  Issue Type: Task
>  Components: Core Library, dbimport
>Reporter: Arseni Bulatski
>Assignee: Nikita Timofeev
>Priority: Major
>  Labels: pull-request-available
> Fix For: 4.1.M3
>
>
> Rename dbImport tag in datamap to 'dbImport'. Previous value was 'config'. 
> Need to save backward compatibility.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (CAY-2534) Join table is mapped when meaningful PK is set

2019-02-11 Thread Nikita Timofeev (JIRA)


 [ 
https://issues.apache.org/jira/browse/CAY-2534?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Nikita Timofeev updated CAY-2534:
-
Component/s: dbimport

> Join table is mapped when meaningful PK is set
> --
>
> Key: CAY-2534
> URL: https://issues.apache.org/jira/browse/CAY-2534
> Project: Cayenne
>  Issue Type: Bug
>  Components: dbimport, Modeler
>Affects Versions: 4.1.M3
>Reporter: ana benko
>Assignee: Nikita Timofeev
>Priority: Major
> Fix For: 4.1.M3
>
>
> # Select db schema with tables joined by many-to-many relationship
>  # In Tables with meaningful PK pattern provide one of the table names joined 
> by many-to-many relationship (not the join table)
>  # Run Import
> -> Join table is mapped -> NOT OK



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (CAY-2501) Modeler: DbImport ui not loading columns for MySQL connector v8.0

2019-02-11 Thread Nikita Timofeev (JIRA)


 [ 
https://issues.apache.org/jira/browse/CAY-2501?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Nikita Timofeev updated CAY-2501:
-
Component/s: dbimport

> Modeler: DbImport ui not loading columns for MySQL connector v8.0
> -
>
> Key: CAY-2501
> URL: https://issues.apache.org/jira/browse/CAY-2501
> Project: Cayenne
>  Issue Type: Bug
>  Components: dbimport, Modeler
>Affects Versions: 4.1.M2
>Reporter: Nikita Timofeev
>Assignee: Nikita Timofeev
>Priority: Major
> Fix For: 4.1.M3
>
>
> Column loading works for MySQL connector 6.* and fails for connector 8.0.*



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (CAY-2491) Remaster Db Import View

2019-02-11 Thread Nikita Timofeev (JIRA)


 [ 
https://issues.apache.org/jira/browse/CAY-2491?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Nikita Timofeev updated CAY-2491:
-
Component/s: dbimport

> Remaster Db Import View
> ---
>
> Key: CAY-2491
> URL: https://issues.apache.org/jira/browse/CAY-2491
> Project: Cayenne
>  Issue Type: Improvement
>  Components: dbimport, Modeler
>Reporter: Konstantin
>Assignee: Nikita Timofeev
>Priority: Minor
> Fix For: 4.1.M3
>
>
> * Add table columns lazy loading.
>  * Make Db Import view have flexible design.
>  * Add show/hide advanced options button.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (CAY-2476) Wrong behaviour of code generation dialog

2019-02-11 Thread Nikita Timofeev (JIRA)


 [ 
https://issues.apache.org/jira/browse/CAY-2476?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Nikita Timofeev updated CAY-2476:
-
Component/s: cgen

> Wrong behaviour of code generation dialog
> -
>
> Key: CAY-2476
> URL: https://issues.apache.org/jira/browse/CAY-2476
> Project: Cayenne
>  Issue Type: Bug
>  Components: cgen, Modeler
>Affects Versions: 4.1.M3
>Reporter: Konstantin
>Assignee: Nikita Timofeev
>Priority: Minor
>  Labels: pull-request-available
> Fix For: 4.1.M3
>
>
> 1. When 'Make Pairs' checkbox is disabled, after reopen CodeGeneratorDialog 
> the 'Superclass Template' dropdown should be disabled.
> 2. On disable 'Make Pairs' the 'Subclass Template' dropdown should be 
> disabled to, and generator should use the singleclass.vm template for 
> generation by defauld.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (CAY-2531) Importing same schema after Import Revert clears all entities in datamap

2019-02-11 Thread Nikita Timofeev (JIRA)


 [ 
https://issues.apache.org/jira/browse/CAY-2531?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Nikita Timofeev updated CAY-2531:
-
Component/s: dbimport

> Importing same schema after Import Revert clears all entities in datamap
> 
>
> Key: CAY-2531
> URL: https://issues.apache.org/jira/browse/CAY-2531
> Project: Cayenne
>  Issue Type: Bug
>  Components: dbimport, Modeler
>Affects Versions: 4.1.M3
>Reporter: ana benko
>Assignee: Arseni Bulatski
>Priority: Minor
> Fix For: 4.1.M3
>
>
> Preconditions: configure connection to db with multiple schemas
>  # Select one schema in DB Schema window, Import
> -> successfully imported
>  # Remove schema from db import configuration window
>  # Run Import, click Revert in Result pop up window
>  # Add same schema to db import config window, run Import once more
> -> 'not changes to import' window appears.
>   4. Click OK
> -> all previously imported entities are removed in datamap



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (CAY-2536) No Catalog/Schema selection in Generate Database Schema

2019-02-11 Thread Nikita Timofeev (JIRA)


 [ 
https://issues.apache.org/jira/browse/CAY-2536?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Nikita Timofeev updated CAY-2536:
-
Priority: Minor  (was: Major)

> No Catalog/Schema selection in Generate Database Schema
> ---
>
> Key: CAY-2536
> URL: https://issues.apache.org/jira/browse/CAY-2536
> Project: Cayenne
>  Issue Type: Bug
>  Components: Modeler
>Affects Versions: 4.1.M3
>Reporter: ana benko
>Assignee: Nikita Timofeev
>Priority: Minor
>
> There's no catalog/schema selection in Generate Database Schema after 
> selecting db connection without catalog/schema in url
> -> no db is generated
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Assigned] (CAY-2536) No Catalog/Schema selection in Generate Database Schema

2019-02-11 Thread Nikita Timofeev (JIRA)


 [ 
https://issues.apache.org/jira/browse/CAY-2536?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Nikita Timofeev reassigned CAY-2536:


Assignee: Nikita Timofeev

> No Catalog/Schema selection in Generate Database Schema
> ---
>
> Key: CAY-2536
> URL: https://issues.apache.org/jira/browse/CAY-2536
> Project: Cayenne
>  Issue Type: Bug
>  Components: Modeler
>Affects Versions: 4.1.M3
>Reporter: ana benko
>Assignee: Nikita Timofeev
>Priority: Major
>
> There's no catalog/schema selection in Generate Database Schema after 
> selecting db connection without catalog/schema in url
> -> no db is generated
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (CAY-2537) Generate DB Schema: Schema Generation Complete popup window is hidden

2019-02-11 Thread Nikita Timofeev (JIRA)


 [ 
https://issues.apache.org/jira/browse/CAY-2537?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Nikita Timofeev updated CAY-2537:
-
Fix Version/s: 4.1.M3

> Generate DB Schema: Schema Generation Complete popup window is hidden
> -
>
> Key: CAY-2537
> URL: https://issues.apache.org/jira/browse/CAY-2537
> Project: Cayenne
>  Issue Type: Bug
>Affects Versions: 4.1.M3
>Reporter: ana benko
>Priority: Minor
> Fix For: 4.1.M3
>
>
> Run Generate DB Schema
> Select Options, click Generate
> Connect to DB
> -> 'Generate DB Schema: Options' pop up window is displayed grayed
> -> user needs to click anywhere in the app to bring up Schema Generation 
> Complete window to see generation result messages



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Assigned] (CAY-2537) Generate DB Schema: Schema Generation Complete popup window is hidden

2019-02-11 Thread Nikita Timofeev (JIRA)


 [ 
https://issues.apache.org/jira/browse/CAY-2537?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Nikita Timofeev reassigned CAY-2537:


Assignee: Arseni Bulatski

> Generate DB Schema: Schema Generation Complete popup window is hidden
> -
>
> Key: CAY-2537
> URL: https://issues.apache.org/jira/browse/CAY-2537
> Project: Cayenne
>  Issue Type: Bug
>Affects Versions: 4.1.M3
>Reporter: ana benko
>Assignee: Arseni Bulatski
>Priority: Minor
> Fix For: 4.1.M3
>
>
> Run Generate DB Schema
> Select Options, click Generate
> Connect to DB
> -> 'Generate DB Schema: Options' pop up window is displayed grayed
> -> user needs to click anywhere in the app to bring up Schema Generation 
> Complete window to see generation result messages



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Created] (CAY-2537) Generate DB Schema: Schema Generation Complete popup window is hidden

2019-02-11 Thread ana benko (JIRA)
ana benko created CAY-2537:
--

 Summary: Generate DB Schema: Schema Generation Complete popup 
window is hidden
 Key: CAY-2537
 URL: https://issues.apache.org/jira/browse/CAY-2537
 Project: Cayenne
  Issue Type: Bug
Affects Versions: 4.1.M3
Reporter: ana benko


Run Generate DB Schema

Select Options, click Generate

Connect to DB

-> 'Generate DB Schema: Options' pop up window is displayed grayed

-> user needs to click anywhere in the app to bring up Schema Generation 
Complete window to see generation result messages



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (CAY-2536) No Catalog/Schema selection in Generate Database Schema

2019-02-11 Thread ana benko (JIRA)


 [ 
https://issues.apache.org/jira/browse/CAY-2536?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

ana benko updated CAY-2536:
---
Description: 
There's no catalog/schema selection in Generate Database Schema after selecting 
db connection without catalog/schema in url

-> no db is generated

 

  was:
There's no catalog/schema selection in Generate Database Schema after selecting 
db connection without catalog/schema in url

 


> No Catalog/Schema selection in Generate Database Schema
> ---
>
> Key: CAY-2536
> URL: https://issues.apache.org/jira/browse/CAY-2536
> Project: Cayenne
>  Issue Type: Bug
>  Components: Modeler
>Affects Versions: 4.1.M3
>Reporter: ana benko
>Priority: Major
>
> There's no catalog/schema selection in Generate Database Schema after 
> selecting db connection without catalog/schema in url
> -> no db is generated
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Created] (CAY-2536) No Catalog/Schema selection in Generate Database Schema

2019-02-11 Thread ana benko (JIRA)
ana benko created CAY-2536:
--

 Summary: No Catalog/Schema selection in Generate Database Schema
 Key: CAY-2536
 URL: https://issues.apache.org/jira/browse/CAY-2536
 Project: Cayenne
  Issue Type: Bug
  Components: Modeler
Affects Versions: 4.1.M3
Reporter: ana benko


There's no catalog/schema selection in Generate Database Schema after selecting 
db connection without catalog/schema in url

 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (CAY-2530) DB Import and Class Generation from Project is performed for removed datamaps

2019-02-11 Thread Arseni Bulatski (JIRA)


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

Arseni Bulatski commented on CAY-2530:
--

https://github.com/apache/cayenne/commit/aecf503b83ea54bff84d17815eee6ae7d7cb6a61

> DB Import and Class Generation from Project is performed for removed datamaps
> -
>
> Key: CAY-2530
> URL: https://issues.apache.org/jira/browse/CAY-2530
> Project: Cayenne
>  Issue Type: Bug
>  Components: Modeler
>Affects Versions: 4.1.M3
>Reporter: ana benko
>Assignee: Arseni Bulatski
>Priority: Major
> Fix For: 4.1.M3
>
>
> # Add 2 datamaps
>  # Configure db import for both and run import
>  # Generate classes in both datamaps
>  # Remove one datamap, save
>  # Click on Project and make sure DB Import and Class Generation tab have 
> only one datamap and it is selected -> OK
>  # Run DB Import and Generate Classes from Project 'level'
> -> db import and class generation is performed for both, removed and selected 
> datamaps



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Closed] (CAY-2530) DB Import and Class Generation from Project is performed for removed datamaps

2019-02-11 Thread Arseni Bulatski (JIRA)


 [ 
https://issues.apache.org/jira/browse/CAY-2530?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Arseni Bulatski closed CAY-2530.

Resolution: Fixed

> DB Import and Class Generation from Project is performed for removed datamaps
> -
>
> Key: CAY-2530
> URL: https://issues.apache.org/jira/browse/CAY-2530
> Project: Cayenne
>  Issue Type: Bug
>  Components: Modeler
>Affects Versions: 4.1.M3
>Reporter: ana benko
>Assignee: Arseni Bulatski
>Priority: Major
> Fix For: 4.1.M3
>
>
> # Add 2 datamaps
>  # Configure db import for both and run import
>  # Generate classes in both datamaps
>  # Remove one datamap, save
>  # Click on Project and make sure DB Import and Class Generation tab have 
> only one datamap and it is selected -> OK
>  # Run DB Import and Generate Classes from Project 'level'
> -> db import and class generation is performed for both, removed and selected 
> datamaps



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[cayenne] branch STABLE-4.1 updated: CAY-2530 DB Import and Class Generation from Project is performed for removed datamaps

2019-02-11 Thread abulatski
This is an automated email from the ASF dual-hosted git repository.

abulatski pushed a commit to branch STABLE-4.1
in repository https://gitbox.apache.org/repos/asf/cayenne.git


The following commit(s) were added to refs/heads/STABLE-4.1 by this push:
 new aecf503  CAY-2530 DB Import and Class Generation from Project is 
performed for removed datamaps
aecf503 is described below

commit aecf503b83ea54bff84d17815eee6ae7d7cb6a61
Author: Arseni Bulatski 
AuthorDate: Mon Feb 11 15:54:28 2019 +0300

CAY-2530 DB Import and Class Generation from Project is performed for 
removed datamaps
---
 RELEASE-NOTES.txt  |  1 +
 .../modeler/editor/GeneratorsTabController.java| 22 ++
 .../editor/cgen/domain/CgenTabController.java  | 19 +--
 .../dbimport/domain/DbImportTabController.java |  7 +++
 4 files changed, 27 insertions(+), 22 deletions(-)

diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt
index 4988f26..b1ae7b0 100644
--- a/RELEASE-NOTES.txt
+++ b/RELEASE-NOTES.txt
@@ -57,6 +57,7 @@ CAY-2501 Modeler: DbImport ui not loading columns for MySQL 
connector v8.0
 CAY-2502 DataMap in DataNode tree view disappears after dbImport
 CAY-2504 Broken detection logic of NoopEventBridge in DataRowStoreFactory
 CAY-2505 EventBridge providers should be bound without scope
+CAY-2530 DB Import and Class Generation from Project is performed for removed 
datamaps
 CAY-2533 Modeler: Exception on validating ObjRelationship without db path
 
 --
diff --git 
a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/GeneratorsTabController.java
 
b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/GeneratorsTabController.java
index a257643..8219d2c 100644
--- 
a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/GeneratorsTabController.java
+++ 
b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/GeneratorsTabController.java
@@ -18,6 +18,13 @@
  /
 package org.apache.cayenne.modeler.editor;
 
+import java.awt.event.ItemEvent;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+
 import org.apache.cayenne.configuration.DataChannelDescriptor;
 import org.apache.cayenne.map.DataMap;
 import org.apache.cayenne.modeler.ProjectController;
@@ -26,13 +33,6 @@ import org.apache.cayenne.project.Project;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.awt.event.ItemEvent;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
 /**
  * @since 4.1
  */
@@ -46,10 +46,11 @@ public abstract class GeneratorsTabController {
 public ConcurrentMap generatorsPanels;
 public Set selectedDataMaps;
 
-public GeneratorsTabController(Class type) {
+public GeneratorsTabController(Class type, ProjectController 
projectController) {
 this.type = type;
 this.generatorsPanels = new ConcurrentHashMap<>();
 this.selectedDataMaps = new HashSet<>();
+this.projectController = projectController;
 }
 
 public String icon;
@@ -58,6 +59,7 @@ public abstract class GeneratorsTabController {
 
 public void createPanels(){
 Collection dataMaps = getDataMaps();
+refreshSelectedMaps(dataMaps);
 generatorsPanels.clear();
 for(DataMap dataMap : dataMaps) {
 GeneratorsPanel generatorPanel = new GeneratorsPanel(dataMap, 
"icon-datamap.png", type);
@@ -132,4 +134,8 @@ public abstract class GeneratorsTabController {
 Set getSelectedDataMaps() {
 return selectedDataMaps;
 }
+
+private void refreshSelectedMaps(Collection dataMaps) {
+selectedDataMaps.removeIf(dataMap -> !dataMaps.contains(dataMap));
+}
 }
diff --git 
a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/cgen/domain/CgenTabController.java
 
b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/cgen/domain/CgenTabController.java
index ff68804..8abb583 100644
--- 
a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/cgen/domain/CgenTabController.java
+++ 
b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/cgen/domain/CgenTabController.java
@@ -19,6 +19,14 @@
 
 package org.apache.cayenne.modeler.editor.cgen.domain;
 
+import javax.swing.JOptionPane;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.Set;
+import java.util.prefs.Preferences;
+
 import org.apache.cayenne.configuration.xml.DataChannelMetaData;
 import org.apache.cayenne.gen.CgenConfiguration;
 import 

[jira] [Closed] (CAY-2534) Join table is mapped when meaningful PK is set

2019-02-11 Thread Nikita Timofeev (JIRA)


 [ 
https://issues.apache.org/jira/browse/CAY-2534?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Nikita Timofeev closed CAY-2534.

Resolution: Not A Bug

Meaningful PK option is just a one big regexp, so it's not really convenient to 
use.
 Tested with schema that has tables {{a}}, {{b}} and {{ab}}.
 With pattern like {{^a$|^b$}} only entities for required tables {{a}} and 
{{b}} are created and not for the many-to-many join table {{ab}}.

> Join table is mapped when meaningful PK is set
> --
>
> Key: CAY-2534
> URL: https://issues.apache.org/jira/browse/CAY-2534
> Project: Cayenne
>  Issue Type: Bug
>  Components: Modeler
>Affects Versions: 4.1.M3
>Reporter: ana benko
>Assignee: Nikita Timofeev
>Priority: Major
> Fix For: 4.1.M3
>
>
> # Select db schema with tables joined by many-to-many relationship
>  # In Tables with meaningful PK pattern provide one of the table names joined 
> by many-to-many relationship (not the join table)
>  # Run Import
> -> Join table is mapped -> NOT OK



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Closed] (CAY-2533) Modeler: Exception on validating ObjRelationship without db path

2019-02-11 Thread Nikita Timofeev (JIRA)


 [ 
https://issues.apache.org/jira/browse/CAY-2533?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Nikita Timofeev closed CAY-2533.

Resolution: Fixed

https://github.com/apache/cayenne/commit/4d2f8c0450115baeee0fef208e61ca057dfc1696

> Modeler: Exception on validating ObjRelationship without db path
> 
>
> Key: CAY-2533
> URL: https://issues.apache.org/jira/browse/CAY-2533
> Project: Cayenne
>  Issue Type: Bug
>  Components: Modeler
>Affects Versions: 4.1.M3
>Reporter: ana benko
>Assignee: Nikita Timofeev
>Priority: Major
> Fix For: 4.1.M3
>
>
> note: Exception never reproduces with ObjEntities on freshly imported db.   
> It appears after some time, but with same scenario
>  # Datamap java package is configured, db is imported. Saved
>  # Update any ObjEntity name field, click Cancel on Update popup window
>  # Hit Save
> -> Feb 8, 2019 4:17:18 PM ERROR: CayenneModeler Error
> java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
>     at java.util.ArrayList.rangeCheck(ArrayList.java:657)
>     at java.util.ArrayList.get(ArrayList.java:433)
>     at java.util.Collections$UnmodifiableList.get(Collections.java:1309)
>     at org.apache.cayenne.map.ObjRelationship.isToPK(ObjRelationship.java:396)
>     at 
> org.apache.cayenne.project.validation.ObjRelationshipValidator.validate(ObjRelationshipValidator.java:129)
>     at 
> org.apache.cayenne.project.validation.DefaultProjectValidator$ValidationVisitor.visitObjRelationship(DefaultProjectValidator.java:197)
>     at 
> org.apache.cayenne.project.validation.DefaultProjectValidator$ValidationVisitor.visitObjEntity(DefaultProjectValidator.java:191)
>     at 
> org.apache.cayenne.project.validation.DefaultProjectValidator$ValidationVisitor.visitDataMap(DefaultProjectValidator.java:119)
>     at 
> org.apache.cayenne.project.validation.DefaultProjectValidator$ValidationVisitor.visitDataChannelDescriptor(DefaultProjectValidator.java:106)
>     at 
> org.apache.cayenne.project.validation.DefaultProjectValidator$ValidationVisitor.visitDataChannelDescriptor(DefaultProjectValidator.java:90)
>     at 
> org.apache.cayenne.configuration.DataChannelDescriptor.acceptVisitor(DataChannelDescriptor.java:100)
>     at 
> org.apache.cayenne.project.validation.DefaultProjectValidator.validate(DefaultProjectValidator.java:87)
>     at 
> org.apache.cayenne.modeler.action.SaveAsAction.performAction(SaveAsAction.java:160)
>     at 
> org.apache.cayenne.modeler.action.SaveAsAction.performAction(SaveAsAction.java:154)
>     at 
> org.apache.cayenne.modeler.util.CayenneAction.actionPerformed(CayenneAction.java:171)
>     at 
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
>     at 
> javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
>     at 
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
>     at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
>     at 
> javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
>     at 
> java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)
>     at java.awt.Component.processMouseEvent(Component.java:6533)
>     at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
>     at java.awt.Component.processEvent(Component.java:6298)
>     at java.awt.Container.processEvent(Container.java:2238)
>     at java.awt.Component.dispatchEventImpl(Component.java:4889)
>     at java.awt.Container.dispatchEventImpl(Container.java:2296)
>     at java.awt.Component.dispatchEvent(Component.java:4711)
>     at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4897)
>     at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4534)
>     at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4475)
>     at java.awt.Container.dispatchEventImpl(Container.java:2282)
>     at java.awt.Window.dispatchEventImpl(Window.java:2746)
>     at java.awt.Component.dispatchEvent(Component.java:4711)
>     at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:760)
>     at java.awt.EventQueue.access$500(EventQueue.java:97)
>     at java.awt.EventQueue$3.run(EventQueue.java:709)
>     at java.awt.EventQueue$3.run(EventQueue.java:703)
>     at java.security.AccessController.doPrivileged(Native Method)
>     at 
> java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
>     at 
> java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
>     at java.awt.EventQueue$4.run(EventQueue.java:733)
>     at java.awt.EventQueue$4.run(EventQueue.java:731)
>     at java.security.AccessController.doPrivileged(Native Method)
>     at 
> 

[jira] [Updated] (CAY-2533) Modeler: Exception on validating ObjRelationship without db path

2019-02-11 Thread Nikita Timofeev (JIRA)


 [ 
https://issues.apache.org/jira/browse/CAY-2533?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Nikita Timofeev updated CAY-2533:
-
Summary: Modeler: Exception on validating ObjRelationship without db path  
(was: Exception appers on attempt to save edited ObjEntity name without class 
name udpate)

> Modeler: Exception on validating ObjRelationship without db path
> 
>
> Key: CAY-2533
> URL: https://issues.apache.org/jira/browse/CAY-2533
> Project: Cayenne
>  Issue Type: Bug
>  Components: Modeler
>Affects Versions: 4.1.M3
>Reporter: ana benko
>Assignee: Nikita Timofeev
>Priority: Major
> Fix For: 4.1.M3
>
>
> note: Exception never reproduces with ObjEntities on freshly imported db.   
> It appears after some time, but with same scenario
>  # Datamap java package is configured, db is imported. Saved
>  # Update any ObjEntity name field, click Cancel on Update popup window
>  # Hit Save
> -> Feb 8, 2019 4:17:18 PM ERROR: CayenneModeler Error
> java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
>     at java.util.ArrayList.rangeCheck(ArrayList.java:657)
>     at java.util.ArrayList.get(ArrayList.java:433)
>     at java.util.Collections$UnmodifiableList.get(Collections.java:1309)
>     at org.apache.cayenne.map.ObjRelationship.isToPK(ObjRelationship.java:396)
>     at 
> org.apache.cayenne.project.validation.ObjRelationshipValidator.validate(ObjRelationshipValidator.java:129)
>     at 
> org.apache.cayenne.project.validation.DefaultProjectValidator$ValidationVisitor.visitObjRelationship(DefaultProjectValidator.java:197)
>     at 
> org.apache.cayenne.project.validation.DefaultProjectValidator$ValidationVisitor.visitObjEntity(DefaultProjectValidator.java:191)
>     at 
> org.apache.cayenne.project.validation.DefaultProjectValidator$ValidationVisitor.visitDataMap(DefaultProjectValidator.java:119)
>     at 
> org.apache.cayenne.project.validation.DefaultProjectValidator$ValidationVisitor.visitDataChannelDescriptor(DefaultProjectValidator.java:106)
>     at 
> org.apache.cayenne.project.validation.DefaultProjectValidator$ValidationVisitor.visitDataChannelDescriptor(DefaultProjectValidator.java:90)
>     at 
> org.apache.cayenne.configuration.DataChannelDescriptor.acceptVisitor(DataChannelDescriptor.java:100)
>     at 
> org.apache.cayenne.project.validation.DefaultProjectValidator.validate(DefaultProjectValidator.java:87)
>     at 
> org.apache.cayenne.modeler.action.SaveAsAction.performAction(SaveAsAction.java:160)
>     at 
> org.apache.cayenne.modeler.action.SaveAsAction.performAction(SaveAsAction.java:154)
>     at 
> org.apache.cayenne.modeler.util.CayenneAction.actionPerformed(CayenneAction.java:171)
>     at 
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
>     at 
> javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
>     at 
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
>     at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
>     at 
> javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
>     at 
> java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)
>     at java.awt.Component.processMouseEvent(Component.java:6533)
>     at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
>     at java.awt.Component.processEvent(Component.java:6298)
>     at java.awt.Container.processEvent(Container.java:2238)
>     at java.awt.Component.dispatchEventImpl(Component.java:4889)
>     at java.awt.Container.dispatchEventImpl(Container.java:2296)
>     at java.awt.Component.dispatchEvent(Component.java:4711)
>     at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4897)
>     at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4534)
>     at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4475)
>     at java.awt.Container.dispatchEventImpl(Container.java:2282)
>     at java.awt.Window.dispatchEventImpl(Window.java:2746)
>     at java.awt.Component.dispatchEvent(Component.java:4711)
>     at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:760)
>     at java.awt.EventQueue.access$500(EventQueue.java:97)
>     at java.awt.EventQueue$3.run(EventQueue.java:709)
>     at java.awt.EventQueue$3.run(EventQueue.java:703)
>     at java.security.AccessController.doPrivileged(Native Method)
>     at 
> java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
>     at 
> java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
>     at java.awt.EventQueue$4.run(EventQueue.java:733)
>     at java.awt.EventQueue$4.run(EventQueue.java:731)
>     at 

[cayenne] branch STABLE-4.1 updated: CAY-2533 Modeler: Exception on validating ObjRelationship without db path

2019-02-11 Thread ntimofeev
This is an automated email from the ASF dual-hosted git repository.

ntimofeev pushed a commit to branch STABLE-4.1
in repository https://gitbox.apache.org/repos/asf/cayenne.git


The following commit(s) were added to refs/heads/STABLE-4.1 by this push:
 new 4d2f8c0  CAY-2533 Modeler: Exception on validating ObjRelationship 
without db path
4d2f8c0 is described below

commit 4d2f8c0450115baeee0fef208e61ca057dfc1696
Author: Nikita Timofeev 
AuthorDate: Mon Feb 11 15:01:49 2019 +0300

CAY-2533 Modeler: Exception on validating ObjRelationship without db path
---
 RELEASE-NOTES.txt   | 1 +
 .../apache/cayenne/project/validation/ObjRelationshipValidator.java | 6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt
index 115feb7..4988f26 100644
--- a/RELEASE-NOTES.txt
+++ b/RELEASE-NOTES.txt
@@ -57,6 +57,7 @@ CAY-2501 Modeler: DbImport ui not loading columns for MySQL 
connector v8.0
 CAY-2502 DataMap in DataNode tree view disappears after dbImport
 CAY-2504 Broken detection logic of NoopEventBridge in DataRowStoreFactory
 CAY-2505 EventBridge providers should be bound without scope
+CAY-2533 Modeler: Exception on validating ObjRelationship without db path
 
 --
 Release: 4.1.M2
diff --git 
a/cayenne-project/src/main/java/org/apache/cayenne/project/validation/ObjRelationshipValidator.java
 
b/cayenne-project/src/main/java/org/apache/cayenne/project/validation/ObjRelationshipValidator.java
index b898b4a..a3b7f31 100644
--- 
a/cayenne-project/src/main/java/org/apache/cayenne/project/validation/ObjRelationshipValidator.java
+++ 
b/cayenne-project/src/main/java/org/apache/cayenne/project/validation/ObjRelationshipValidator.java
@@ -126,13 +126,13 @@ class ObjRelationshipValidator extends 
ConfigurationNodeValidator {
 }
 }
 
-if(!relationship.isToPK()) {
+if(!relationship.getDbRelationships().isEmpty() && 
!relationship.isToPK()) {
 ObjRelationship reverseRelationship = 
relationship.getReverseRelationship();
-if(reverseRelationship != null && !reverseRelationship.isToPK()) {
+if(reverseRelationship != null && 
!relationship.getDbRelationships().isEmpty() && !reverseRelationship.isToPK()) {
 addFailure(
 validationResult,
 relationship,
-"ObjRelationship '%s' has join not to PK. Cayenne 
doesn't allow this type of relationship",
+"ObjRelationship '%s' has join not to PK. This is not 
fully supported by Cayenne.",
 toString(relationship));
 }
 }



[jira] [Updated] (CAY-2521) Expression without Object ID disjoint issue

2019-02-11 Thread ASF GitHub Bot (JIRA)


 [ 
https://issues.apache.org/jira/browse/CAY-2521?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

ASF GitHub Bot updated CAY-2521:

Labels: pull-request-available  (was: )

> Expression without Object ID disjoint issue
> ---
>
> Key: CAY-2521
> URL: https://issues.apache.org/jira/browse/CAY-2521
> Project: Cayenne
>  Issue Type: Bug
>Affects Versions: 4.0, 4.0.1, 4.1.M3
>Reporter: Vital Zanko
>Assignee: Arseni Bulatski
>Priority: Major
>  Labels: pull-request-available
> Fix For: 4.0.2, 4.1.M3
>
> Attachments: disjoint issue.png
>
>
> As an example, there are three tables: issue, team, location. There are some 
> relationships among them:
>  * issue.home_team_id = team.id
>  * issue.location_id = location.id
>  * location.team_id = team.id
>  * team.home_location_id = location.id
> !disjoint issue.png!
> {code:java}
> Team team = Cayenne.objectForPK(localContext, Team.class, 1);
>   
> SelectQuery select = new SelectQuery<>(Issue.class, 
> ExpressionFactory.exp("homeTeam = 1"));
> select.addPrefetch(Issue.HOME_TEAM.disjoint());
> select.addPrefetch(Issue.LOCATION.disjoint());
> select.addPrefetch(Issue.HOME_TEAM.dot(Team.HOME_LOCATION).disjoint());
> List issues = localContext.select(select);
> {code}
> This causes following sql query for prefetched team's home location objects 
> which doesn't correlate with the expression (it shouldn't be applied on): 
> {code:java}
> [05/Feb/2019:09:36:37,102] bootique-http-41 u=user1 INFO  
> o.a.c.l.JdbcEventLogger: SELECT t0.name, t0.id, t0.team_id FROM mydb.location 
> t0 WHERE t0.id = ? [bind: 1->id:1]
> [05/Feb/2019:09:36:37,104] bootique-http-41 u=user1 INFO  
> o.a.c.l.JdbcEventLogger: === returned 0 rows. - took 3 ms.
> {code}
>  
> The issue will be resolved when Object Id is being used as a parameter in the 
> expression:
> {code:java}
> SelectQuery select = new SelectQuery<>(Issue.class, 
> ExpressionFactory.exp("homeTeam = $id" , (Object) team.getObjectId()));
> // some custom code
> select.addPrefetch(Issue.HOME_TEAM.dot(Team.HOME_LOCATION).disjoint());
> List issues = localContext.select(select);{code}
> {code:java}
> [05/Feb/2019:09:56:25,087] bootique-http-34 u=user1 INFO  
> o.a.c.l.JdbcEventLogger: SELECT t0.name, t0.id, t0.team_id FROM mydb.location 
> t0 JOIN mydb.team t1 ON (t0.id = t1.home_location_id) WHERE t1.id = ? [bind: 
> 1->id:1]
> [05/Feb/2019:09:56:25,100] bootique-http-34 u=user1 INFO  
> o.a.c.l.JdbcEventLogger: === returned 1 row. - took 13 ms.{code}
>  
> Or the issue will be also resolved in case of expression without object id 
> when java code declares _disjoint by id_
> {code:java}
> SelectQuery select = new SelectQuery<>(Issue.class, 
> ExpressionFactory.exp("homeTeam = 1"));
> // some custom code
> select.addPrefetch(Issue.HOME_TEAM.dot(Team.HOME_LOCATION).disjointById());
> List issues = localContext.select(select);
> {code}
> {code:java}
> [05/Feb/2019:09:59:23,605] bootique-http-36 u=user1 INFO  
> o.a.c.l.JdbcEventLogger: --- transaction started.
> [05/Feb/2019:09:59:23,606] bootique-http-36 u=user1 INFO  
> o.a.c.l.JdbcEventLogger: SELECT t0.name, t0.id, t0.team_id FROM mydb.location 
> t0 WHERE t0.id = ? [bind: 1->id:71]
> [05/Feb/2019:09:59:23,609] bootique-http-36 u=user1 INFO  
> o.a.c.l.JdbcEventLogger: === returned 1 row. - took 4 ms.
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[GitHub] aarrsseni opened a new pull request #366: CAY-2521 Expression without Object ID disjoint issue

2019-02-11 Thread GitBox
aarrsseni opened a new pull request #366: CAY-2521 Expression without Object ID 
disjoint issue
URL: https://github.com/apache/cayenne/pull/366
 
 
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[jira] [Assigned] (CAY-2534) Join table is mapped when meaningful PK is set

2019-02-11 Thread Nikita Timofeev (JIRA)


 [ 
https://issues.apache.org/jira/browse/CAY-2534?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Nikita Timofeev reassigned CAY-2534:


Assignee: Nikita Timofeev

> Join table is mapped when meaningful PK is set
> --
>
> Key: CAY-2534
> URL: https://issues.apache.org/jira/browse/CAY-2534
> Project: Cayenne
>  Issue Type: Bug
>  Components: Modeler
>Affects Versions: 4.1.M3
>Reporter: ana benko
>Assignee: Nikita Timofeev
>Priority: Major
> Fix For: 4.1.M3
>
>
> # Select db schema with tables joined by many-to-many relationship
>  # In Tables with meaningful PK pattern provide one of the table names joined 
> by many-to-many relationship (not the join table)
>  # Run Import
> -> Join table is mapped -> NOT OK



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Assigned] (CAY-2533) Exception appers on attempt to save edited ObjEntity name without class name udpate

2019-02-11 Thread Nikita Timofeev (JIRA)


 [ 
https://issues.apache.org/jira/browse/CAY-2533?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Nikita Timofeev reassigned CAY-2533:


Assignee: Nikita Timofeev

> Exception appers on attempt to save edited ObjEntity name without class name 
> udpate
> ---
>
> Key: CAY-2533
> URL: https://issues.apache.org/jira/browse/CAY-2533
> Project: Cayenne
>  Issue Type: Bug
>  Components: Modeler
>Affects Versions: 4.1.M3
>Reporter: ana benko
>Assignee: Nikita Timofeev
>Priority: Major
> Fix For: 4.1.M3
>
>
> note: Exception never reproduces with ObjEntities on freshly imported db.   
> It appears after some time, but with same scenario
>  # Datamap java package is configured, db is imported. Saved
>  # Update any ObjEntity name field, click Cancel on Update popup window
>  # Hit Save
> -> Feb 8, 2019 4:17:18 PM ERROR: CayenneModeler Error
> java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
>     at java.util.ArrayList.rangeCheck(ArrayList.java:657)
>     at java.util.ArrayList.get(ArrayList.java:433)
>     at java.util.Collections$UnmodifiableList.get(Collections.java:1309)
>     at org.apache.cayenne.map.ObjRelationship.isToPK(ObjRelationship.java:396)
>     at 
> org.apache.cayenne.project.validation.ObjRelationshipValidator.validate(ObjRelationshipValidator.java:129)
>     at 
> org.apache.cayenne.project.validation.DefaultProjectValidator$ValidationVisitor.visitObjRelationship(DefaultProjectValidator.java:197)
>     at 
> org.apache.cayenne.project.validation.DefaultProjectValidator$ValidationVisitor.visitObjEntity(DefaultProjectValidator.java:191)
>     at 
> org.apache.cayenne.project.validation.DefaultProjectValidator$ValidationVisitor.visitDataMap(DefaultProjectValidator.java:119)
>     at 
> org.apache.cayenne.project.validation.DefaultProjectValidator$ValidationVisitor.visitDataChannelDescriptor(DefaultProjectValidator.java:106)
>     at 
> org.apache.cayenne.project.validation.DefaultProjectValidator$ValidationVisitor.visitDataChannelDescriptor(DefaultProjectValidator.java:90)
>     at 
> org.apache.cayenne.configuration.DataChannelDescriptor.acceptVisitor(DataChannelDescriptor.java:100)
>     at 
> org.apache.cayenne.project.validation.DefaultProjectValidator.validate(DefaultProjectValidator.java:87)
>     at 
> org.apache.cayenne.modeler.action.SaveAsAction.performAction(SaveAsAction.java:160)
>     at 
> org.apache.cayenne.modeler.action.SaveAsAction.performAction(SaveAsAction.java:154)
>     at 
> org.apache.cayenne.modeler.util.CayenneAction.actionPerformed(CayenneAction.java:171)
>     at 
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
>     at 
> javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
>     at 
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
>     at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
>     at 
> javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
>     at 
> java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)
>     at java.awt.Component.processMouseEvent(Component.java:6533)
>     at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
>     at java.awt.Component.processEvent(Component.java:6298)
>     at java.awt.Container.processEvent(Container.java:2238)
>     at java.awt.Component.dispatchEventImpl(Component.java:4889)
>     at java.awt.Container.dispatchEventImpl(Container.java:2296)
>     at java.awt.Component.dispatchEvent(Component.java:4711)
>     at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4897)
>     at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4534)
>     at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4475)
>     at java.awt.Container.dispatchEventImpl(Container.java:2282)
>     at java.awt.Window.dispatchEventImpl(Window.java:2746)
>     at java.awt.Component.dispatchEvent(Component.java:4711)
>     at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:760)
>     at java.awt.EventQueue.access$500(EventQueue.java:97)
>     at java.awt.EventQueue$3.run(EventQueue.java:709)
>     at java.awt.EventQueue$3.run(EventQueue.java:703)
>     at java.security.AccessController.doPrivileged(Native Method)
>     at 
> java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
>     at 
> java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
>     at java.awt.EventQueue$4.run(EventQueue.java:733)
>     at java.awt.EventQueue$4.run(EventQueue.java:731)
>     at java.security.AccessController.doPrivileged(Native Method)
>     at 
> 

[jira] [Assigned] (CAY-2530) DB Import and Class Generation from Project is performed for removed datamaps

2019-02-11 Thread Nikita Timofeev (JIRA)


 [ 
https://issues.apache.org/jira/browse/CAY-2530?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Nikita Timofeev reassigned CAY-2530:


Assignee: Arseni Bulatski

> DB Import and Class Generation from Project is performed for removed datamaps
> -
>
> Key: CAY-2530
> URL: https://issues.apache.org/jira/browse/CAY-2530
> Project: Cayenne
>  Issue Type: Bug
>  Components: Modeler
>Affects Versions: 4.1.M3
>Reporter: ana benko
>Assignee: Arseni Bulatski
>Priority: Major
> Fix For: 4.1.M3
>
>
> # Add 2 datamaps
>  # Configure db import for both and run import
>  # Generate classes in both datamaps
>  # Remove one datamap, save
>  # Click on Project and make sure DB Import and Class Generation tab have 
> only one datamap and it is selected -> OK
>  # Run DB Import and Generate Classes from Project 'level'
> -> db import and class generation is performed for both, removed and selected 
> datamaps



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (CAY-2533) Exception appers on attempt to save edited ObjEntity name without class name udpate

2019-02-11 Thread Nikita Timofeev (JIRA)


 [ 
https://issues.apache.org/jira/browse/CAY-2533?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Nikita Timofeev updated CAY-2533:
-
Fix Version/s: 4.1.M3

> Exception appers on attempt to save edited ObjEntity name without class name 
> udpate
> ---
>
> Key: CAY-2533
> URL: https://issues.apache.org/jira/browse/CAY-2533
> Project: Cayenne
>  Issue Type: Bug
>  Components: Modeler
>Affects Versions: 4.1.M3
>Reporter: ana benko
>Priority: Major
> Fix For: 4.1.M3
>
>
> note: Exception never reproduces with ObjEntities on freshly imported db.   
> It appears after some time, but with same scenario
>  # Datamap java package is configured, db is imported. Saved
>  # Update any ObjEntity name field, click Cancel on Update popup window
>  # Hit Save
> -> Feb 8, 2019 4:17:18 PM ERROR: CayenneModeler Error
> java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
>     at java.util.ArrayList.rangeCheck(ArrayList.java:657)
>     at java.util.ArrayList.get(ArrayList.java:433)
>     at java.util.Collections$UnmodifiableList.get(Collections.java:1309)
>     at org.apache.cayenne.map.ObjRelationship.isToPK(ObjRelationship.java:396)
>     at 
> org.apache.cayenne.project.validation.ObjRelationshipValidator.validate(ObjRelationshipValidator.java:129)
>     at 
> org.apache.cayenne.project.validation.DefaultProjectValidator$ValidationVisitor.visitObjRelationship(DefaultProjectValidator.java:197)
>     at 
> org.apache.cayenne.project.validation.DefaultProjectValidator$ValidationVisitor.visitObjEntity(DefaultProjectValidator.java:191)
>     at 
> org.apache.cayenne.project.validation.DefaultProjectValidator$ValidationVisitor.visitDataMap(DefaultProjectValidator.java:119)
>     at 
> org.apache.cayenne.project.validation.DefaultProjectValidator$ValidationVisitor.visitDataChannelDescriptor(DefaultProjectValidator.java:106)
>     at 
> org.apache.cayenne.project.validation.DefaultProjectValidator$ValidationVisitor.visitDataChannelDescriptor(DefaultProjectValidator.java:90)
>     at 
> org.apache.cayenne.configuration.DataChannelDescriptor.acceptVisitor(DataChannelDescriptor.java:100)
>     at 
> org.apache.cayenne.project.validation.DefaultProjectValidator.validate(DefaultProjectValidator.java:87)
>     at 
> org.apache.cayenne.modeler.action.SaveAsAction.performAction(SaveAsAction.java:160)
>     at 
> org.apache.cayenne.modeler.action.SaveAsAction.performAction(SaveAsAction.java:154)
>     at 
> org.apache.cayenne.modeler.util.CayenneAction.actionPerformed(CayenneAction.java:171)
>     at 
> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
>     at 
> javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
>     at 
> javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
>     at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
>     at 
> javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
>     at 
> java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)
>     at java.awt.Component.processMouseEvent(Component.java:6533)
>     at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
>     at java.awt.Component.processEvent(Component.java:6298)
>     at java.awt.Container.processEvent(Container.java:2238)
>     at java.awt.Component.dispatchEventImpl(Component.java:4889)
>     at java.awt.Container.dispatchEventImpl(Container.java:2296)
>     at java.awt.Component.dispatchEvent(Component.java:4711)
>     at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4897)
>     at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4534)
>     at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4475)
>     at java.awt.Container.dispatchEventImpl(Container.java:2282)
>     at java.awt.Window.dispatchEventImpl(Window.java:2746)
>     at java.awt.Component.dispatchEvent(Component.java:4711)
>     at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:760)
>     at java.awt.EventQueue.access$500(EventQueue.java:97)
>     at java.awt.EventQueue$3.run(EventQueue.java:709)
>     at java.awt.EventQueue$3.run(EventQueue.java:703)
>     at java.security.AccessController.doPrivileged(Native Method)
>     at 
> java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
>     at 
> java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
>     at java.awt.EventQueue$4.run(EventQueue.java:733)
>     at java.awt.EventQueue$4.run(EventQueue.java:731)
>     at java.security.AccessController.doPrivileged(Native Method)
>     at 
> 

[jira] [Updated] (CAY-2531) Importing same schema after Import Revert clears all entities in datamap

2019-02-11 Thread Nikita Timofeev (JIRA)


 [ 
https://issues.apache.org/jira/browse/CAY-2531?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Nikita Timofeev updated CAY-2531:
-
Fix Version/s: 4.1.M3

> Importing same schema after Import Revert clears all entities in datamap
> 
>
> Key: CAY-2531
> URL: https://issues.apache.org/jira/browse/CAY-2531
> Project: Cayenne
>  Issue Type: Bug
>  Components: Modeler
>Affects Versions: 4.1.M3
>Reporter: ana benko
>Priority: Minor
> Fix For: 4.1.M3
>
>
> Preconditions: configure connection to db with multiple schemas
>  # Select one schema in DB Schema window, Import
> -> successfully imported
>  # Remove schema from db import configuration window
>  # Run Import, click Revert in Result pop up window
>  # Add same schema to db import config window, run Import once more
> -> 'not changes to import' window appears.
>   4. Click OK
> -> all previously imported entities are removed in datamap



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (CAY-2534) Join table is mapped when meaningful PK is set

2019-02-11 Thread Nikita Timofeev (JIRA)


 [ 
https://issues.apache.org/jira/browse/CAY-2534?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Nikita Timofeev updated CAY-2534:
-
Fix Version/s: 4.1.M3

> Join table is mapped when meaningful PK is set
> --
>
> Key: CAY-2534
> URL: https://issues.apache.org/jira/browse/CAY-2534
> Project: Cayenne
>  Issue Type: Bug
>  Components: Modeler
>Affects Versions: 4.1.M3
>Reporter: ana benko
>Priority: Major
> Fix For: 4.1.M3
>
>
> # Select db schema with tables joined by many-to-many relationship
>  # In Tables with meaningful PK pattern provide one of the table names joined 
> by many-to-many relationship (not the join table)
>  # Run Import
> -> Join table is mapped -> NOT OK



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Assigned] (CAY-2535) Imposible to import stored proceedure apart from db tables

2019-02-11 Thread Nikita Timofeev (JIRA)


 [ 
https://issues.apache.org/jira/browse/CAY-2535?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Nikita Timofeev reassigned CAY-2535:


Assignee: Arseni Bulatski

> Imposible to import stored proceedure apart from db tables
> --
>
> Key: CAY-2535
> URL: https://issues.apache.org/jira/browse/CAY-2535
> Project: Cayenne
>  Issue Type: Bug
>  Components: Modeler
>Affects Versions: 4.1.M3
>Reporter: ana benko
>Assignee: Arseni Bulatski
>Priority: Minor
> Fix For: 4.1.M3
>
>
> # Import db schema
>  # Modify db, add stored procedure
>  # On DB Import tab, refresh db schema and include stored procedure to import 
> configuration
>  # Run Import
> -> Nothing to import. Stored procedure is not imported.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (CAY-2535) Imposible to import stored proceedure apart from db tables

2019-02-11 Thread Nikita Timofeev (JIRA)


 [ 
https://issues.apache.org/jira/browse/CAY-2535?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Nikita Timofeev updated CAY-2535:
-
Fix Version/s: 4.1.M3

> Imposible to import stored proceedure apart from db tables
> --
>
> Key: CAY-2535
> URL: https://issues.apache.org/jira/browse/CAY-2535
> Project: Cayenne
>  Issue Type: Bug
>  Components: Modeler
>Affects Versions: 4.1.M3
>Reporter: ana benko
>Priority: Minor
> Fix For: 4.1.M3
>
>
> # Import db schema
>  # Modify db, add stored procedure
>  # On DB Import tab, refresh db schema and include stored procedure to import 
> configuration
>  # Run Import
> -> Nothing to import. Stored procedure is not imported.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Assigned] (CAY-2531) Importing same schema after Import Revert clears all entities in datamap

2019-02-11 Thread Nikita Timofeev (JIRA)


 [ 
https://issues.apache.org/jira/browse/CAY-2531?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Nikita Timofeev reassigned CAY-2531:


Assignee: Arseni Bulatski

> Importing same schema after Import Revert clears all entities in datamap
> 
>
> Key: CAY-2531
> URL: https://issues.apache.org/jira/browse/CAY-2531
> Project: Cayenne
>  Issue Type: Bug
>  Components: Modeler
>Affects Versions: 4.1.M3
>Reporter: ana benko
>Assignee: Arseni Bulatski
>Priority: Minor
> Fix For: 4.1.M3
>
>
> Preconditions: configure connection to db with multiple schemas
>  # Select one schema in DB Schema window, Import
> -> successfully imported
>  # Remove schema from db import configuration window
>  # Run Import, click Revert in Result pop up window
>  # Add same schema to db import config window, run Import once more
> -> 'not changes to import' window appears.
>   4. Click OK
> -> all previously imported entities are removed in datamap



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Closed] (CAY-2487) Remove CayenneException useage

2019-02-11 Thread Nikita Timofeev (JIRA)


 [ 
https://issues.apache.org/jira/browse/CAY-2487?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Nikita Timofeev closed CAY-2487.

   Resolution: Fixed
 Assignee: Nikita Timofeev
Fix Version/s: 4.1.M3

> Remove CayenneException useage
> --
>
> Key: CAY-2487
> URL: https://issues.apache.org/jira/browse/CAY-2487
> Project: Cayenne
>  Issue Type: Improvement
>Affects Versions: 4.1.M3
>Reporter: Konstantin
>Assignee: Nikita Timofeev
>Priority: Minor
>  Labels: pull-request-available
> Fix For: 4.1.M3
>
>
> Remove usage of CayenneException. Use CayenneRuntimeException instead.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Closed] (CAY-2518) Add method to append having qualifier expression to ObjectSelect

2019-02-11 Thread Nikita Timofeev (JIRA)


 [ 
https://issues.apache.org/jira/browse/CAY-2518?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Nikita Timofeev closed CAY-2518.

   Resolution: Fixed
Fix Version/s: (was: 4.1.M3)

> Add method to append having qualifier expression to ObjectSelect
> 
>
> Key: CAY-2518
> URL: https://issues.apache.org/jira/browse/CAY-2518
> Project: Cayenne
>  Issue Type: Task
>  Components: Core Library
>Affects Versions: 4.1.M3, 4.2.M1
>Reporter: Arseni Bulatski
>Assignee: Arseni Bulatski
>Priority: Major
>  Labels: pull-request-available
> Fix For: 4.2.M1
>
>  Time Spent: 20m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (CAY-2530) DB Import and Class Generation from Project is performed for removed datamaps

2019-02-11 Thread Nikita Timofeev (JIRA)


 [ 
https://issues.apache.org/jira/browse/CAY-2530?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Nikita Timofeev updated CAY-2530:
-
Fix Version/s: 4.1.M3

> DB Import and Class Generation from Project is performed for removed datamaps
> -
>
> Key: CAY-2530
> URL: https://issues.apache.org/jira/browse/CAY-2530
> Project: Cayenne
>  Issue Type: Bug
>  Components: Modeler
>Affects Versions: 4.1.M3
>Reporter: ana benko
>Priority: Major
> Fix For: 4.1.M3
>
>
> # Add 2 datamaps
>  # Configure db import for both and run import
>  # Generate classes in both datamaps
>  # Remove one datamap, save
>  # Click on Project and make sure DB Import and Class Generation tab have 
> only one datamap and it is selected -> OK
>  # Run DB Import and Generate Classes from Project 'level'
> -> db import and class generation is performed for both, removed and selected 
> datamaps



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Assigned] (CAY-2521) Expression without Object ID disjoint issue

2019-02-11 Thread Nikita Timofeev (JIRA)


 [ 
https://issues.apache.org/jira/browse/CAY-2521?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Nikita Timofeev reassigned CAY-2521:


Assignee: Arseni Bulatski

> Expression without Object ID disjoint issue
> ---
>
> Key: CAY-2521
> URL: https://issues.apache.org/jira/browse/CAY-2521
> Project: Cayenne
>  Issue Type: Bug
>Affects Versions: 4.0, 4.0.1, 4.1.M3
>Reporter: Vital Zanko
>Assignee: Arseni Bulatski
>Priority: Major
> Fix For: 4.0.2, 4.1.M3
>
> Attachments: disjoint issue.png
>
>
> As an example, there are three tables: issue, team, location. There are some 
> relationships among them:
>  * issue.home_team_id = team.id
>  * issue.location_id = location.id
>  * location.team_id = team.id
>  * team.home_location_id = location.id
> !disjoint issue.png!
> {code:java}
> Team team = Cayenne.objectForPK(localContext, Team.class, 1);
>   
> SelectQuery select = new SelectQuery<>(Issue.class, 
> ExpressionFactory.exp("homeTeam = 1"));
> select.addPrefetch(Issue.HOME_TEAM.disjoint());
> select.addPrefetch(Issue.LOCATION.disjoint());
> select.addPrefetch(Issue.HOME_TEAM.dot(Team.HOME_LOCATION).disjoint());
> List issues = localContext.select(select);
> {code}
> This causes following sql query for prefetched team's home location objects 
> which doesn't correlate with the expression (it shouldn't be applied on): 
> {code:java}
> [05/Feb/2019:09:36:37,102] bootique-http-41 u=user1 INFO  
> o.a.c.l.JdbcEventLogger: SELECT t0.name, t0.id, t0.team_id FROM mydb.location 
> t0 WHERE t0.id = ? [bind: 1->id:1]
> [05/Feb/2019:09:36:37,104] bootique-http-41 u=user1 INFO  
> o.a.c.l.JdbcEventLogger: === returned 0 rows. - took 3 ms.
> {code}
>  
> The issue will be resolved when Object Id is being used as a parameter in the 
> expression:
> {code:java}
> SelectQuery select = new SelectQuery<>(Issue.class, 
> ExpressionFactory.exp("homeTeam = $id" , (Object) team.getObjectId()));
> // some custom code
> select.addPrefetch(Issue.HOME_TEAM.dot(Team.HOME_LOCATION).disjoint());
> List issues = localContext.select(select);{code}
> {code:java}
> [05/Feb/2019:09:56:25,087] bootique-http-34 u=user1 INFO  
> o.a.c.l.JdbcEventLogger: SELECT t0.name, t0.id, t0.team_id FROM mydb.location 
> t0 JOIN mydb.team t1 ON (t0.id = t1.home_location_id) WHERE t1.id = ? [bind: 
> 1->id:1]
> [05/Feb/2019:09:56:25,100] bootique-http-34 u=user1 INFO  
> o.a.c.l.JdbcEventLogger: === returned 1 row. - took 13 ms.{code}
>  
> Or the issue will be also resolved in case of expression without object id 
> when java code declares _disjoint by id_
> {code:java}
> SelectQuery select = new SelectQuery<>(Issue.class, 
> ExpressionFactory.exp("homeTeam = 1"));
> // some custom code
> select.addPrefetch(Issue.HOME_TEAM.dot(Team.HOME_LOCATION).disjointById());
> List issues = localContext.select(select);
> {code}
> {code:java}
> [05/Feb/2019:09:59:23,605] bootique-http-36 u=user1 INFO  
> o.a.c.l.JdbcEventLogger: --- transaction started.
> [05/Feb/2019:09:59:23,606] bootique-http-36 u=user1 INFO  
> o.a.c.l.JdbcEventLogger: SELECT t0.name, t0.id, t0.team_id FROM mydb.location 
> t0 WHERE t0.id = ? [bind: 1->id:71]
> [05/Feb/2019:09:59:23,609] bootique-http-36 u=user1 INFO  
> o.a.c.l.JdbcEventLogger: === returned 1 row. - took 4 ms.
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (CAY-2521) Expression without Object ID disjoint issue

2019-02-11 Thread Arseni Bulatski (JIRA)


 [ 
https://issues.apache.org/jira/browse/CAY-2521?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Arseni Bulatski updated CAY-2521:
-
Affects Version/s: 4.1.M3

> Expression without Object ID disjoint issue
> ---
>
> Key: CAY-2521
> URL: https://issues.apache.org/jira/browse/CAY-2521
> Project: Cayenne
>  Issue Type: Bug
>Affects Versions: 4.0, 4.0.1, 4.1.M3
>Reporter: Vital Zanko
>Priority: Major
> Attachments: disjoint issue.png
>
>
> As an example, there are three tables: issue, team, location. There are some 
> relationships among them:
>  * issue.home_team_id = team.id
>  * issue.location_id = location.id
>  * location.team_id = team.id
>  * team.home_location_id = location.id
> !disjoint issue.png!
> {code:java}
> Team team = Cayenne.objectForPK(localContext, Team.class, 1);
>   
> SelectQuery select = new SelectQuery<>(Issue.class, 
> ExpressionFactory.exp("homeTeam = 1"));
> select.addPrefetch(Issue.HOME_TEAM.disjoint());
> select.addPrefetch(Issue.LOCATION.disjoint());
> select.addPrefetch(Issue.HOME_TEAM.dot(Team.HOME_LOCATION).disjoint());
> List issues = localContext.select(select);
> {code}
> This causes following sql query for prefetched team's home location objects 
> which doesn't correlate with the expression (it shouldn't be applied on): 
> {code:java}
> [05/Feb/2019:09:36:37,102] bootique-http-41 u=user1 INFO  
> o.a.c.l.JdbcEventLogger: SELECT t0.name, t0.id, t0.team_id FROM mydb.location 
> t0 WHERE t0.id = ? [bind: 1->id:1]
> [05/Feb/2019:09:36:37,104] bootique-http-41 u=user1 INFO  
> o.a.c.l.JdbcEventLogger: === returned 0 rows. - took 3 ms.
> {code}
>  
> The issue will be resolved when Object Id is being used as a parameter in the 
> expression:
> {code:java}
> SelectQuery select = new SelectQuery<>(Issue.class, 
> ExpressionFactory.exp("homeTeam = $id" , (Object) team.getObjectId()));
> // some custom code
> select.addPrefetch(Issue.HOME_TEAM.dot(Team.HOME_LOCATION).disjoint());
> List issues = localContext.select(select);{code}
> {code:java}
> [05/Feb/2019:09:56:25,087] bootique-http-34 u=user1 INFO  
> o.a.c.l.JdbcEventLogger: SELECT t0.name, t0.id, t0.team_id FROM mydb.location 
> t0 JOIN mydb.team t1 ON (t0.id = t1.home_location_id) WHERE t1.id = ? [bind: 
> 1->id:1]
> [05/Feb/2019:09:56:25,100] bootique-http-34 u=user1 INFO  
> o.a.c.l.JdbcEventLogger: === returned 1 row. - took 13 ms.{code}
>  
> Or the issue will be also resolved in case of expression without object id 
> when java code declares _disjoint by id_
> {code:java}
> SelectQuery select = new SelectQuery<>(Issue.class, 
> ExpressionFactory.exp("homeTeam = 1"));
> // some custom code
> select.addPrefetch(Issue.HOME_TEAM.dot(Team.HOME_LOCATION).disjointById());
> List issues = localContext.select(select);
> {code}
> {code:java}
> [05/Feb/2019:09:59:23,605] bootique-http-36 u=user1 INFO  
> o.a.c.l.JdbcEventLogger: --- transaction started.
> [05/Feb/2019:09:59:23,606] bootique-http-36 u=user1 INFO  
> o.a.c.l.JdbcEventLogger: SELECT t0.name, t0.id, t0.team_id FROM mydb.location 
> t0 WHERE t0.id = ? [bind: 1->id:71]
> [05/Feb/2019:09:59:23,609] bootique-http-36 u=user1 INFO  
> o.a.c.l.JdbcEventLogger: === returned 1 row. - took 4 ms.
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (CAY-2521) Expression without Object ID disjoint issue

2019-02-11 Thread Arseni Bulatski (JIRA)


 [ 
https://issues.apache.org/jira/browse/CAY-2521?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Arseni Bulatski updated CAY-2521:
-
Fix Version/s: 4.1.M3
   4.0.2

> Expression without Object ID disjoint issue
> ---
>
> Key: CAY-2521
> URL: https://issues.apache.org/jira/browse/CAY-2521
> Project: Cayenne
>  Issue Type: Bug
>Affects Versions: 4.0, 4.0.1, 4.1.M3
>Reporter: Vital Zanko
>Priority: Major
> Fix For: 4.0.2, 4.1.M3
>
> Attachments: disjoint issue.png
>
>
> As an example, there are three tables: issue, team, location. There are some 
> relationships among them:
>  * issue.home_team_id = team.id
>  * issue.location_id = location.id
>  * location.team_id = team.id
>  * team.home_location_id = location.id
> !disjoint issue.png!
> {code:java}
> Team team = Cayenne.objectForPK(localContext, Team.class, 1);
>   
> SelectQuery select = new SelectQuery<>(Issue.class, 
> ExpressionFactory.exp("homeTeam = 1"));
> select.addPrefetch(Issue.HOME_TEAM.disjoint());
> select.addPrefetch(Issue.LOCATION.disjoint());
> select.addPrefetch(Issue.HOME_TEAM.dot(Team.HOME_LOCATION).disjoint());
> List issues = localContext.select(select);
> {code}
> This causes following sql query for prefetched team's home location objects 
> which doesn't correlate with the expression (it shouldn't be applied on): 
> {code:java}
> [05/Feb/2019:09:36:37,102] bootique-http-41 u=user1 INFO  
> o.a.c.l.JdbcEventLogger: SELECT t0.name, t0.id, t0.team_id FROM mydb.location 
> t0 WHERE t0.id = ? [bind: 1->id:1]
> [05/Feb/2019:09:36:37,104] bootique-http-41 u=user1 INFO  
> o.a.c.l.JdbcEventLogger: === returned 0 rows. - took 3 ms.
> {code}
>  
> The issue will be resolved when Object Id is being used as a parameter in the 
> expression:
> {code:java}
> SelectQuery select = new SelectQuery<>(Issue.class, 
> ExpressionFactory.exp("homeTeam = $id" , (Object) team.getObjectId()));
> // some custom code
> select.addPrefetch(Issue.HOME_TEAM.dot(Team.HOME_LOCATION).disjoint());
> List issues = localContext.select(select);{code}
> {code:java}
> [05/Feb/2019:09:56:25,087] bootique-http-34 u=user1 INFO  
> o.a.c.l.JdbcEventLogger: SELECT t0.name, t0.id, t0.team_id FROM mydb.location 
> t0 JOIN mydb.team t1 ON (t0.id = t1.home_location_id) WHERE t1.id = ? [bind: 
> 1->id:1]
> [05/Feb/2019:09:56:25,100] bootique-http-34 u=user1 INFO  
> o.a.c.l.JdbcEventLogger: === returned 1 row. - took 13 ms.{code}
>  
> Or the issue will be also resolved in case of expression without object id 
> when java code declares _disjoint by id_
> {code:java}
> SelectQuery select = new SelectQuery<>(Issue.class, 
> ExpressionFactory.exp("homeTeam = 1"));
> // some custom code
> select.addPrefetch(Issue.HOME_TEAM.dot(Team.HOME_LOCATION).disjointById());
> List issues = localContext.select(select);
> {code}
> {code:java}
> [05/Feb/2019:09:59:23,605] bootique-http-36 u=user1 INFO  
> o.a.c.l.JdbcEventLogger: --- transaction started.
> [05/Feb/2019:09:59:23,606] bootique-http-36 u=user1 INFO  
> o.a.c.l.JdbcEventLogger: SELECT t0.name, t0.id, t0.team_id FROM mydb.location 
> t0 WHERE t0.id = ? [bind: 1->id:71]
> [05/Feb/2019:09:59:23,609] bootique-http-36 u=user1 INFO  
> o.a.c.l.JdbcEventLogger: === returned 1 row. - took 4 ms.
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)