Build failed in Jenkins: cayenne-master » derby,jdk-1.8.0,Ubuntu #88

2014-11-16 Thread Apache Jenkins Server
See 


Changes:

[aadamchik] CAY-1946 CDbimport improvements

--
[...truncated 44279 lines...]
  SelectQueryCacheKeyIT.testUseLocalCache » NoClassDefFound Could not 
initialize...
  SelectQueryPrefetchRouterActionIT.testPrefetchPaintings2 » NoClassDefFound 
Cou...
  SelectQueryPrefetchRouterActionIT.testPaintings1 » NoClassDefFound Could not 
i...
  SelectQueryPrefetchRouterActionIT.testGalleries » NoClassDefFound Could not 
in...
  SelectQueryFetchLimitOrderingIT.testOrdering » NoClassDefFound Could not 
initi...
  SelectQueryPrefetchRouterActionQualifiedEntityIT.testPrefetchManager » 
NoClassDefFound
  SelectQueryPrefetchRouterActionQualifiedEntityIT.testPrefetchEmployee » 
NoClassDefFound
  SQLTemplateCacheKeyIT.testCacheFetchLimitAndOffset » NoClassDefFound Could 
not...
  SQLTemplateCacheKeyIT.testNamedQuery » NoClassDefFound Could not initialize 
cl...
  SQLTemplateCacheKeyIT.testSharedCache » NoClassDefFound Could not initialize 
c...
  SQLTemplateCacheKeyIT.testLocalCache » NoClassDefFound Could not initialize 
cl...
  SQLTemplateCacheKeyIT.testNoCache » NoClassDefFound Could not initialize 
class...
  SQLSelectIT.test_DataRows_FetchLimit » NoClassDefFound Could not initialize 
cl...
  SQLSelectIT.test_Append » NoClassDefFound Could not initialize class 
org.apach...
  SQLSelectIT.test_Select » NoClassDefFound Could not initialize class 
org.apach...
  SQLSelectIT.test_SelectLong » NoClassDefFound Could not initialize class 
org.a...
  SQLSelectIT.test_DataRows_DefaultRoot » NoClassDefFound Could not initialize 
c...
  SQLSelectIT.testSQLTemplate_PositionalParams » NoClassDefFound Could not 
initi...
  SQLSelectIT.test_DataRows_DataMapNameRoot » NoClassDefFound Could not 
initiali...
  SQLSelectIT.test_DataRows_ClassRoot_Bind » NoClassDefFound Could not 
initializ...
  SQLSelectIT.test_DataRows_ClassRoot » NoClassDefFound Could not initialize 
cla...
  SQLSelectIT.test_DataRows_FetchOffset » NoClassDefFound Could not initialize 
c...
  SQLSelectIT.test_SelectOne » NoClassDefFound Could not initialize class 
org.ap...
  SQLSelectIT.test_DataRows_ClassRoot_Parameters » NoClassDefFound Could not 
ini...
  SQLSelectIT.test_SelectLongArray » NoClassDefFound Could not initialize class 
...
  SQLSelectIT.test_DataRows_ColumnNameCaps » NoClassDefFound Could not 
initializ...
  SQLSelectIT.test_SelectCount » NoClassDefFound Could not initialize class 
org
  EJBQLQueryIT.testDataRows » NoClassDefFound Could not initialize class 
org.apa...
  EJBQLQueryIT.testNullAndNotNullParameter » NoClassDefFound Could not 
initializ...
  EJBQLQueryIT.testInWithSingleCollectionNamedParameter_withoutBrackets » 
NoClassDefFound
  EJBQLQueryIT.testUniqueKeyEntity » NoClassDefFound Could not initialize class 
...
  EJBQLQueryIT.testInWithMultipleStringPositionalParameters_withBrackets » 
NoClassDefFound
  EJBQLQueryIT.testJoinAndCount » NoClassDefFound Could not initialize class 
org...
  EJBQLQueryIT.testInWithSingleCollectionNamedParameter_withBrackets » 
NoClassDefFound
  EJBQLQueryIT.testInWithSingleCollectionPositionalParameter_withoutBrackets » 
NoClassDefFound
  EJBQLQueryIT.testInWithSingleCollectionPositionalParameter_withBrackets » 
NoClassDefFound
  EJBQLQueryIT.testSelectRelationship » NoClassDefFound Could not initialize 
cla...
  EJBQLQueryIT.testOrBrackets » NoClassDefFound Could not initialize class 
org.a...
  EJBQLQueryIT.testGetName » NoClassDefFound Could not initialize class 
org.apac...
  EJBQLQueryIT.testLikeWithExplicitEscape » NoClassDefFound Could not 
initialize...
  EJBQLQueryIT.testParameters » NoClassDefFound Could not initialize class 
org.a...
  EJBQLQueryIT.testGetExpression » NoClassDefFound Could not initialize class 
or...
  EJBQLQueryIT.testCacheParameters » NoClassDefFound Could not initialize class 
...
  EJBQLQueryIT.testRelationshipWhereClause2 » NoClassDefFound Could not 
initiali...
  EJBQLQueryIT.testNullPositionalParameter » NoClassDefFound Could not 
initializ...
  EJBQLQueryIT.testRelationshipWhereClause » NoClassDefFound Could not 
initializ...
  EJBQLQueryIT.testInWithSingleStringPositionalParameter_withoutBrackets » 
NoClassDefFound
  EJBQLQueryIT.testGetMetadata » NoClassDefFound Could not initialize class 
org
  EJBQLQueryIT.testNullParameter » NoClassDefFound Could not initialize class 
or...
  EJBQLQueryIT.testEncodeAsXML » NoClassDefFound Could not initialize class 
org
  EJBQLQueryIT.testCacheStrategy » NoClassDefFound Could not initialize class 
or...
  EJBQLQueryIT.testJoinToJoined » NoClassDefFound Could not initialize class 
org...
  EJBQLQueryIT.testNullNotEqualsParameter » NoClassDefFound Could not 
initialize...
  ObjectSelect_CompileIT.testCreateReplacementQuery_Bare » NoClassDefFound 
Could...
  ObjectSelect_CompileIT.testCreateReplacementQuery_Full » NoClassDefFound 
Could...
  ObjectSelect_CompileIT

cayenne git commit: CAY-1946 CDbimport improvements

2014-11-16 Thread aadamchik
Repository: cayenne
Updated Branches:
  refs/heads/CAY-1946_1 276f049cf -> 7f64112f8


CAY-1946 CDbimport improvements

* adding a note on SmartNamingStrategy removal - was bitten by that
  on upgrade


Project: http://git-wip-us.apache.org/repos/asf/cayenne/repo
Commit: http://git-wip-us.apache.org/repos/asf/cayenne/commit/7f64112f
Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/7f64112f
Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/7f64112f

Branch: refs/heads/CAY-1946_1
Commit: 7f64112f8ab3ffa93aeed5f4643d327a936bda9b
Parents: 276f049
Author: aadamchik 
Authored: Sun Nov 16 15:11:56 2014 +0300
Committer: aadamchik 
Committed: Sun Nov 16 16:34:50 2014 +0300

--
 docs/doc/src/main/resources/UPGRADE.txt | 4 
 1 file changed, 4 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/cayenne/blob/7f64112f/docs/doc/src/main/resources/UPGRADE.txt
--
diff --git a/docs/doc/src/main/resources/UPGRADE.txt 
b/docs/doc/src/main/resources/UPGRADE.txt
index 94f8f72..7aaff0f 100644
--- a/docs/doc/src/main/resources/UPGRADE.txt
+++ b/docs/doc/src/main/resources/UPGRADE.txt
@@ -9,6 +9,10 @@ UPGRADING TO 4.0.M2
 * Note that 3.2 line of development was renamed to 4.0. So 4.0.M2 is a 
straight descendant of
   3.2M1.
 
+* org.apache.cayenne.map.naming.SmartNamingStrategy was replaced with 
org.apache.cayenne.map.naming.DefaultNameGenerator. If you
+  mentioned SmartNamingStrategy explicitly in your Maven or Ant configs, make 
sure you rename it. Since this was/is the default,
+  chances are that you didn't.
+
 * Minimal required JDK version is now 1.6 (both for modeler and runtime). This 
is a pretty conservative 
   requirement, considering that Java 1.6 has been EOL'd by Oracle on Feb 2013.
 



Build failed in Jenkins: cayenne-master » derby,jdk-1.8.0,Ubuntu #87

2014-11-16 Thread Apache Jenkins Server
See 


--
[...truncated 44279 lines...]
  SelectQueryCacheKeyIT.testUseLocalCache » NoClassDefFound Could not 
initialize...
  SelectQueryPrefetchRouterActionIT.testPrefetchPaintings2 » NoClassDefFound 
Cou...
  SelectQueryPrefetchRouterActionIT.testPaintings1 » NoClassDefFound Could not 
i...
  SelectQueryPrefetchRouterActionIT.testGalleries » NoClassDefFound Could not 
in...
  SelectQueryFetchLimitOrderingIT.testOrdering » NoClassDefFound Could not 
initi...
  SelectQueryPrefetchRouterActionQualifiedEntityIT.testPrefetchManager » 
NoClassDefFound
  SelectQueryPrefetchRouterActionQualifiedEntityIT.testPrefetchEmployee » 
NoClassDefFound
  SQLTemplateCacheKeyIT.testCacheFetchLimitAndOffset » NoClassDefFound Could 
not...
  SQLTemplateCacheKeyIT.testNamedQuery » NoClassDefFound Could not initialize 
cl...
  SQLTemplateCacheKeyIT.testSharedCache » NoClassDefFound Could not initialize 
c...
  SQLTemplateCacheKeyIT.testLocalCache » NoClassDefFound Could not initialize 
cl...
  SQLTemplateCacheKeyIT.testNoCache » NoClassDefFound Could not initialize 
class...
  SQLSelectIT.test_DataRows_FetchLimit » NoClassDefFound Could not initialize 
cl...
  SQLSelectIT.test_Append » NoClassDefFound Could not initialize class 
org.apach...
  SQLSelectIT.test_Select » NoClassDefFound Could not initialize class 
org.apach...
  SQLSelectIT.test_SelectLong » NoClassDefFound Could not initialize class 
org.a...
  SQLSelectIT.test_DataRows_DefaultRoot » NoClassDefFound Could not initialize 
c...
  SQLSelectIT.testSQLTemplate_PositionalParams » NoClassDefFound Could not 
initi...
  SQLSelectIT.test_DataRows_DataMapNameRoot » NoClassDefFound Could not 
initiali...
  SQLSelectIT.test_DataRows_ClassRoot_Bind » NoClassDefFound Could not 
initializ...
  SQLSelectIT.test_DataRows_ClassRoot » NoClassDefFound Could not initialize 
cla...
  SQLSelectIT.test_DataRows_FetchOffset » NoClassDefFound Could not initialize 
c...
  SQLSelectIT.test_SelectOne » NoClassDefFound Could not initialize class 
org.ap...
  SQLSelectIT.test_DataRows_ClassRoot_Parameters » NoClassDefFound Could not 
ini...
  SQLSelectIT.test_SelectLongArray » NoClassDefFound Could not initialize class 
...
  SQLSelectIT.test_DataRows_ColumnNameCaps » NoClassDefFound Could not 
initializ...
  SQLSelectIT.test_SelectCount » NoClassDefFound Could not initialize class 
org
  EJBQLQueryIT.testDataRows » NoClassDefFound Could not initialize class 
org.apa...
  EJBQLQueryIT.testNullAndNotNullParameter » NoClassDefFound Could not 
initializ...
  EJBQLQueryIT.testInWithSingleCollectionNamedParameter_withoutBrackets » 
NoClassDefFound
  EJBQLQueryIT.testUniqueKeyEntity » NoClassDefFound Could not initialize class 
...
  EJBQLQueryIT.testInWithMultipleStringPositionalParameters_withBrackets » 
NoClassDefFound
  EJBQLQueryIT.testJoinAndCount » NoClassDefFound Could not initialize class 
org...
  EJBQLQueryIT.testInWithSingleCollectionNamedParameter_withBrackets » 
NoClassDefFound
  EJBQLQueryIT.testInWithSingleCollectionPositionalParameter_withoutBrackets » 
NoClassDefFound
  EJBQLQueryIT.testInWithSingleCollectionPositionalParameter_withBrackets » 
NoClassDefFound
  EJBQLQueryIT.testSelectRelationship » NoClassDefFound Could not initialize 
cla...
  EJBQLQueryIT.testOrBrackets » NoClassDefFound Could not initialize class 
org.a...
  EJBQLQueryIT.testGetName » NoClassDefFound Could not initialize class 
org.apac...
  EJBQLQueryIT.testLikeWithExplicitEscape » NoClassDefFound Could not 
initialize...
  EJBQLQueryIT.testParameters » NoClassDefFound Could not initialize class 
org.a...
  EJBQLQueryIT.testGetExpression » NoClassDefFound Could not initialize class 
or...
  EJBQLQueryIT.testCacheParameters » NoClassDefFound Could not initialize class 
...
  EJBQLQueryIT.testRelationshipWhereClause2 » NoClassDefFound Could not 
initiali...
  EJBQLQueryIT.testNullPositionalParameter » NoClassDefFound Could not 
initializ...
  EJBQLQueryIT.testRelationshipWhereClause » NoClassDefFound Could not 
initializ...
  EJBQLQueryIT.testInWithSingleStringPositionalParameter_withoutBrackets » 
NoClassDefFound
  EJBQLQueryIT.testGetMetadata » NoClassDefFound Could not initialize class 
org
  EJBQLQueryIT.testNullParameter » NoClassDefFound Could not initialize class 
or...
  EJBQLQueryIT.testEncodeAsXML » NoClassDefFound Could not initialize class 
org
  EJBQLQueryIT.testCacheStrategy » NoClassDefFound Could not initialize class 
or...
  EJBQLQueryIT.testJoinToJoined » NoClassDefFound Could not initialize class 
org...
  EJBQLQueryIT.testNullNotEqualsParameter » NoClassDefFound Could not 
initialize...
  ObjectSelect_CompileIT.testCreateReplacementQuery_Bare » NoClassDefFound 
Could...
  ObjectSelect_CompileIT.testCreateReplacementQuery_Full » NoClassDefFound 
Could...
  ObjectSelect_CompileIT.testCreateReplacementQuery_RootDataRow » 
NoClassDefFound
  O

[jira] [Commented] (CAY-1946) CDbimport improvements

2014-11-16 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CAY-1946:
-

Github user asfgit closed the pull request at:

https://github.com/apache/cayenne/pull/31


> CDbimport improvements
> --
>
> Key: CAY-1946
> URL: https://issues.apache.org/jira/browse/CAY-1946
> Project: Cayenne
>  Issue Type: Improvement
>  Components: Non-GUI Tools
>Reporter: Alex Kolonitsky
>
> We’ve experimented with automated db-first approach to Cayenne modeling for 
> more than a year on a set of client projects. Roughly this approach means 
> that DB evolution is managed via external tools (e.g. liquibase) and Cayenne 
> artifacts are managed using the following POM configuration:
> 
>   org.apache.cayenne.plugins
>   maven-cayenne-plugin
>   
>   ...
>   
>   
>   
>   default-cli
>   
>   cdbimport
>   cgen
>   
>   
>   
> 
> “cdbimport” ensures that Cayenne model is always in sync with DB, “cgen” - 
> that Java classes are in sync with the model. There are zero problems with 
> “cgen", not so with “cdbimport". If you control the schema, you get a 
> decently named Java classes/properties in 95% of the cases. Here we are 
> trying to address the remaining 5% that make things ugly:
> * Inability to generate meaningful relationship names in many cases.
> * Inability to customize attribute/relationship names and data types.
> To solve this here we are proposing a merge algorithm that would preserve 
> customizations to the Obj* layer made by the user. And in addition to that a 
> special descriptor that can be used for more advanced filtering and 
> customization of cdbimport process. Both of these improvements will hopefully 
> result in “cdbimport” becoming a tool of choice for Cayenne work for many 
> users.
> https://docs.google.com/document/d/1DF5-_mMDCuH7iUFhEFDm2q-ebVeSPgvOaymho88ywJ0/edit?pli=1



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


[GitHub] cayenne pull request: CAY-1946

2014-11-16 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/cayenne/pull/31


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[2/7] cayenne git commit: CAY-1946 CDbimport improvements

2014-11-16 Thread aadamchik
http://git-wip-us.apache.org/repos/asf/cayenne/blob/276f049c/cayenne-tools/src/test/resources/org/apache/cayenne/tools/build-flat.xml
--
diff --git 
a/cayenne-tools/src/test/resources/org/apache/cayenne/tools/build-flat.xml 
b/cayenne-tools/src/test/resources/org/apache/cayenne/tools/build-flat.xml
new file mode 100644
index 000..29f9e72
--- /dev/null
+++ b/cayenne-tools/src/test/resources/org/apache/cayenne/tools/build-flat.xml
@@ -0,0 +1,75 @@
+
+
+
+
+
+
+
+
+
+includeTable-01
+
+
+includeTable-02
+
+
+
+
+
+
+
+excludeTable-01
+
+excludeTable-02
+
+
+
+includeColumn-01
+
+includeColumn-02
+
+
+excludeColumn-01
+
+excludeColumn-02
+
+
+
+includeProcedure-01
+
+includeProcedure-02
+
+
+excludeProcedure-01
+
+excludeProcedure-02
+
+
+
+
+
+
+
+
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cayenne/blob/276f049c/cayenne-tools/src/test/resources/org/apache/cayenne/tools/build-mapping.xml
--
diff --git 
a/cayenne-tools/src/test/resources/org/apache/cayenne/tools/build-mapping.xml 
b/cayenne-tools/src/test/resources/org/apache/cayenne/tools/build-mapping.xml
new file mode 100644
index 000..90d6116
--- /dev/null
+++ 
b/cayenne-tools/src/test/resources/org/apache/cayenne/tools/build-mapping.xml
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cayenne/blob/276f049c/cayenne-tools/src/test/resources/org/apache/cayenne/tools/build-reverse-engineering-in-external-file.xml
--
diff --git 
a/cayenne-tools/src/test/resources/org/apache/cayenne/tools/build-reverse-engineering-in-external-file.xml
 
b/cayenne-tools/src/test/resources/org/apache/cayenne/tools/build-reverse-engineering-in-external-file.xml
new file mode 100644
index 000..8cd89e8
--- /dev/null
+++ 
b/cayenne-tools/src/test/resources/org/apache/cayenne/tools/build-reverse-engineering-in-external-file.xml
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cayenne/blob/276f049c/cayenne-tools/src/test/resources/org/apache/cayenne/tools/build-schema.xml
--
diff --git 
a/cayenne-tools/src/test/resources/org/apache/cayenne/tools/build-schema.xml 
b/cayenne-tools/src/test/resources/org/apache/cayenne/tools/build-schema.xml
new file mode 100644
index 000..2d7bb6b
--- /dev/null
+++ b/cayenne-tools/src/test/resources/org/apache/cayenne/tools/build-schema.xml
@@ -0,0 +1,83 @@
+
+
+
+
+
+
+
+
+
+schema-name-01
+
+
+schema-name-02
+
+
+
+includeTable-01
+
+
+includeTable-02
+
+
+
+
+
+
+
+excludeTable-01
+
+excludeTable-02
+
+
+
+includeColumn-01
+
+includeColumn-02
+
+
+excludeColumn-01
+
+excludeColumn-02
+
+
+
+includeProcedure-01
+
+includeProcedure-02
+
+
+excludeProcedure-01
+
+excludeProcedure-02
+
+
+
+
+
+
+
+
+
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cayenne/blob/276f049c/cayenne-tools/src/test/resources/org/apache/cayenne/tools/dbimport/build-include-table.map.xml-result
--
diff --git 
a/cayenne-tools/src/test/resources/org/apache/cayenne/tools/dbimport/build-include-table.map.xml-result
 
b/cayenne-tools/src/test/resources/org/apache/cayenne/tools/dbimport/build-include-table.map.xml-result
new file mode 100644
index 000..8854a8b
--- /dev/null
+++ 
b/cayenne-tools/src/test/resources/org/apache/cayenne/tools/dbimport/build-include-table.map.xml-result
@@ -0,0 +1,37 @@
+
+
+htt

[5/7] cayenne git commit: CAY-1946 CDbimport improvements

2014-11-16 Thread aadamchik
http://git-wip-us.apache.org/repos/asf/cayenne/blob/276f049c/cayenne-server/src/main/java/org/apache/cayenne/merge/AddColumnToDb.java
--
diff --git 
a/cayenne-server/src/main/java/org/apache/cayenne/merge/AddColumnToDb.java 
b/cayenne-server/src/main/java/org/apache/cayenne/merge/AddColumnToDb.java
index 2192203..77b7486 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/merge/AddColumnToDb.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/merge/AddColumnToDb.java
@@ -1,30 +1,29 @@
-/*
- *   Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ *or more contributor license agreements.  See the NOTICE file
+ *distributed with this work for additional information
+ *regarding copyright ownership.  The ASF licenses this file
+ *to you under the Apache License, Version 2.0 (the
+ *"License"); you may not use this file except in compliance
+ *with the License.  You may obtain a copy of the License at
  *
- *http://www.apache.org/licenses/LICENSE-2.0
+ *  http://www.apache.org/licenses/LICENSE-2.0
  *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- /
+ *Unless required by applicable law or agreed to in writing,
+ *software distributed under the License is distributed on an
+ *"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *KIND, either express or implied.  See the License for the
+ *specific language governing permissions and limitations
+ *under the License.
+ */
 package org.apache.cayenne.merge;
 
 import java.util.Collections;
 import java.util.List;
 
-import org.apache.cayenne.CayenneRuntimeException;
 import org.apache.cayenne.dba.DbAdapter;
+import org.apache.cayenne.dba.JdbcAdapter;
 import org.apache.cayenne.dba.QuotingStrategy;
-import org.apache.cayenne.dba.TypesMapping;
 import org.apache.cayenne.map.DbAttribute;
 import org.apache.cayenne.map.DbEntity;
 
@@ -52,41 +51,8 @@ public class AddColumnToDb extends 
AbstractToDbToken.EntityAndColumn {
 QuotingStrategy context = adapter.getQuotingStrategy();
 appendPrefix(sqlBuffer, context);
 
-// copied from JdbcAdapter.createTableAppendColumn
-String[] types = 
adapter.externalTypesForJdbcType(getColumn().getType());
-if (types == null || types.length == 0) {
-String entityName = getColumn().getEntity() != null ? getColumn()
-.getEntity().getFullyQualifiedName() : "";
-throw new CayenneRuntimeException("Undefined type for attribute '"
-+ entityName + "." + getColumn().getName() + "': " + 
getColumn().getType());
-}
-
-String type = types[0];
-sqlBuffer.append(type);
-
-// append size and precision (if applicable)
-if (adapter.typeSupportsLength(getColumn().getType())) {
-int len = getColumn().getMaxLength();
-int scale = TypesMapping.isDecimal(getColumn().getType()) ? 
getColumn().getScale() : -1;
-
-// sanity check
-if (scale > len) {
-scale = -1;
-}
-
-if (len > 0) {
-sqlBuffer.append('(').append(len);
-
-if (scale >= 0) {
-sqlBuffer.append(", ").append(scale);
-}
-
-sqlBuffer.append(')');
-}
-}
-
-// use separate token to set value and not null if needed
-// sqlBuffer.append(" NULL");
+sqlBuffer.append(JdbcAdapter.getType(adapter, getColumn()));
+sqlBuffer.append(JdbcAdapter.sizeAndPrecision(adapter, getColumn()));
 
 return Collections.singletonList(sqlBuffer.toString());
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/276f049c/cayenne-server/src/main/java/org/apache/cayenne/merge/CreateTableToModel.java
--
diff --git 
a/cayenne-server/src/main/java/org/apache/cayenne/merge/CreateTableToModel.java 
b/cayenne-server/src/main/java/org/apache/cayenne/merge/CreateTableToModel.java
index d2f538f..61a266a 10064

[6/7] cayenne git commit: CAY-1946 CDbimport improvements

2014-11-16 Thread aadamchik
http://git-wip-us.apache.org/repos/asf/cayenne/blob/276f049c/cayenne-server/src/main/java/org/apache/cayenne/access/loader/NamePatternMatcher.java
--
diff --git 
a/cayenne-server/src/main/java/org/apache/cayenne/access/loader/NamePatternMatcher.java
 
b/cayenne-server/src/main/java/org/apache/cayenne/access/loader/NamePatternMatcher.java
new file mode 100644
index 000..6faa7e4
--- /dev/null
+++ 
b/cayenne-server/src/main/java/org/apache/cayenne/access/loader/NamePatternMatcher.java
@@ -0,0 +1,225 @@
+/*
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ /
+
+package org.apache.cayenne.access.loader;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.regex.Pattern;
+import java.util.regex.PatternSyntaxException;
+
+import org.apache.cayenne.util.CayenneMapEntry;
+import org.apache.commons.logging.Log;
+
+/**
+ * Provides name pattern matching functionality.
+ * 
+ * @since 1.2
+ */
+public class NamePatternMatcher implements NameFilter {
+
+private static final String[] EMPTY_ARRAY = new String[0];
+private static final Pattern COMMA = Pattern.compile(",");
+
+private final Pattern[] itemIncludeFilters;
+private final Pattern[] itemExcludeFilters;
+
+public static NamePatternMatcher build(Log logger, String includePattern, 
String excludePattern) {
+return new NamePatternMatcher(createPatterns(logger, includePattern), 
createPatterns(logger, excludePattern));
+}
+
+public NamePatternMatcher(Pattern[] itemIncludeFilters, Pattern[] 
itemExcludeFilters) {
+this.itemIncludeFilters = itemIncludeFilters;
+this.itemExcludeFilters = itemExcludeFilters;
+}
+
+/**
+ * Applies preconfigured list of filters to the list, removing entities 
that do not
+ * pass the filter.
+ * 
+ * @deprecated since 3.0 still used by AntDataPortDelegate, which itself 
should
+ * probably be deprecated
+ */
+@Deprecated
+public List filter(List items) {
+if (items == null || items.isEmpty()) {
+return items;
+}
+
+if (itemIncludeFilters.length == 0 && itemExcludeFilters.length == 0) {
+return items;
+}
+
+Iterator it = items.iterator();
+while (it.hasNext()) {
+CayenneMapEntry entity = (CayenneMapEntry) it.next();
+
+if (!passedIncludeFilter(entity.getName())) {
+it.remove();
+continue;
+}
+
+if (!passedExcludeFilter(entity.getName())) {
+it.remove();
+}
+}
+
+return items;
+}
+
+/**
+ * Returns an array of Patterns. Takes a comma-separated list of patterns, 
attempting
+ * to convert them to the java.util.regex.Pattern syntax. E.g.
+ * 
+ * "billing_*,user?" will become an array of two expressions:
+ * 
+ * ^billing_.*$
+ * ^user.?$
+ */
+public static Pattern[] createPatterns(Log logger, String patternString) {
+if (patternString == null) {
+return new Pattern[0];
+}
+String[] patternStrings = tokenizePattern(patternString);
+List patterns = new ArrayList(patternStrings.length);
+
+for (String patternString1 : patternStrings) {
+
+// test the pattern
+try {
+patterns.add(Pattern.compile(patternString1));
+} catch (PatternSyntaxException e) {
+
+if (logger != null) {
+logger.warn("Ignoring invalid pattern [" + patternString1 
+ "], reason: " + e.getMessage());
+}
+}
+}
+
+return patterns.toArray(new Pattern[patterns.size()]);
+}
+
+/**
+ * Returns an array of valid regular expressions. Takes a comma-separated 
list of
+ * patterns, attempting to convert them to the java.util.regex.Pattern 
syntax. E.g.
+ * 
+ * "billing_*,user?" will become an array of two expressions:
+ * 
+

[4/7] cayenne git commit: CAY-1946 CDbimport improvements

2014-11-16 Thread aadamchik
http://git-wip-us.apache.org/repos/asf/cayenne/blob/276f049c/cayenne-tools/pom.xml
--
diff --git a/cayenne-tools/pom.xml b/cayenne-tools/pom.xml
index f4562cc..a97dd13 100644
--- a/cayenne-tools/pom.xml
+++ b/cayenne-tools/pom.xml
@@ -66,6 +66,12 @@
org.apache.ant
ant

+
+org.apache.ant
+ant-testutil
+1.9.4
+test
+
 

commons-collections
@@ -115,6 +121,16 @@
net.java.dev.inflector
inflector

+
+org.apache.derby
+derby
+test
+
+
+xmlunit
+xmlunit
+test
+
 


@@ -131,6 +147,16 @@


 
+maven-jar-plugin
+
+
+
+test-jar
+
+
+
+
+
 maven-checkstyle-plugin
 

[3/7] cayenne git commit: CAY-1946 CDbimport improvements

2014-11-16 Thread aadamchik
http://git-wip-us.apache.org/repos/asf/cayenne/blob/276f049c/cayenne-tools/src/main/java/org/apache/cayenne/tools/dbimport/config/FiltersConfigBuilder.java
--
diff --git 
a/cayenne-tools/src/main/java/org/apache/cayenne/tools/dbimport/config/FiltersConfigBuilder.java
 
b/cayenne-tools/src/main/java/org/apache/cayenne/tools/dbimport/config/FiltersConfigBuilder.java
new file mode 100644
index 000..8ccbe7a
--- /dev/null
+++ 
b/cayenne-tools/src/main/java/org/apache/cayenne/tools/dbimport/config/FiltersConfigBuilder.java
@@ -0,0 +1,169 @@
+/*
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ /
+package org.apache.cayenne.tools.dbimport.config;
+
+import static org.apache.cayenne.access.loader.filters.FilterFactory.NULL;
+import static org.apache.cayenne.access.loader.filters.FilterFactory.TRUE;
+
+import java.lang.reflect.Method;
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.apache.cayenne.access.loader.filters.DbPath;
+import org.apache.cayenne.access.loader.filters.EntityFilters;
+import org.apache.cayenne.access.loader.filters.Filter;
+import org.apache.cayenne.access.loader.filters.FilterFactory;
+import org.apache.cayenne.access.loader.filters.FiltersConfig;
+import org.apache.cayenne.access.loader.filters.ListFilter;
+
+/**
+* @since 3.2.
+*/
+public final class FiltersConfigBuilder {
+
+private final ReverseEngineering engineering;
+private final List filters = new 
LinkedList();
+
+public FiltersConfigBuilder(ReverseEngineering engineering) {
+this.engineering = engineering;
+}
+
+public FiltersConfigBuilder add(EntityFilters filter) {
+if (!filter.getDbPath().equals(new DbPath()) && !filter.isEmpty()) {
+this.filters.add(filter);
+}
+
+return this;
+}
+
+public FiltersConfig filtersConfig() {
+DbPath path = new DbPath();
+
+filters.addAll(processFilters(path, engineering));
+filters.addAll(processSchemas(path, engineering.getSchemas()));
+filters.addAll(processCatalog(path, engineering.getCatalogs()));
+
+if (filters.isEmpty()) {
+filters.add(defaultFilter(path));
+}
+return new FiltersConfig(filters);
+}
+
+private EntityFilters defaultFilter(DbPath path) {
+return new EntityFilters(path, TRUE, TRUE, NULL);
+}
+
+private Collection processSchemas(DbPath root, 
Collection schemas) {
+List filters = new LinkedList();
+for (Schema schema : schemas) {
+DbPath path = new DbPath(root.catalog, schema.getName());
+List schemaFilters = processFilters(path, schema);
+if (schemaFilters.isEmpty()) {
+schemaFilters.add(defaultFilter(path));
+}
+
+filters.addAll(schemaFilters);
+}
+
+return filters;
+}
+
+private Collection processCatalog(DbPath root, 
Collection catalogs) {
+List filters = new LinkedList();
+for (Catalog catalog: catalogs) {
+DbPath path = new DbPath(catalog.getName());
+
+List catalogFilters = new 
LinkedList();
+catalogFilters.addAll(processFilters(path, catalog));
+catalogFilters.addAll(processSchemas(path, catalog.getSchemas()));
+
+if (catalogFilters.isEmpty()) {
+catalogFilters.add(defaultFilter(path));
+}
+
+filters.addAll(catalogFilters);
+}
+
+return filters;
+}
+
+private List processFilters(DbPath root, FilterContainer 
container) {
+LinkedList res = new LinkedList();
+res.addAll(processTableFilters(root, container.getIncludeTables()));
+
+EntityFilters filter = new EntityFilters(
+root,
+
processIncludes(container.getIncludeTables()).join(processExcludes(container.getExcludeTables())),
+
processIncludes(container.getIncludeColumns()).join(processExcludes(container.getExcludeColumns())),

[1/7] cayenne git commit: CAY-1946 CDbimport improvements

2014-11-16 Thread aadamchik
Repository: cayenne
Updated Branches:
  refs/heads/CAY-1946_1 [created] 276f049cf


http://git-wip-us.apache.org/repos/asf/cayenne/blob/276f049c/plugins/maven-cayenne-plugin/src/test/java/org/apache/cayenne/tools/DbImporterMojoConfigurationTest.java
--
diff --git 
a/plugins/maven-cayenne-plugin/src/test/java/org/apache/cayenne/tools/DbImporterMojoConfigurationTest.java
 
b/plugins/maven-cayenne-plugin/src/test/java/org/apache/cayenne/tools/DbImporterMojoConfigurationTest.java
new file mode 100644
index 000..e5a3a49
--- /dev/null
+++ 
b/plugins/maven-cayenne-plugin/src/test/java/org/apache/cayenne/tools/DbImporterMojoConfigurationTest.java
@@ -0,0 +1,56 @@
+/*
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ /
+package org.apache.cayenne.tools;
+
+import static 
org.apache.cayenne.tools.dbimport.config.DefaultReverseEngineeringLoaderTest.*;
+import org.apache.maven.plugin.testing.AbstractMojoTestCase;
+import org.junit.Test;
+
+/**
+ * @since 3.2.
+ */
+public class DbImporterMojoConfigurationTest extends AbstractMojoTestCase {
+
+@Test
+public void testLoadCatalog() throws Exception {
+assertCatalog(getCdbImport("pom-catalog.xml").getReverseEngineering());
+}
+
+@Test
+public void testLoadSchema() throws Exception {
+assertSchema(getCdbImport("pom-schema.xml").getReverseEngineering());
+}
+
+@Test
+public void testLoadCatalogAndSchema() throws Exception {
+
assertCatalogAndSchema(getCdbImport("pom-catalog-and-schema.xml").getReverseEngineering());
+}
+
+@Test
+public void testLoadFlat() throws Exception {
+assertFlat(getCdbImport("pom-flat.xml").getReverseEngineering());
+
+}
+
+private DbImporterMojo getCdbImport(String pomFileName) throws Exception {
+return (DbImporterMojo) lookupMojo("cdbimport",
+
getTestFile("src/test/resources/org/apache/cayenne/tools/config/" + 
pomFileName));
+}
+
+}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/276f049c/plugins/maven-cayenne-plugin/src/test/java/org/apache/cayenne/tools/DbImporterMojoTest.java
--
diff --git 
a/plugins/maven-cayenne-plugin/src/test/java/org/apache/cayenne/tools/DbImporterMojoTest.java
 
b/plugins/maven-cayenne-plugin/src/test/java/org/apache/cayenne/tools/DbImporterMojoTest.java
index a255a9c..682f180 100644
--- 
a/plugins/maven-cayenne-plugin/src/test/java/org/apache/cayenne/tools/DbImporterMojoTest.java
+++ 
b/plugins/maven-cayenne-plugin/src/test/java/org/apache/cayenne/tools/DbImporterMojoTest.java
@@ -27,15 +27,20 @@ import java.sql.DriverManager;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.sql.Statement;
+import java.util.Iterator;
 
+import org.apache.cayenne.tools.dbimport.config.Catalog;
+import org.apache.cayenne.tools.dbimport.config.IncludeTable;
+import org.apache.cayenne.tools.dbimport.config.Schema;
 import org.apache.cayenne.tools.dbimport.DbImportConfiguration;
 import org.apache.maven.plugin.testing.AbstractMojoTestCase;
 import org.codehaus.plexus.util.FileUtils;
+import org.custommonkey.xmlunit.DetailedDiff;
+import org.custommonkey.xmlunit.Diff;
 import org.custommonkey.xmlunit.XMLUnit;
 import org.xml.sax.SAXException;
 
-import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual;
-import static org.junit.Assert.assertNotNull;
+import static org.apache.commons.lang.StringUtils.isBlank;
 
 public class DbImporterMojoTest extends AbstractMojoTestCase {
 
@@ -85,6 +90,18 @@ public class DbImporterMojoTest extends AbstractMojoTestCase 
{
 test("testImportAddTableAndColumn");
 }
 
+public void testSimpleFiltering() throws Exception {
+test("testSimpleFiltering");
+}
+
+public void testFilteringWithSchema() throws Exception {
+test("testFilteringWithSchema");
+}
+
+public void testSchemasAndTableExclude() throws Exception {
+test("testSchemasAndTableExclude");
+}
+
 private void test(Str

[7/7] cayenne git commit: CAY-1946 CDbimport improvements

2014-11-16 Thread aadamchik
CAY-1946 CDbimport improvements

* 2 pull request by Alex Kolonitsky , merged with master
  as of today, with various pom fixes
* fixing remaining SmartNamingStrategy references


Project: http://git-wip-us.apache.org/repos/asf/cayenne/repo
Commit: http://git-wip-us.apache.org/repos/asf/cayenne/commit/276f049c
Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/276f049c
Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/276f049c

Branch: refs/heads/CAY-1946_1
Commit: 276f049cf8b77c07f4161ceca07b0df1bca7aaee
Parents: a0f941a
Author: aadamchik 
Authored: Sun Nov 16 15:11:56 2014 +0300
Committer: aadamchik 
Committed: Sun Nov 16 15:11:56 2014 +0300

--
 .../org/apache/cayenne/access/DbLoader.java | 801 +--
 .../cayenne/access/DbLoaderConfiguration.java   |  48 --
 .../cayenne/access/DefaultDbLoaderDelegate.java |  54 --
 .../access/ManyToManyCandidateEntity.java   | 126 ---
 .../access/loader/BooleanNameFilter.java|  35 +
 .../access/loader/DbLoaderConfiguration.java| 115 +++
 .../access/loader/DefaultDbLoaderDelegate.java  |  55 ++
 .../loader/ManyToManyCandidateEntity.java   | 141 
 .../cayenne/access/loader/NameFilter.java   |  27 +
 .../access/loader/NamePatternMatcher.java   | 225 ++
 .../cayenne/access/loader/filters/DbPath.java   | 154 
 .../access/loader/filters/EntityFilters.java| 424 ++
 .../access/loader/filters/ExcludeFilter.java|  42 +
 .../cayenne/access/loader/filters/Filter.java   |  31 +
 .../access/loader/filters/FilterFactory.java|  94 +++
 .../access/loader/filters/FiltersConfig.java| 180 +
 .../access/loader/filters/IncludeFilter.java|  76 ++
 .../access/loader/filters/ListFilter.java   | 123 +++
 .../cayenne/access/loader/mapper/DbType.java| 195 +
 .../mapper/DefaultJdbc2JavaTypeMapper.java  | 282 +++
 .../loader/mapper/Jdbc2JavaTypeMapper.java  |  33 +
 .../DefaultConfigurationNameMapper.java |  66 +-
 .../org/apache/cayenne/dba/JdbcAdapter.java |  93 ++-
 .../java/org/apache/cayenne/map/DataMap.java|  35 +
 .../org/apache/cayenne/map/DbRelationship.java  |  21 +-
 .../java/org/apache/cayenne/map/ObjEntity.java  |  13 +-
 .../map/naming/DefaultUniqueNameGenerator.java  |   7 +-
 .../apache/cayenne/map/naming/NameCheckers.java |   6 +-
 .../org/apache/cayenne/merge/AddColumnToDb.java |  72 +-
 .../cayenne/merge/CreateTableToModel.java   |  20 +-
 .../java/org/apache/cayenne/merge/DbMerger.java |  91 +--
 .../apache/cayenne/merge/SetColumnTypeToDb.java |  68 +-
 .../apache/cayenne/util/EntityMergeSupport.java | 170 ++--
 .../org/apache/cayenne/access/DbLoaderIT.java   | 224 +-
 .../cayenne/access/DbLoaderPartialIT.java   |   1 +
 .../access/ManyToManyCandidateEntityTest.java   | 113 ---
 .../loader/ManyToManyCandidateEntityTest.java   | 113 +++
 .../access/loader/filters/DbPathTest.java   |  75 ++
 .../loader/filters/EntityFiltersTest.java   |  62 ++
 .../loader/filters/FiltersConfigTest.java   | 198 +
 .../access/loader/filters/FiltersFactory.java   |  44 +
 .../access/loader/mapper/DbTypeTest.java|  87 ++
 .../org/apache/cayenne/merge/MergeCase.java |   5 +-
 .../cayenne-relationship-optimisation.xml   |   4 -
 .../cayenne-relationship-optimisation.xml   |   4 +
 .../loader/relationship-optimisation.map.xml|  43 +
 .../access/relationship-optimisation.map.xml|  43 -
 cayenne-tools/pom.xml   |  26 +
 .../cayenne/gen/ClassGenerationAction.java  |   2 +-
 .../cayenne/gen/ClientDataMapArtifact.java  |  17 +-
 .../org/apache/cayenne/gen/DataMapArtifact.java |  13 +-
 .../map/naming/DefaultNameGenerator.java|  12 +-
 .../cayenne/tools/AntDataPortDelegate.java  |   7 +-
 .../CayenneGeneratorEntityFilterAction.java |  20 +-
 .../cayenne/tools/CayenneGeneratorTask.java |   6 +-
 .../apache/cayenne/tools/DbImporterTask.java| 182 +++--
 .../cayenne/tools/NamePatternMatcher.java   | 294 ---
 .../cayenne/tools/dbimport/DbImportAction.java  |  65 +-
 .../tools/dbimport/DbImportConfiguration.java   | 322 +++-
 .../tools/dbimport/config/AntNestedElement.java |  38 +
 .../cayenne/tools/dbimport/config/Catalog.java  |  82 ++
 .../config/DefaultReverseEngineeringLoader.java | 211 +
 .../config/DefaultTypeMapperBuilder.java|  82 ++
 .../tools/dbimport/config/ExcludeColumn.java|  31 +
 .../tools/dbimport/config/ExcludeProcedure.java |  31 +
 .../tools/dbimport/config/ExcludeTable.java |  31 +
 .../tools/dbimport/config/FilterContainer.java  | 109 +++
 .../dbimport/config/FiltersConfigBuilder.java   | 169 
 .../tools/dbimport/config/IncludeColumn.java|  31 +
 .../tools/dbimport/config/IncludeProcedure.java |  31 +
 .../tools/dbimport/config/IncludeTable.java |  77 ++
 .../tools/dbimport/config/PatternParam.java |  74 ++
 .../dbimport/config/R

Git Push Summary

2014-11-16 Thread aadamchik
Repository: cayenne
Updated Branches:
  refs/heads/CAY-1946 [deleted] 7c1f69a1a


[3/8] cayenne git commit: refactoring, cleanup

2014-11-16 Thread aadamchik
refactoring, cleanup

* cleanup cache key generation flow for SelectQuery
* do not generate cache key for null cache strategy


Project: http://git-wip-us.apache.org/repos/asf/cayenne/repo
Commit: http://git-wip-us.apache.org/repos/asf/cayenne/commit/8ed6a07b
Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/8ed6a07b
Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/8ed6a07b

Branch: refs/heads/CAY-1946
Commit: 8ed6a07b2720fdba06d06bc862b936c6eec56b1c
Parents: e787265
Author: aadamchik 
Authored: Sat Nov 15 12:58:07 2014 +0300
Committer: aadamchik 
Committed: Sat Nov 15 12:58:07 2014 +0300

--
 .../cayenne/query/SelectQueryMetadata.java  | 261 ++-
 .../org/apache/cayenne/query/SelectByIdIT.java  |  25 +-
 2 files changed, 147 insertions(+), 139 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cayenne/blob/8ed6a07b/cayenne-server/src/main/java/org/apache/cayenne/query/SelectQueryMetadata.java
--
diff --git 
a/cayenne-server/src/main/java/org/apache/cayenne/query/SelectQueryMetadata.java
 
b/cayenne-server/src/main/java/org/apache/cayenne/query/SelectQueryMetadata.java
index 0367ac4..a05c987 100644
--- 
a/cayenne-server/src/main/java/org/apache/cayenne/query/SelectQueryMetadata.java
+++ 
b/cayenne-server/src/main/java/org/apache/cayenne/query/SelectQueryMetadata.java
@@ -33,131 +33,138 @@ import org.apache.cayenne.map.ObjEntity;
  */
 class SelectQueryMetadata extends BaseQueryMetadata {
 
-Map pathSplitAliases;
-
-@Override
-void copyFromInfo(QueryMetadata info) {
-super.copyFromInfo(info);
-this.pathSplitAliases = new HashMap(info.getPathSplitAliases());
-}
-
- boolean resolve(Object root, EntityResolver resolver, SelectQuery 
query) {
-
-if (super.resolve(root, resolver, null)) {
-
-// generate unique cache key...
-if (QueryCacheStrategy.NO_CACHE == getCacheStrategy()) {
-
-} else {
-// create a unique key based on entity, qualifier, ordering and
-// fetch offset and limit
-
-StringBuilder key = new StringBuilder();
-
-ObjEntity entity = getObjEntity();
-if (entity != null) {
-key.append(entity.getName());
-} else if (dbEntity != null) {
-key.append("db:").append(dbEntity.getName());
-}
-
-if (query.getQualifier() != null) {
-key.append('/');
-try {
-query.getQualifier().appendAsString(key);
-} catch (IOException e) {
-throw new CayenneRuntimeException("Unexpected IO 
Exception appending to StringBuilder", e);
-}
-}
-
-if (!query.getOrderings().isEmpty()) {
-for (Ordering o : query.getOrderings()) {
-key.append('/').append(o.getSortSpecString());
-if (!o.isAscending()) {
-key.append(":d");
-}
-
-if (o.isCaseInsensitive()) {
-key.append(":i");
-}
-}
-}
-
-if (query.getFetchOffset() > 0 || query.getFetchLimit() > 0) {
-key.append('/');
-if (query.getFetchOffset() > 0) {
-key.append('o').append(query.getFetchOffset());
-}
-if (query.getFetchLimit() > 0) {
-key.append('l').append(query.getFetchLimit());
-}
-}
-
-this.cacheKey = key.toString();
-}
-
-resolveAutoAliases(query);
-
-return true;
-}
-
-return false;
-}
-
-private  void resolveAutoAliases(SelectQuery query) {
-Expression qualifier = query.getQualifier();
-if (qualifier != null) {
-resolveAutoAliases(qualifier);
-}
-
-// TODO: include aliases in prefetches? flattened attributes?
-}
-
-private void resolveAutoAliases(Expression expression) {
-Map aliases = expression.getPathAliases();
-if (!aliases.isEmpty()) {
-if (pathSplitAliases == null) {
-pathSplitAliases = new HashMap();
-}
-
-pathSplitAliases.putAll(aliases);
-}
-
-int len = expression.getOperandCount();
-for (int i = 0; i < len; i++) {
-Object operand = expression.getOperand(i);
-if (operand instanceof Expression) {
-resolveAutoAliases((Expression) operand);
-}
-}
-

[6/8] cayenne git commit: CAY-1959 Chainable API for SelectQuery

2014-11-16 Thread aadamchik
CAY-1959 Chainable API for SelectQuery


Project: http://git-wip-us.apache.org/repos/asf/cayenne/repo
Commit: http://git-wip-us.apache.org/repos/asf/cayenne/commit/a0f941a0
Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/a0f941a0
Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/a0f941a0

Branch: refs/heads/CAY-1946
Commit: a0f941a02bdc3320e38fd830983b5f034a4a306f
Parents: 5f7b6dd
Author: aadamchik 
Authored: Sat Nov 15 13:08:20 2014 +0300
Committer: aadamchik 
Committed: Sat Nov 15 13:25:11 2014 +0300

--
 .../java/org/apache/cayenne/exp/Property.java   |  19 +-
 .../apache/cayenne/query/BaseQueryMetadata.java |   2 +-
 .../org/apache/cayenne/query/ObjectSelect.java  | 668 ++
 .../java/org/apache/cayenne/query/Ordering.java | 696 ++-
 .../apache/cayenne/query/PrefetchTreeNode.java  |  15 +
 .../org/apache/cayenne/query/SelectQuery.java   |  10 +-
 .../cayenne/remote/IncrementalSelectQuery.java  |   5 +-
 .../apache/cayenne/query/ObjectSelectTest.java  | 482 +
 .../cayenne/query/ObjectSelect_CompileIT.java   | 168 +
 .../cayenne/query/ObjectSelect_RunIT.java   |  94 +++
 docs/doc/src/main/resources/RELEASE-NOTES.txt   |   1 +
 11 files changed, 1805 insertions(+), 355 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cayenne/blob/a0f941a0/cayenne-server/src/main/java/org/apache/cayenne/exp/Property.java
--
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/exp/Property.java 
b/cayenne-server/src/main/java/org/apache/cayenne/exp/Property.java
index 48f1549..b42e890 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/exp/Property.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/exp/Property.java
@@ -385,9 +385,7 @@ public class Property {
 * prefetch semantics.
 */
public PrefetchTreeNode joint() {
-   PrefetchTreeNode node = prefetch();
-   node.setSemantics(PrefetchTreeNode.JOINT_PREFETCH_SEMANTICS);
-   return node.getRoot();
+   return PrefetchTreeNode.withPath(name, 
PrefetchTreeNode.JOINT_PREFETCH_SEMANTICS);
}
 
/**
@@ -396,9 +394,7 @@ public class Property {
 * "disjoint" prefetch semantics.
 */
public PrefetchTreeNode disjoint() {
-   PrefetchTreeNode node = prefetch();
-   node.setSemantics(PrefetchTreeNode.DISJOINT_PREFETCH_SEMANTICS);
-   return node.getRoot();
+   return PrefetchTreeNode.withPath(name, 
PrefetchTreeNode.DISJOINT_PREFETCH_SEMANTICS);
}
 
/**
@@ -407,16 +403,7 @@ public class Property {
 * "disjoint by id" prefetch semantics.
 */
public PrefetchTreeNode disjointById() {
-   PrefetchTreeNode node = prefetch();
-   
node.setSemantics(PrefetchTreeNode.DISJOINT_BY_ID_PREFETCH_SEMANTICS);
-   return node.getRoot();
-   }
-
-   PrefetchTreeNode prefetch() {
-   PrefetchTreeNode root = new PrefetchTreeNode();
-   PrefetchTreeNode node = root.addPath(name);
-   node.setPhantom(false);
-   return node;
+   return PrefetchTreeNode.withPath(name, 
PrefetchTreeNode.DISJOINT_BY_ID_PREFETCH_SEMANTICS);
}
 
/**

http://git-wip-us.apache.org/repos/asf/cayenne/blob/a0f941a0/cayenne-server/src/main/java/org/apache/cayenne/query/BaseQueryMetadata.java
--
diff --git 
a/cayenne-server/src/main/java/org/apache/cayenne/query/BaseQueryMetadata.java 
b/cayenne-server/src/main/java/org/apache/cayenne/query/BaseQueryMetadata.java
index 1f17aac..d85b85a 100644
--- 
a/cayenne-server/src/main/java/org/apache/cayenne/query/BaseQueryMetadata.java
+++ 
b/cayenne-server/src/main/java/org/apache/cayenne/query/BaseQueryMetadata.java
@@ -44,7 +44,7 @@ import org.apache.cayenne.util.XMLSerializable;
 class BaseQueryMetadata implements QueryMetadata, XMLSerializable, 
Serializable {
 
private static final long serialVersionUID = 5129792493303459115L;
-   
+
int fetchLimit = QueryMetadata.FETCH_LIMIT_DEFAULT;
int fetchOffset = QueryMetadata.FETCH_OFFSET_DEFAULT;
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/a0f941a0/cayenne-server/src/main/java/org/apache/cayenne/query/ObjectSelect.java
--
diff --git 
a/cayenne-server/src/main/java/org/apache/cayenne/query/ObjectSelect.java 
b/cayenne-server/src/main/java/org/apache/cayenne/query/ObjectSelect.java
new file mode 100644
index 000..7618bcc
--- /dev/null
+++ b/cayenne-server/src/main/java/org/apache/cayenne/query/ObjectSelect.java
@@ -0,0 +1,668 @@
+/

[1/8] cayenne git commit: CAY-1968 SQLSelect cleanup and omissions

2014-11-16 Thread aadamchik
Repository: cayenne
Updated Branches:
  refs/heads/CAY-1946 29899e48d -> 7c1f69a1a


CAY-1968 SQLSelect cleanup and omissions

* also a unit test for SQLSelect


Project: http://git-wip-us.apache.org/repos/asf/cayenne/repo
Commit: http://git-wip-us.apache.org/repos/asf/cayenne/commit/f9c7d647
Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/f9c7d647
Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/f9c7d647

Branch: refs/heads/CAY-1946
Commit: f9c7d647c1f2b4add5132c78aa3fdb69ac79349f
Parents: cfbfb68
Author: aadamchik 
Authored: Sat Nov 15 11:10:47 2014 +0300
Committer: aadamchik 
Committed: Sat Nov 15 11:16:55 2014 +0300

--
 .../apache/cayenne/query/BaseQueryMetadata.java |  4 +-
 .../org/apache/cayenne/query/SQLSelect.java | 31 ---
 .../org/apache/cayenne/query/SQLSelectTest.java | 91 
 docs/doc/src/main/resources/RELEASE-NOTES.txt   |  1 +
 4 files changed, 115 insertions(+), 12 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cayenne/blob/f9c7d647/cayenne-server/src/main/java/org/apache/cayenne/query/BaseQueryMetadata.java
--
diff --git 
a/cayenne-server/src/main/java/org/apache/cayenne/query/BaseQueryMetadata.java 
b/cayenne-server/src/main/java/org/apache/cayenne/query/BaseQueryMetadata.java
index 7f7c6dd..af402b4 100644
--- 
a/cayenne-server/src/main/java/org/apache/cayenne/query/BaseQueryMetadata.java
+++ 
b/cayenne-server/src/main/java/org/apache/cayenne/query/BaseQueryMetadata.java
@@ -43,6 +43,8 @@ import org.apache.cayenne.util.XMLSerializable;
  */
 class BaseQueryMetadata implements QueryMetadata, XMLSerializable, 
Serializable {
 
+   private static final long serialVersionUID = 5129792493303459115L;
+   
int fetchLimit = QueryMetadata.FETCH_LIMIT_DEFAULT;
int fetchOffset = QueryMetadata.FETCH_OFFSET_DEFAULT;
 
@@ -156,7 +158,7 @@ class BaseQueryMetadata implements QueryMetadata, 
XMLSerializable, Serializable
void initWithProperties(Map properties) {
// must init defaults even if properties are empty
if (properties == null) {
-   properties = Collections.EMPTY_MAP;
+   properties = Collections.emptyMap();
}
 
Object fetchOffset = 
properties.get(QueryMetadata.FETCH_OFFSET_PROPERTY);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/f9c7d647/cayenne-server/src/main/java/org/apache/cayenne/query/SQLSelect.java
--
diff --git 
a/cayenne-server/src/main/java/org/apache/cayenne/query/SQLSelect.java 
b/cayenne-server/src/main/java/org/apache/cayenne/query/SQLSelect.java
index 5509cb4..b4504f4 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/query/SQLSelect.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/query/SQLSelect.java
@@ -19,6 +19,7 @@
 package org.apache.cayenne.query;
 
 import java.util.Arrays;
+import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
@@ -246,15 +247,14 @@ public class SQLSelect extends IndirectQuery 
implements Select {
 * running the query. This is a short-hand notation for:
 * 
 * 
-* query.setCacheStrategy(QueryCacheStrategy.LOCAL_CACHE);
-* query.setCacheGroups("group1", "group2");
+* query.cacheStrategy(QueryCacheStrategy.LOCAL_CACHE, cacheGroups);
 * 
-* 
-* @since 4.0
 */
-   public void useLocalCache(String... cacheGroups) {
+   public SQLSelect localCache(String... cacheGroups) {
cacheStrategy(QueryCacheStrategy.LOCAL_CACHE);
cacheGroups(cacheGroups);
+
+   return this;
}
 
/**
@@ -262,11 +262,10 @@ public class SQLSelect extends IndirectQuery 
implements Select {
 * running the query. This is a short-hand notation for:
 * 
 * 
-* query.setCacheStrategy(QueryCacheStrategy.SHARED_CACHE);
-* query.setCacheGroups("group1", "group2");
+* query.cacheStrategy(QueryCacheStrategy.SHARED_CACHE, cacheGroups);
 * 
 */
-   public SQLSelect useSharedCache(String... cacheGroups) {
+   public SQLSelect sharedCache(String... cacheGroups) {
return 
cacheStrategy(QueryCacheStrategy.SHARED_CACHE).cacheGroups(cacheGroups);
}
 
@@ -274,13 +273,13 @@ public class SQLSelect extends IndirectQuery 
implements Select {
return cacheStrategy;
}
 
-   public SQLSelect cacheStrategy(QueryCacheStrategy strategy) {
+   public SQLSelect cacheStrategy(QueryCacheStrategy strategy, 
String... cacheGroups) {
if (this.cacheStrategy != strategy) {
this.cacheS

[8/8] cayenne git commit: restoring master version of pom.xml

2014-11-16 Thread aadamchik
restoring master version of pom.xml


Project: http://git-wip-us.apache.org/repos/asf/cayenne/repo
Commit: http://git-wip-us.apache.org/repos/asf/cayenne/commit/7c1f69a1
Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/7c1f69a1
Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/7c1f69a1

Branch: refs/heads/CAY-1946
Commit: 7c1f69a1a0c15226ea90be3420e484665d54b1c0
Parents: 28f5793
Author: aadamchik 
Authored: Sun Nov 16 15:09:35 2014 +0300
Committer: aadamchik 
Committed: Sun Nov 16 15:09:35 2014 +0300

--
 pom.xml | 28 +++-
 1 file changed, 27 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cayenne/blob/7c1f69a1/pom.xml
--
diff --git a/pom.xml b/pom.xml
index 56334a2..d5c1f76 100644
--- a/pom.xml
+++ b/pom.xml
@@ -535,7 +535,7 @@
true


-   
+

install
 
@@ -676,6 +676,32 @@






+   

+   

+   
org.apache.maven.plugins
+   
maven-checkstyle-plugin
+   
[1.0,)
+   

+   
check
+   

+   

+   
+   

+   

+   

+   

+   

+   
org.apache.maven.plugins
+   
maven-pmd-plugin
+   
[1.0,)
+   

+   
check
+   

+   

+   
+   

+   

+   







[5/8] cayenne git commit: ensuring non-null cache strategy

2014-11-16 Thread aadamchik
ensuring non-null cache strategy


Project: http://git-wip-us.apache.org/repos/asf/cayenne/repo
Commit: http://git-wip-us.apache.org/repos/asf/cayenne/commit/5f7b6ddf
Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/5f7b6ddf
Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/5f7b6ddf

Branch: refs/heads/CAY-1946
Commit: 5f7b6ddf4abcd284d33251c6eabecbfd796445f5
Parents: 7c852a5
Author: aadamchik 
Authored: Sat Nov 15 13:05:58 2014 +0300
Committer: aadamchik 
Committed: Sat Nov 15 13:05:58 2014 +0300

--
 .../src/main/java/org/apache/cayenne/query/BaseQueryMetadata.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/cayenne/blob/5f7b6ddf/cayenne-server/src/main/java/org/apache/cayenne/query/BaseQueryMetadata.java
--
diff --git 
a/cayenne-server/src/main/java/org/apache/cayenne/query/BaseQueryMetadata.java 
b/cayenne-server/src/main/java/org/apache/cayenne/query/BaseQueryMetadata.java
index af402b4..1f17aac 100644
--- 
a/cayenne-server/src/main/java/org/apache/cayenne/query/BaseQueryMetadata.java
+++ 
b/cayenne-server/src/main/java/org/apache/cayenne/query/BaseQueryMetadata.java
@@ -333,7 +333,7 @@ class BaseQueryMetadata implements QueryMetadata, 
XMLSerializable, Serializable
 * @since 3.0
 */
void setCacheStrategy(QueryCacheStrategy cacheStrategy) {
-   this.cacheStrategy = cacheStrategy;
+   this.cacheStrategy = cacheStrategy != null ? cacheStrategy : 
QueryCacheStrategy.getDefaultStrategy();
}
 
/**



[4/8] cayenne git commit: unit test cleanup

2014-11-16 Thread aadamchik
unit test cleanup


Project: http://git-wip-us.apache.org/repos/asf/cayenne/repo
Commit: http://git-wip-us.apache.org/repos/asf/cayenne/commit/7c852a5a
Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/7c852a5a
Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/7c852a5a

Branch: refs/heads/CAY-1946
Commit: 7c852a5af9abce2f98432903de368f449e942f67
Parents: 8ed6a07
Author: aadamchik 
Authored: Sat Nov 15 12:59:23 2014 +0300
Committer: aadamchik 
Committed: Sat Nov 15 12:59:23 2014 +0300

--
 .../java/org/apache/cayenne/query/SelectByIdIT.java   | 14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cayenne/blob/7c852a5a/cayenne-server/src/test/java/org/apache/cayenne/query/SelectByIdIT.java
--
diff --git 
a/cayenne-server/src/test/java/org/apache/cayenne/query/SelectByIdIT.java 
b/cayenne-server/src/test/java/org/apache/cayenne/query/SelectByIdIT.java
index bd5a623..0c9cec7 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/query/SelectByIdIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/query/SelectByIdIT.java
@@ -22,6 +22,7 @@ import org.apache.cayenne.DataRow;
 import org.apache.cayenne.ObjectContext;
 import org.apache.cayenne.ObjectId;
 import org.apache.cayenne.di.Inject;
+import org.apache.cayenne.map.EntityResolver;
 import org.apache.cayenne.test.jdbc.DBHelper;
 import org.apache.cayenne.test.jdbc.TableHelper;
 import org.apache.cayenne.testdo.testmap.Artist;
@@ -52,6 +53,9 @@ public class SelectByIdIT extends ServerCase {
@Inject
private ObjectContext context;
 
+   @Inject
+   private EntityResolver resolver;
+
@Override
protected void setUpAfterInjection() throws Exception {
dbHelper.deleteAll("PAINTING_INFO");
@@ -129,13 +133,13 @@ public class SelectByIdIT extends ServerCase {
@Test
public void testMetadataCacheKey() throws Exception {
SelectById q1 = SelectById.query(Painting.class, 
4).useLocalCache();
-   QueryMetadata md1 = q1.getMetaData(context.getEntityResolver());
+   QueryMetadata md1 = q1.getMetaData(resolver);
assertNotNull(md1);
assertNotNull(md1.getCacheKey());
 
SelectById q2 = SelectById.query(Painting.class, 
singletonMap(Painting.PAINTING_ID_PK_COLUMN, 4))
.useLocalCache();
-   QueryMetadata md2 = q2.getMetaData(context.getEntityResolver());
+   QueryMetadata md2 = q2.getMetaData(resolver);
assertNotNull(md2);
assertNotNull(md2.getCacheKey());
 
@@ -144,20 +148,20 @@ public class SelectByIdIT extends ServerCase {
assertEquals(md1.getCacheKey(), md2.getCacheKey());
 
SelectById q3 = SelectById.query(Painting.class, 
5).useLocalCache();
-   QueryMetadata md3 = q3.getMetaData(context.getEntityResolver());
+   QueryMetadata md3 = q3.getMetaData(resolver);
assertNotNull(md3);
assertNotNull(md3.getCacheKey());
assertNotEquals(md1.getCacheKey(), md3.getCacheKey());
 
SelectById q4 = SelectById.query(Artist.class, 
4).useLocalCache();
-   QueryMetadata md4 = q4.getMetaData(context.getEntityResolver());
+   QueryMetadata md4 = q4.getMetaData(resolver);
assertNotNull(md4);
assertNotNull(md4.getCacheKey());
assertNotEquals(md1.getCacheKey(), md4.getCacheKey());
 
SelectById q5 = SelectById.query(Painting.class,
new ObjectId("Painting", 
Painting.PAINTING_ID_PK_COLUMN, 4)).useLocalCache();
-   QueryMetadata md5 = q5.getMetaData(context.getEntityResolver());
+   QueryMetadata md5 = q5.getMetaData(resolver);
assertNotNull(md5);
assertNotNull(md5.getCacheKey());
 



[7/8] cayenne git commit: Merge branch 'master' into CAY-1946

2014-11-16 Thread aadamchik
Merge branch 'master' into CAY-1946


Project: http://git-wip-us.apache.org/repos/asf/cayenne/repo
Commit: http://git-wip-us.apache.org/repos/asf/cayenne/commit/28f5793f
Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/28f5793f
Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/28f5793f

Branch: refs/heads/CAY-1946
Commit: 28f5793fbfd3890b55e638ca67ace936eb66ebc1
Parents: 29899e4 a0f941a
Author: aadamchik 
Authored: Sun Nov 16 15:02:16 2014 +0300
Committer: aadamchik 
Committed: Sun Nov 16 15:02:16 2014 +0300

--
 .../java/org/apache/cayenne/exp/Property.java   |  19 +-
 .../apache/cayenne/query/BaseQueryMetadata.java |   6 +-
 .../org/apache/cayenne/query/ObjectSelect.java  | 668 ++
 .../java/org/apache/cayenne/query/Ordering.java | 696 ++-
 .../apache/cayenne/query/PrefetchTreeNode.java  |  15 +
 .../org/apache/cayenne/query/SQLSelect.java |  31 +-
 .../org/apache/cayenne/query/SelectQuery.java   |  13 +-
 .../cayenne/query/SelectQueryMetadata.java  | 261 +++
 .../cayenne/remote/IncrementalSelectQuery.java  |   5 +-
 .../apache/cayenne/query/ObjectSelectTest.java  | 482 +
 .../cayenne/query/ObjectSelect_CompileIT.java   | 168 +
 .../cayenne/query/ObjectSelect_RunIT.java   |  94 +++
 .../org/apache/cayenne/query/SQLSelectTest.java |  91 +++
 .../org/apache/cayenne/query/SelectByIdIT.java  |  39 +-
 docs/doc/src/main/resources/RELEASE-NOTES.txt   |   2 +
 15 files changed, 2076 insertions(+), 514 deletions(-)
--




[2/8] cayenne git commit: undeprecating 'isFetchingDataRows' - at least the getter is still valid

2014-11-16 Thread aadamchik
undeprecating 'isFetchingDataRows' - at least the getter is still valid


Project: http://git-wip-us.apache.org/repos/asf/cayenne/repo
Commit: http://git-wip-us.apache.org/repos/asf/cayenne/commit/e787265f
Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/e787265f
Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/e787265f

Branch: refs/heads/CAY-1946
Commit: e787265f8964235a9b78ea75acd62d0c6ff59311
Parents: f9c7d64
Author: aadamchik 
Authored: Sat Nov 15 12:07:21 2014 +0300
Committer: aadamchik 
Committed: Sat Nov 15 12:07:21 2014 +0300

--
 .../src/main/java/org/apache/cayenne/query/SelectQuery.java   | 3 ---
 1 file changed, 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cayenne/blob/e787265f/cayenne-server/src/main/java/org/apache/cayenne/query/SelectQuery.java
--
diff --git 
a/cayenne-server/src/main/java/org/apache/cayenne/query/SelectQuery.java 
b/cayenne-server/src/main/java/org/apache/cayenne/query/SelectQuery.java
index b7a4fdf..80dba3f 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/query/SelectQuery.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/query/SelectQuery.java
@@ -621,9 +621,6 @@ public class SelectQuery extends AbstractQuery 
implements ParameterizedQuery,
 * Returns true if this query should produce a list of data
 * rows as opposed to DataObjects, false for DataObjects. 
This
 * is a hint to QueryEngine executing this query.
-* 
-* @deprecated since 4.0, use {@link #dataRowQuery(Class, Expression)} 
to
-* create DataRow query instead.
 */
public boolean isFetchingDataRows() {
return (root instanceof DbEntity) || 
metaData.isFetchingDataRows();



Build failed in Jenkins: cayenne-master » derby,jdk-1.8.0,Ubuntu #86

2014-11-16 Thread Apache Jenkins Server
See 


Changes:

[aadamchik] CAY-1946

--
[...truncated 44002 lines...]
  SelectQueryCacheKeyIT.testUseSharedCache » NoClassDefFound Could not 
initializ...
  SelectQueryCacheKeyIT.testUniqueKeyEntity » NoClassDefFound Could not 
initiali...
  SelectQueryCacheKeyIT.testNamedQuery » NoClassDefFound Could not initialize 
cl...
  SelectQueryCacheKeyIT.testSharedCache » NoClassDefFound Could not initialize 
c...
  SelectQueryCacheKeyIT.testLocalCache » NoClassDefFound Could not initialize 
cl...
  SelectQueryCacheKeyIT.testUniqueKeyEntityFetchLimit » NoClassDefFound Could 
no...
  SelectQueryCacheKeyIT.testNoCache » NoClassDefFound Could not initialize 
class...
  SelectQueryCacheKeyIT.testUniqueKeyEntityQualifier » NoClassDefFound Could 
not...
  SelectQueryCacheKeyIT.testUseLocalCache » NoClassDefFound Could not 
initialize...
  SelectQueryPrefetchRouterActionIT.testPrefetchPaintings2 » NoClassDefFound 
Cou...
  SelectQueryPrefetchRouterActionIT.testPaintings1 » NoClassDefFound Could not 
i...
  SelectQueryPrefetchRouterActionIT.testGalleries » NoClassDefFound Could not 
in...
  SelectQueryFetchLimitOrderingIT.testOrdering » NoClassDefFound Could not 
initi...
  SelectQueryPrefetchRouterActionQualifiedEntityIT.testPrefetchManager » 
NoClassDefFound
  SelectQueryPrefetchRouterActionQualifiedEntityIT.testPrefetchEmployee » 
NoClassDefFound
  SQLTemplateCacheKeyIT.testCacheFetchLimitAndOffset » NoClassDefFound Could 
not...
  SQLTemplateCacheKeyIT.testNamedQuery » NoClassDefFound Could not initialize 
cl...
  SQLTemplateCacheKeyIT.testSharedCache » NoClassDefFound Could not initialize 
c...
  SQLTemplateCacheKeyIT.testLocalCache » NoClassDefFound Could not initialize 
cl...
  SQLTemplateCacheKeyIT.testNoCache » NoClassDefFound Could not initialize 
class...
  SQLSelectIT.test_DataRows_FetchLimit » NoClassDefFound Could not initialize 
cl...
  SQLSelectIT.test_Append » NoClassDefFound Could not initialize class 
org.apach...
  SQLSelectIT.test_Select » NoClassDefFound Could not initialize class 
org.apach...
  SQLSelectIT.test_SelectLong » NoClassDefFound Could not initialize class 
org.a...
  SQLSelectIT.test_DataRows_DefaultRoot » NoClassDefFound Could not initialize 
c...
  SQLSelectIT.testSQLTemplate_PositionalParams » NoClassDefFound Could not 
initi...
  SQLSelectIT.test_DataRows_DataMapNameRoot » NoClassDefFound Could not 
initiali...
  SQLSelectIT.test_DataRows_ClassRoot_Bind » NoClassDefFound Could not 
initializ...
  SQLSelectIT.test_DataRows_ClassRoot » NoClassDefFound Could not initialize 
cla...
  SQLSelectIT.test_DataRows_FetchOffset » NoClassDefFound Could not initialize 
c...
  SQLSelectIT.test_SelectOne » NoClassDefFound Could not initialize class 
org.ap...
  SQLSelectIT.test_DataRows_ClassRoot_Parameters » NoClassDefFound Could not 
ini...
  SQLSelectIT.test_SelectLongArray » NoClassDefFound Could not initialize class 
...
  SQLSelectIT.test_DataRows_ColumnNameCaps » NoClassDefFound Could not 
initializ...
  SQLSelectIT.test_SelectCount » NoClassDefFound Could not initialize class 
org
  EJBQLQueryIT.testDataRows » NoClassDefFound Could not initialize class 
org.apa...
  EJBQLQueryIT.testNullAndNotNullParameter » NoClassDefFound Could not 
initializ...
  EJBQLQueryIT.testInWithSingleCollectionNamedParameter_withoutBrackets » 
NoClassDefFound
  EJBQLQueryIT.testUniqueKeyEntity » NoClassDefFound Could not initialize class 
...
  EJBQLQueryIT.testInWithMultipleStringPositionalParameters_withBrackets » 
NoClassDefFound
  EJBQLQueryIT.testJoinAndCount » NoClassDefFound Could not initialize class 
org...
  EJBQLQueryIT.testInWithSingleCollectionNamedParameter_withBrackets » 
NoClassDefFound
  EJBQLQueryIT.testInWithSingleCollectionPositionalParameter_withoutBrackets » 
NoClassDefFound
  EJBQLQueryIT.testInWithSingleCollectionPositionalParameter_withBrackets » 
NoClassDefFound
  EJBQLQueryIT.testSelectRelationship » NoClassDefFound Could not initialize 
cla...
  EJBQLQueryIT.testOrBrackets » NoClassDefFound Could not initialize class 
org.a...
  EJBQLQueryIT.testGetName » NoClassDefFound Could not initialize class 
org.apac...
  EJBQLQueryIT.testLikeWithExplicitEscape » NoClassDefFound Could not 
initialize...
  EJBQLQueryIT.testParameters » NoClassDefFound Could not initialize class 
org.a...
  EJBQLQueryIT.testGetExpression » NoClassDefFound Could not initialize class 
or...
  EJBQLQueryIT.testCacheParameters » NoClassDefFound Could not initialize class 
...
  EJBQLQueryIT.testRelationshipWhereClause2 » NoClassDefFound Could not 
initiali...
  EJBQLQueryIT.testNullPositionalParameter » NoClassDefFound Could not 
initializ...
  EJBQLQueryIT.testRelationshipWhereClause » NoClassDefFound Could not 
initializ...
  EJBQLQueryIT.testInWithSingleStringPositionalParameter_withoutBrackets » 
NoClassDefFound
  EJBQLQueryIT.testGetMetadata » NoClassDefFoun

cayenne git commit: CAY-1946

2014-11-16 Thread aadamchik
Repository: cayenne
Updated Branches:
  refs/heads/CAY-1946 66ea11873 -> 29899e48d


CAY-1946

* removing references to SmartNameGenerator


Project: http://git-wip-us.apache.org/repos/asf/cayenne/repo
Commit: http://git-wip-us.apache.org/repos/asf/cayenne/commit/29899e48
Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/29899e48
Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/29899e48

Branch: refs/heads/CAY-1946
Commit: 29899e48d36b88c6a5f9ea35ef3aa4359413ff65
Parents: 66ea118
Author: aadamchik 
Authored: Sun Nov 16 12:51:40 2014 +0300
Committer: aadamchik 
Committed: Sun Nov 16 12:51:40 2014 +0300

--
 .../apache/cayenne/map/naming/DefaultNameGenerator.java | 12 
 .../java/org/apache/cayenne/tools/DbImporterMojo.java   |  2 +-
 2 files changed, 5 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/cayenne/blob/29899e48/cayenne-tools/src/main/java/org/apache/cayenne/map/naming/DefaultNameGenerator.java
--
diff --git 
a/cayenne-tools/src/main/java/org/apache/cayenne/map/naming/DefaultNameGenerator.java
 
b/cayenne-tools/src/main/java/org/apache/cayenne/map/naming/DefaultNameGenerator.java
index 5d5a26d..af76188 100644
--- 
a/cayenne-tools/src/main/java/org/apache/cayenne/map/naming/DefaultNameGenerator.java
+++ 
b/cayenne-tools/src/main/java/org/apache/cayenne/map/naming/DefaultNameGenerator.java
@@ -26,8 +26,7 @@ import org.apache.cayenne.map.DbRelationship;
 import org.jvnet.inflector.Noun;
 
 /**
- * SmartNameGenerator is a strategy for generating names of entities, 
attributes
- * etc.
+ * A strategy for generating names of entities, attributes etc.
  * 
  * @since 4.0
  */
@@ -44,8 +43,7 @@ public class DefaultNameGenerator implements 
ObjectNameGenerator {
 * by default we use english language rules 
here. uppercase is
 * required for NameConverter to work properly
 */
-   name = 
Noun.pluralOf(key.getFKTableName().toLowerCase(),
-   Locale.ENGLISH).toUpperCase();
+   name = 
Noun.pluralOf(key.getFKTableName().toLowerCase(), Locale.ENGLISH).toUpperCase();
} catch (Exception inflectorError) {
/**
 * seems that Inflector cannot be trusted. For 
instance, it
@@ -61,11 +59,9 @@ public class DefaultNameGenerator implements 
ObjectNameGenerator {
// trim "ID" in the end
if (fkColName == null) {
name = key.getPKTableName();
-   } else if (fkColName.toUpperCase().endsWith("_ID")
-   && fkColName.length() > 3) {
+   } else if (fkColName.toUpperCase().endsWith("_ID") && 
fkColName.length() > 3) {
name = fkColName.substring(0, 
fkColName.length() - 3);
-   } else if (fkColName.toUpperCase().endsWith("ID")
-   && fkColName.length() > 2) {
+   } else if (fkColName.toUpperCase().endsWith("ID") && 
fkColName.length() > 2) {
name = fkColName.substring(0, 
fkColName.length() - 2);
} else {
/**

http://git-wip-us.apache.org/repos/asf/cayenne/blob/29899e48/plugins/maven-cayenne-plugin/src/main/java/org/apache/cayenne/tools/DbImporterMojo.java
--
diff --git 
a/plugins/maven-cayenne-plugin/src/main/java/org/apache/cayenne/tools/DbImporterMojo.java
 
b/plugins/maven-cayenne-plugin/src/main/java/org/apache/cayenne/tools/DbImporterMojo.java
index 1e07ca1..e429478 100644
--- 
a/plugins/maven-cayenne-plugin/src/main/java/org/apache/cayenne/tools/DbImporterMojo.java
+++ 
b/plugins/maven-cayenne-plugin/src/main/java/org/apache/cayenne/tools/DbImporterMojo.java
@@ -95,7 +95,7 @@ public class DbImporterMojo extends AbstractMojo {
  * The default is a basic naming strategy.
  * 
  * @parameter expression="${cdbimport.namingStrategy}"
- *
default-value="org.apache.cayenne.map.naming.SmartNameGenerator"
+ *
default-value="org.apache.cayenne.map.naming.DefaultNameGenerator"
  */
 private String namingStrategy;