You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by an...@apache.org on 2009/11/20 08:30:47 UTC
svn commit: r882430 - in /cayenne/main/trunk/framework:
cayenne-jdk1.5-unpublished/src/main/resources/dotemplates/v1_2/
cayenne-tools/src/main/java/org/apache/cayenne/gen/
cayenne-tools/src/main/resources/templates/
cayenne-tools/src/main/resources/tem...
Author: andrey
Date: Fri Nov 20 07:30:44 2009
New Revision: 882430
URL: http://svn.apache.org/viewvc?rev=882430&view=rev
Log:
renaming "dotemplates" to "templates" and moving them to cayenne-tools
Added:
cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/
cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/
cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/client-datamap-singleclass.vm
cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/client-datamap-subclass.vm
cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/client-datamap-superclass.vm
cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/client-subclass.vm (with props)
cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/client-superclass.vm (with props)
cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/datamap-singleclass.vm
cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/datamap-subclass.vm
cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/datamap-superclass.vm
cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/embeddable-singleclass.vm
cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/embeddable-subclass.vm
cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/embeddable-superclass.vm
cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/singleclass.vm (with props)
cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/subclass.vm (with props)
cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/superclass.vm (with props)
Removed:
cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/resources/dotemplates/v1_2/
Modified:
cayenne/main/trunk/framework/cayenne-tools/src/main/java/org/apache/cayenne/gen/ClassGenerationAction.java
cayenne/main/trunk/framework/cayenne-tools/src/main/java/org/apache/cayenne/gen/ClientClassGenerationAction.java
Modified: cayenne/main/trunk/framework/cayenne-tools/src/main/java/org/apache/cayenne/gen/ClassGenerationAction.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-tools/src/main/java/org/apache/cayenne/gen/ClassGenerationAction.java?rev=882430&r1=882429&r2=882430&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-tools/src/main/java/org/apache/cayenne/gen/ClassGenerationAction.java (original)
+++ cayenne/main/trunk/framework/cayenne-tools/src/main/java/org/apache/cayenne/gen/ClassGenerationAction.java Fri Nov 20 07:30:44 2009
@@ -29,10 +29,10 @@
import java.util.Properties;
import org.apache.cayenne.CayenneRuntimeException;
-import org.apache.cayenne.query.Query;
import org.apache.cayenne.map.DataMap;
import org.apache.cayenne.map.Embeddable;
import org.apache.cayenne.map.ObjEntity;
+import org.apache.cayenne.query.Query;
import org.apache.cayenne.tools.NamePatternMatcher;
import org.apache.commons.logging.Log;
import org.apache.velocity.Template;
@@ -45,18 +45,19 @@
* @since 3.0
*/
public class ClassGenerationAction {
+ static final String TEMPLATES_DIR_NAME = "templates/v1_2/";
- public static final String SINGLE_CLASS_TEMPLATE = "dotemplates/v1_2/singleclass.vm";
- public static final String SUBCLASS_TEMPLATE = "dotemplates/v1_2/subclass.vm";
- public static final String SUPERCLASS_TEMPLATE = "dotemplates/v1_2/superclass.vm";
-
- public static final String EMBEDDABLE_SINGLE_CLASS_TEMPLATE = "dotemplates/v1_2/embeddable-singleclass.vm";
- public static final String EMBEDDABLE_SUBCLASS_TEMPLATE = "dotemplates/v1_2/embeddable-subclass.vm";
- public static final String EMBEDDABLE_SUPERCLASS_TEMPLATE = "dotemplates/v1_2/embeddable-superclass.vm";
-
- public static final String DATAMAP_SINGLE_CLASS_TEMPLATE = "dotemplates/v1_2/datamap-singleclass.vm";
- public static final String DATAMAP_SUBCLASS_TEMPLATE = "dotemplates/v1_2/datamap-subclass.vm";
- public static final String DATAMAP_SUPERCLASS_TEMPLATE = "dotemplates/v1_2/datamap-superclass.vm";
+ public static final String SINGLE_CLASS_TEMPLATE = TEMPLATES_DIR_NAME + "singleclass.vm";
+ public static final String SUBCLASS_TEMPLATE = TEMPLATES_DIR_NAME + "subclass.vm";
+ public static final String SUPERCLASS_TEMPLATE = TEMPLATES_DIR_NAME + "superclass.vm";
+
+ public static final String EMBEDDABLE_SINGLE_CLASS_TEMPLATE = TEMPLATES_DIR_NAME + "embeddable-singleclass.vm";
+ public static final String EMBEDDABLE_SUBCLASS_TEMPLATE = TEMPLATES_DIR_NAME + "embeddable-subclass.vm";
+ public static final String EMBEDDABLE_SUPERCLASS_TEMPLATE = TEMPLATES_DIR_NAME + "embeddable-superclass.vm";
+
+ public static final String DATAMAP_SINGLE_CLASS_TEMPLATE = TEMPLATES_DIR_NAME + "datamap-singleclass.vm";
+ public static final String DATAMAP_SUBCLASS_TEMPLATE = TEMPLATES_DIR_NAME + "datamap-subclass.vm";
+ public static final String DATAMAP_SUPERCLASS_TEMPLATE = TEMPLATES_DIR_NAME + "datamap-superclass.vm";
public static final String SUPERCLASS_PREFIX = "_";
private static final String WILDCARD = "*";
Modified: cayenne/main/trunk/framework/cayenne-tools/src/main/java/org/apache/cayenne/gen/ClientClassGenerationAction.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-tools/src/main/java/org/apache/cayenne/gen/ClientClassGenerationAction.java?rev=882430&r1=882429&r2=882430&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-tools/src/main/java/org/apache/cayenne/gen/ClientClassGenerationAction.java (original)
+++ cayenne/main/trunk/framework/cayenne-tools/src/main/java/org/apache/cayenne/gen/ClientClassGenerationAction.java Fri Nov 20 07:30:44 2009
@@ -28,12 +28,12 @@
*/
public class ClientClassGenerationAction extends ClassGenerationAction {
- public static final String SUBCLASS_TEMPLATE = "dotemplates/v1_2/client-subclass.vm";
- public static final String SUPERCLASS_TEMPLATE = "dotemplates/v1_2/client-superclass.vm";
+ public static final String SUBCLASS_TEMPLATE = TEMPLATES_DIR_NAME + "client-subclass.vm";
+ public static final String SUPERCLASS_TEMPLATE = TEMPLATES_DIR_NAME + "client-superclass.vm";
- public static final String DMAP_SINGLE_CLASS_TEMPLATE = "dotemplates/v1_2/client-datamap-singleclass.vm";
- public static final String DMAP_SUBCLASS_TEMPLATE = "dotemplates/v1_2/client-datamap-subclass.vm";
- public static final String DMAP_SUPERCLASS_TEMPLATE = "dotemplates/v1_2/client-datamap-superclass.vm";
+ public static final String DMAP_SINGLE_CLASS_TEMPLATE = TEMPLATES_DIR_NAME + "client-datamap-singleclass.vm";
+ public static final String DMAP_SUBCLASS_TEMPLATE = TEMPLATES_DIR_NAME + "client-datamap-subclass.vm";
+ public static final String DMAP_SUPERCLASS_TEMPLATE = TEMPLATES_DIR_NAME + "client-datamap-superclass.vm";
public static final String CLIENT_SUPERCLASS_PREFIX = "_Client";
Added: cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/client-datamap-singleclass.vm
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/client-datamap-singleclass.vm?rev=882430&view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/client-datamap-singleclass.vm (added)
+++ cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/client-datamap-singleclass.vm Fri Nov 20 07:30:44 2009
@@ -0,0 +1,96 @@
+## 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.
+##
+##Terminology:
+## Base class - super superclass of entity, ie, org.apache.cayenne.CayenneDataObject or MyBaseClass
+## Super class - superclass of entity, ie, org.apache.cayenne.art.auto._Artist
+## Sub class - class of entity, ie, org.apache.cayenne.art.Artist
+##
+## Classes available in template
+## object (duplicated as 'objEntity') - the ObjEntity class: See org.apache.cayenne.map.ObjectEntity
+## stringUtils - class for string "helper" functions: See org.apache.cayenne.gen.StringUtils
+## dataMapUtils - class for query "helper" functions: See org.apache.cayenne.gen.DataMapUtils
+## importUtils - class for import statement management: See org.apache.cayenne.gen.ImportUtils
+## superClassName
+## superPackageName
+## subClassName
+## subPackageName
+## baseClassName
+## basePackageName
+##
+##
+${importUtils.setPackage($subPackageName)}##
+${importUtils.addReservedType("${subPackageName}.${subClassName}")}##
+${importUtils.addType("${basePackageName}.${baseClassName}")}##
+${importUtils.addType('java.util.List')}
+${importUtils.addType('java.util.Map')}
+${importUtils.addType('java.util.HashMap')}
+${importUtils.addType('org.apache.cayenne.ObjectContext')}
+#foreach( $selectQuery in ${object.SelectQueries})
+${importUtils.addType(${selectQuery.Root.ClassName})}
+#foreach( $parameter in ${dataMapUtils.getParameterNames(${selectQuery})})
+${importUtils.addType(${dataMapUtils.getParameterType(${selectQuery}, ${parameter})})}
+#end
+#end
+${importUtils.generate()}
+
+/**
+ * This class was generated by Cayenne.
+ * It is probably a good idea to avoid changing this class manually,
+ * since it may be overwritten next time code is regenerated.
+ * If you need to make any customizations, please use subclass.
+ */
+public class ${subClassName} {
+#if( ${object.hasQueryNames()})
+#foreach( $qname in ${object.QueryNames})
+
+ public static final String ${stringUtils.capitalizedAsConstant($qname)}_QUERYNAME = "$qname";
+#end
+#end
+
+private static ${subClassName} instance;
+
+ private ${subClassName}() {}
+
+ public ${subClassName} getInstance() {
+ if( instance == null) {
+ instance = new ${subClassName}();
+ }
+ return instance;
+ }
+
+#foreach( $selectQuery in ${object.SelectQueries})
+ public List<${stringUtils.stripPackageName($selectQuery.Root.ClassName)}> perform${dataMapUtils.getQueryMethodName(${selectQuery})}(ObjectContext context #foreach( $parameter in ${dataMapUtils.getParameterNames(${selectQuery})}), ${stringUtils.stripPackageName(${dataMapUtils.getParameterType(${selectQuery}, ${parameter})})} ${parameter} #end) {
+ #if(${dataMapUtils.hasParameters($selectQuery)})
+ String[] parameters = new String[] {
+ #foreach( $parameter in ${dataMapUtils.getParameterNames(${selectQuery})})
+ "${parameter}",
+ #end
+ };
+
+ Object[] values = new Object[] {
+ #foreach( $parameter in ${dataMapUtils.getParameterNames(${selectQuery})})
+ ${parameter},
+ #end
+ };
+ #end
+
+ NamedQuery query = new NamedQuery("${selectQuery.Name}"#if(${dataMapUtils.hasParameters($selectQuery)}), parameters, values#end);
+ return context.performQuery(query);
+ }
+#end
+}
Added: cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/client-datamap-subclass.vm
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/client-datamap-subclass.vm?rev=882430&view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/client-datamap-subclass.vm (added)
+++ cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/client-datamap-subclass.vm Fri Nov 20 07:30:44 2009
@@ -0,0 +1,47 @@
+## 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.
+##
+##Terminology:
+## Base class - super superclass of entity, ie, org.apache.cayenne.CayenneDataObject or MyBaseClass
+## Super class - superclass of entity, ie, org.apache.cayenne.art.auto._Artist
+## Sub class - class of entity, ie, org.apache.cayenne.art.Artist
+##
+## Classes available in template
+## stringUtils - class for string "helper" functions: See org.apache.cayenne.gen.StringUtils
+## dataMapUtils - class for query "helper" functions: See org.apache.cayenne.gen.dataMapUtils
+## importUtils - class for import statement management: See org.apache.cayenne.gen.ImportUtils
+##
+##
+${importUtils.setPackage($subPackageName)}##
+${importUtils.addReservedType("${subPackageName}.${subClassName}")}##
+${importUtils.addType("${superPackageName}.${superClassName}")}##
+${importUtils.generate()}
+
+public class ${subClassName} extends ${superClassName} {
+
+ private static ${subClassName} instance;
+
+ private ${subClassName}() {}
+
+ public static ${subClassName} getInstance() {
+ if(instance == null) {
+ instance = new ${subClassName}();
+ }
+
+ return instance;
+ }
+}
Added: cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/client-datamap-superclass.vm
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/client-datamap-superclass.vm?rev=882430&view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/client-datamap-superclass.vm (added)
+++ cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/client-datamap-superclass.vm Fri Nov 20 07:30:44 2009
@@ -0,0 +1,83 @@
+## 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.
+##
+##Terminology:
+## Base class - super superclass of entity, ie, org.apache.cayenne.CayenneDataObject or MyBaseClass
+## Super class - superclass of entity, ie, org.apache.cayenne.art.auto._Artist
+## Sub class - class of entity, ie, org.apache.cayenne.art.Artist
+##
+## Classes available in template
+## stringUtils - class for string "helper" functions: See org.apache.cayenne.gen.StringUtils
+## dataMapUtils - class for query "helper" functions: See org.apache.cayenne.gen.DataMapUtils
+## importUtils - class for import statement management: See org.apache.cayenne.gen.ImportUtils
+## superClassName
+## superPackageName
+## subClassName
+## subPackageName
+## baseClassName
+## basePackageName
+##
+${importUtils.setPackage($superPackageName)}##
+${importUtils.addReservedType("${superPackageName}.${superClassName}")}##
+${importUtils.addType("${basePackageName}.${baseClassName}")}##
+#if( ${object.hasSelectQueries()} )
+${importUtils.addType('java.util.List')}##
+${importUtils.addType('org.apache.cayenne.ObjectContext')}##
+${importUtils.addType('org.apache.cayenne.query.NamedQuery')}##
+#foreach( $selectQuery in ${object.SelectQueries})
+${importUtils.addType(${selectQuery.Root.ClientClassName})}##
+#foreach( $parameter in ${dataMapUtils.getParameterNames(${selectQuery})})
+${importUtils.addType(${dataMapUtils.getParameterType(${selectQuery}, ${parameter})})}##
+#end
+#end
+#end
+${importUtils.generate()}
+
+/**
+ * This class was generated by Cayenne.
+ * It is probably a good idea to avoid changing this class manually,
+ * since it may be overwritten next time code is regenerated.
+ * If you need to make any customizations, please use subclass.
+ */
+public class ${superClassName} {
+#if( ${object.hasQueryNames()})
+#foreach( $qname in ${object.QueryNames})
+
+ public static final String ${stringUtils.capitalizedAsConstant($qname)}_QUERYNAME = "$qname";
+#end
+#end
+#foreach( $selectQuery in ${object.SelectQueries})
+
+ public List<${stringUtils.stripPackageName($selectQuery.Root.ClientClassName)}> perform${dataMapUtils.getQueryMethodName(${selectQuery})}(ObjectContext context #foreach( $parameter in ${dataMapUtils.getParameterNames(${selectQuery})}), ${stringUtils.stripPackageName(${dataMapUtils.getParameterType(${selectQuery}, ${parameter})})} ${parameter}#end) {
+#if(${dataMapUtils.hasParameters($selectQuery)})
+ String[] parameters = {
+#foreach( $parameter in ${dataMapUtils.getParameterNames(${selectQuery})})
+ "${parameter}",
+#end
+ };
+
+ Object[] values = {
+#foreach( $parameter in ${dataMapUtils.getParameterNames(${selectQuery})})
+ ${parameter},
+#end
+ };
+
+#end
+ return context.performQuery(new NamedQuery("${selectQuery.Name}"#if(${dataMapUtils.hasParameters($selectQuery)}), parameters, values#end));
+ }
+#end
+}
Added: cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/client-subclass.vm
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/client-subclass.vm?rev=882430&view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/client-subclass.vm (added)
+++ cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/client-subclass.vm Fri Nov 20 07:30:44 2009
@@ -0,0 +1,55 @@
+## 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.
+##
+## A default Cayenne template for a client-side subclass in a generated subclass/superclass pair.
+##
+## Terminology:
+## Base class - super superclass of entity, ie, org.apache.cayenne.CayenneDataObject or MyBaseClass
+## Super class - superclass of entity, ie, org.apache.cayenne.art.auto._Artist
+## Sub class - class of entity, ie, org.apache.cayenne.art.Artist
+##
+## Classes available in template
+## object (duplicated as 'objEntity') - the ObjEntity class: See org.apache.cayenne.map.ObjectEntity
+## stringUtils - class for string "helper" functions: See org.apache.cayenne.gen.StringUtils
+## entityUtils - class for entity "helper" functions: See org.apache.cayenne.gen.EntityUtils
+## importUtils - class for import statement management: See org.apache.cayenne.gen.ImportUtils
+## superClassName
+## superPackageName
+## subClassName
+## subPackageName
+## baseClassName
+## basePackageName
+##
+${importUtils.setPackage($subPackageName)}##
+${importUtils.addReservedType("${$subPackageName}.${subClassName}")}##
+${importUtils.addType("${superPackageName}.${superClassName}")}##
+${importUtils.generate()}
+
+/**
+ * A persistent class mapped as "${object.name}" Cayenne entity.
+ */
+public#if("true" == "${object.getIsAbstract()}") abstract#end class ${subClassName} extends ${superClassName} {
+
+##callback methods
+#foreach( $cbname in ${entityUtils.callbackNames})
+ @Override
+ protected void ${cbname}() {
+ //TODO: Implement ${cbname}
+ }
+
+#end
+}
Propchange: cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/client-subclass.vm
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/client-subclass.vm
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/client-superclass.vm
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/client-superclass.vm?rev=882430&view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/client-superclass.vm (added)
+++ cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/client-superclass.vm Fri Nov 20 07:30:44 2009
@@ -0,0 +1,194 @@
+## 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.
+##
+##Terminology:
+## Base class - super superclass of entity, ie, org.apache.cayenne.PersistentObject or MyBaseClass
+## Super class - superclass of entity, ie, org.apache.cayenne.art.auto._Artist
+## Sub class - class of entity, ie, org.apache.cayenne.art.Artist
+##
+## Classes available in template
+## object (duplicated as 'objEntity') - the ObjEntity class: See org.apache.cayenne.map.ObjectEntity
+## stringUtils - class for string "helper" functions: See org.apache.cayenne.gen.StringUtils
+## entityUtils - class for entity "helper" functions: See org.apache.cayenne.gen.EntityUtils
+## importUtils - class for import statement management: See org.apache.cayenne.gen.ImportUtils
+## superClassName
+## superPackageName
+## subClassName
+## subPackageName
+## baseClassName
+## basePackageName
+##
+##
+${importUtils.setPackage($superPackageName)}##
+${importUtils.addReservedType("${$superPackageName}.${superClassName}")}##
+${importUtils.addType("${basePackageName}.${baseClassName}")}##
+#foreach( $attr in ${object.DeclaredAttributes} )
+$importUtils.addType(${attr.Type})##
+#end
+#foreach( $rel in ${object.DeclaredRelationships} )
+$importUtils.addType(${rel.TargetEntity.ClientClassName})##
+#if(${rel.CollectionType})
+$importUtils.addType(${rel.CollectionType})##
+#end
+#end
+#if( ${entityUtils.hasToOneDeclaredRelationships()} )
+${importUtils.addType('org.apache.cayenne.ValueHolder')}##
+#end
+${importUtils.generate()}
+
+/**
+ * A generated persistent class mapped as "${object.name}" Cayenne entity. It is a good idea to
+ * avoid changing this class manually, since it will be overwritten next time code is
+ * regenerated. If you need to make any customizations, put them in a subclass.
+ */
+public abstract class ${superClassName} extends ${baseClassName} {
+
+## Create ivars names
+#foreach( $attr in ${object.DeclaredAttributes} )
+ public static final String ${stringUtils.capitalizedAsConstant($attr.Name)}_PROPERTY = "${attr.Name}";
+#end
+#foreach( $rel in ${object.DeclaredRelationships} )
+ public static final String ${stringUtils.capitalizedAsConstant($rel.Name)}_PROPERTY = "${rel.Name}";
+#end
+
+## Create ivars
+#foreach( $attr in ${object.DeclaredAttributes} )
+ protected $importUtils.formatJavaType(${attr.Type}) ${attr.Name};
+#end
+#foreach( $rel in ${object.DeclaredRelationships} )
+#if( $rel.ToMany )
+#if ( ${rel.CollectionType} == "java.util.Map")
+ protected $importUtils.formatJavaType($rel.CollectionType)<$importUtils.formatJavaType($entityUtils.getMapKeyType($rel)), $importUtils.formatJavaType($rel.TargetEntity.ClientClassName)> ${rel.Name};
+#else
+ protected $importUtils.formatJavaType($rel.CollectionType)<$importUtils.formatJavaType($rel.TargetEntity.ClientClassName)> ${rel.Name};
+#end
+#else
+ protected ValueHolder ${rel.Name};
+#end
+#end
+
+## Create attribute set/get methods
+#foreach( $attr in ${object.DeclaredAttributes} )
+#if ( $importUtils.isBoolean(${attr.Type}) )
+ public boolean is${stringUtils.capitalized($attr.Name)}() {
+ if(objectContext != null) {
+ objectContext.prepareForAccess(this, "${attr.Name}", false);
+ }
+
+ return ${attr.Name};
+ }
+#else
+ public $importUtils.formatJavaType(${attr.Type}) get${stringUtils.capitalized($attr.Name)}() {
+ if(objectContext != null) {
+ objectContext.prepareForAccess(this, "${attr.Name}", false);
+ }
+
+ return ${attr.Name};
+ }
+#end
+#if ("true" != "${object.isReadOnly()}")
+ public void set${stringUtils.capitalized($attr.Name)}($importUtils.formatJavaType(${attr.Type}) $stringUtils.formatVariableName(${attr.Name})) {
+ if(objectContext != null) {
+ objectContext.prepareForAccess(this, "${attr.Name}", false);
+ }
+
+ Object oldValue = this.${stringUtils.formatVariableName($attr.Name)};
+ this.${stringUtils.formatVariableName($attr.Name)} = ${stringUtils.formatVariableName($attr.Name)};
+
+ // notify objectContext about simple property change
+ if(objectContext != null) {
+ objectContext.propertyChanged(this, "${attr.Name}", oldValue, ${stringUtils.formatVariableName($attr.Name)});
+ }
+ }
+#end
+
+#end
+##
+##
+## Create list add/remove/get methods
+#foreach( $rel in ${object.DeclaredRelationships} )
+#if( $rel.ToMany )
+#if ( ${rel.CollectionType} == "java.util.Map")
+ public $importUtils.formatJavaType($rel.CollectionType)<$importUtils.formatJavaType($entityUtils.getMapKeyType($rel)), $importUtils.formatJavaType($rel.TargetEntity.ClientClassName)> get${stringUtils.capitalized($rel.Name)}() {
+#else
+ public $importUtils.formatJavaType($rel.CollectionType)<$importUtils.formatJavaType($rel.TargetEntity.ClientClassName)> get${stringUtils.capitalized($rel.Name)}() {
+#end
+ if(objectContext != null) {
+ objectContext.prepareForAccess(this, "${rel.Name}", true);
+ }
+
+ return ${rel.Name};
+ }
+#if ( ! $rel.ReadOnly )
+#if ( ${rel.CollectionType} == "java.util.Map")
+ public void addTo${stringUtils.capitalized($rel.Name)}($importUtils.formatJavaType(${rel.TargetEntity.ClientClassName}) object) {
+ if(objectContext != null) {
+ objectContext.prepareForAccess(this, "${rel.Name}", true);
+ }
+
+ this.${rel.Name}.put(getMapKey("${rel.Name}", object), object);
+ }
+ public void removeFrom${stringUtils.capitalized($rel.Name)}($importUtils.formatJavaType(${rel.TargetEntity.ClientClassName}) object) {
+ if(objectContext != null) {
+ objectContext.prepareForAccess(this, "${rel.Name}", true);
+ }
+
+ this.${rel.Name}.remove(getMapKey("${rel.Name}", object));
+ }
+#else
+ public void addTo${stringUtils.capitalized($rel.Name)}($importUtils.formatJavaType(${rel.TargetEntity.ClientClassName}) object) {
+ if(objectContext != null) {
+ objectContext.prepareForAccess(this, "${rel.Name}", true);
+ }
+
+ this.${rel.Name}.add(object);
+ }
+ public void removeFrom${stringUtils.capitalized($rel.Name)}($importUtils.formatJavaType(${rel.TargetEntity.ClientClassName}) object) {
+ if(objectContext != null) {
+ objectContext.prepareForAccess(this, "${rel.Name}", true);
+ }
+
+ this.${rel.Name}.remove(object);
+ }
+#end
+#end
+#else
+ public $importUtils.formatJavaType(${rel.TargetEntity.ClientClassName}) get${stringUtils.capitalized($rel.Name)}() {
+ if(objectContext != null) {
+ objectContext.prepareForAccess(this, "${rel.Name}", true);
+ }
+
+ return ($importUtils.formatJavaType(${rel.TargetEntity.ClientClassName})) ${rel.Name}.getValue();
+ }
+#if ( !${object.isReadOnly()} && !$rel.ReadOnly )
+ public void set${stringUtils.capitalized($rel.Name)}(${importUtils.formatJavaType($rel.TargetEntity.ClientClassName)} $stringUtils.formatVariableName(${rel.Name})) {
+ if(objectContext != null) {
+ objectContext.prepareForAccess(this, "${rel.Name}", true);
+ }
+
+ this.${stringUtils.formatVariableName($rel.Name)}.setValue(${stringUtils.formatVariableName($rel.Name)});
+ }
+#end
+#end
+
+#end
+##callback methods
+#foreach( $cbname in ${entityUtils.callbackNames})
+ protected abstract void ${cbname}();
+
+#end
+}
Propchange: cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/client-superclass.vm
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/client-superclass.vm
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/datamap-singleclass.vm
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/datamap-singleclass.vm?rev=882430&view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/datamap-singleclass.vm (added)
+++ cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/datamap-singleclass.vm Fri Nov 20 07:30:44 2009
@@ -0,0 +1,96 @@
+## 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.
+##
+##Terminology:
+## Base class - super superclass of entity, ie, org.apache.cayenne.CayenneDataObject or MyBaseClass
+## Super class - superclass of entity, ie, org.apache.cayenne.art.auto._Artist
+## Sub class - class of entity, ie, org.apache.cayenne.art.Artist
+##
+## Classes available in template
+## object (duplicated as 'objEntity') - the ObjEntity class: See org.apache.cayenne.map.ObjectEntity
+## stringUtils - class for string "helper" functions: See org.apache.cayenne.gen.StringUtils
+## dataMapUtils - class for query "helper" functions: See org.apache.cayenne.gen.DataMapUtils
+## importUtils - class for import statement management: See org.apache.cayenne.gen.ImportUtils
+## superClassName
+## superPackageName
+## subClassName
+## subPackageName
+## baseClassName
+## basePackageName
+##
+##
+${importUtils.setPackage($subPackageName)}##
+${importUtils.addReservedType("${subPackageName}.${subClassName}")}##
+${importUtils.addType("${basePackageName}.${baseClassName}")}##
+${importUtils.addType('java.util.List')}
+${importUtils.addType('java.util.Map')}
+${importUtils.addType('java.util.HashMap')}
+${importUtils.addType('org.apache.cayenne.ObjectContext')}
+#foreach( $selectQuery in ${object.SelectQueries})
+${importUtils.addType(${selectQuery.Root.ClassName})}
+#foreach( $parameter in ${dataMapUtils.getParameterNames(${selectQuery})})
+${importUtils.addType(${dataMapUtils.getParameterType(${selectQuery}, ${parameter})})}
+#end
+#end
+${importUtils.generate()}
+
+/**
+ * This class was generated by Cayenne.
+ * It is probably a good idea to avoid changing this class manually,
+ * since it may be overwritten next time code is regenerated.
+ * If you need to make any customizations, please use subclass.
+ */
+public class ${subClassName} {
+#if( ${object.hasQueryNames()})
+#foreach( $qname in ${object.QueryNames})
+
+public static final String ${stringUtils.capitalizedAsConstant($qname)}_QUERYNAME = "$qname";
+#end
+#end
+
+ private static ${subClassName} instance;
+
+ private ${subClassName}() {}
+
+ public ${subClassName} getInstance() {
+ if( instance == null) {
+ instance = new ${subClassName}();
+ }
+ return instance;
+ }
+
+#foreach( $selectQuery in ${object.SelectQueries})
+ public List<${stringUtils.stripPackageName($selectQuery.Root.ClassName)}> perform${dataMapUtils.getQueryMethodName(${selectQuery})}(ObjectContext context #foreach( $parameter in ${dataMapUtils.getParameterNames(${selectQuery})}), ${stringUtils.stripPackageName(${dataMapUtils.getParameterType(${selectQuery}, ${parameter})})} ${parameter} #end) {
+ #if(${dataMapUtils.hasParameters($selectQuery)})
+ String[] parameters = new String[] {
+ #foreach( $parameter in ${dataMapUtils.getParameterNames(${selectQuery})})
+ "${parameter}",
+ #end
+ };
+
+ Object[] values = new Object[] {
+ #foreach( $parameter in ${dataMapUtils.getParameterNames(${selectQuery})})
+ ${parameter},
+ #end
+ };
+ #end
+
+ NamedQuery query = new NamedQuery("${selectQuery.Name}"#if(${dataMapUtils.hasParameters($selectQuery)}), parameters, values#end);
+ return context.performQuery(query);
+ }
+#end
+}
Added: cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/datamap-subclass.vm
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/datamap-subclass.vm?rev=882430&view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/datamap-subclass.vm (added)
+++ cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/datamap-subclass.vm Fri Nov 20 07:30:44 2009
@@ -0,0 +1,47 @@
+## 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.
+##
+##Terminology:
+## Base class - super superclass of entity, ie, org.apache.cayenne.CayenneDataObject or MyBaseClass
+## Super class - superclass of entity, ie, org.apache.cayenne.art.auto._Artist
+## Sub class - class of entity, ie, org.apache.cayenne.art.Artist
+##
+## Classes available in template
+## stringUtils - class for string "helper" functions: See org.apache.cayenne.gen.StringUtils
+## dataMapUtils - class for query "helper" functions: See org.apache.cayenne.gen.dataMapUtils
+## importUtils - class for import statement management: See org.apache.cayenne.gen.ImportUtils
+##
+##
+${importUtils.setPackage($subPackageName)}##
+${importUtils.addReservedType("${subPackageName}.${subClassName}")}##
+${importUtils.addType("${superPackageName}.${superClassName}")}##
+${importUtils.generate()}
+
+public class ${subClassName} extends ${superClassName} {
+
+ private static ${subClassName} instance;
+
+ private ${subClassName}() {}
+
+ public static ${subClassName} getInstance() {
+ if(instance == null) {
+ instance = new ${subClassName}();
+ }
+
+ return instance;
+ }
+}
Added: cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/datamap-superclass.vm
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/datamap-superclass.vm?rev=882430&view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/datamap-superclass.vm (added)
+++ cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/datamap-superclass.vm Fri Nov 20 07:30:44 2009
@@ -0,0 +1,83 @@
+## 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.
+##
+##Terminology:
+## Base class - super superclass of entity, ie, org.apache.cayenne.CayenneDataObject or MyBaseClass
+## Super class - superclass of entity, ie, org.apache.cayenne.art.auto._Artist
+## Sub class - class of entity, ie, org.apache.cayenne.art.Artist
+##
+## Classes available in template
+## stringUtils - class for string "helper" functions: See org.apache.cayenne.gen.StringUtils
+## dataMapUtils - class for query "helper" functions: See org.apache.cayenne.gen.DataMapUtils
+## importUtils - class for import statement management: See org.apache.cayenne.gen.ImportUtils
+## superClassName
+## superPackageName
+## subClassName
+## subPackageName
+## baseClassName
+## basePackageName
+##
+${importUtils.setPackage($superPackageName)}##
+${importUtils.addReservedType("${superPackageName}.${superClassName}")}##
+${importUtils.addType("${basePackageName}.${baseClassName}")}##
+#if( ${object.hasSelectQueries()} )
+${importUtils.addType('java.util.List')}##
+${importUtils.addType('org.apache.cayenne.ObjectContext')}##
+${importUtils.addType('org.apache.cayenne.query.NamedQuery')}##
+#foreach( $selectQuery in ${object.SelectQueries})
+${importUtils.addType(${selectQuery.Root.ClassName})}##
+#foreach( $parameter in ${dataMapUtils.getParameterNames(${selectQuery})})
+${importUtils.addType(${dataMapUtils.getParameterType(${selectQuery}, ${parameter})})}##
+#end
+#end
+#end
+${importUtils.generate()}
+
+/**
+ * This class was generated by Cayenne.
+ * It is probably a good idea to avoid changing this class manually,
+ * since it may be overwritten next time code is regenerated.
+ * If you need to make any customizations, please use subclass.
+ */
+public class ${superClassName} {
+#if( ${object.hasQueryNames()})
+#foreach( $qname in ${object.queryNames})
+
+ public static final String ${stringUtils.capitalizedAsConstant($qname)}_QUERYNAME = "$qname";
+#end
+#end
+#foreach( $selectQuery in ${object.SelectQueries})
+
+ public List<${stringUtils.stripPackageName($selectQuery.Root.ClassName)}> perform${dataMapUtils.getQueryMethodName(${selectQuery})}(ObjectContext context #foreach( $parameter in ${dataMapUtils.getParameterNames(${selectQuery})}), ${stringUtils.stripPackageName(${dataMapUtils.getParameterType(${selectQuery}, ${parameter})})} ${parameter}#end) {
+#if(${dataMapUtils.hasParameters($selectQuery)})
+ String[] parameters = {
+#foreach( $parameter in ${dataMapUtils.getParameterNames(${selectQuery})})
+ "${parameter}",
+#end
+ };
+
+ Object[] values = {
+#foreach( $parameter in ${dataMapUtils.getParameterNames(${selectQuery})})
+ ${parameter},
+#end
+ };
+
+#end
+ return context.performQuery(new NamedQuery("${selectQuery.Name}"#if(${dataMapUtils.hasParameters($selectQuery)}), parameters, values#end));
+ }
+#end
+}
\ No newline at end of file
Added: cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/embeddable-singleclass.vm
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/embeddable-singleclass.vm?rev=882430&view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/embeddable-singleclass.vm (added)
+++ cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/embeddable-singleclass.vm Fri Nov 20 07:30:44 2009
@@ -0,0 +1,95 @@
+## 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.
+##
+## Terminology:
+##
+## Base class - super superclass of embeddable, usually java.lang.Object
+## Super class - superclass of embeddable, ie, org.apache.cayenne.art.auto._Embeddable
+## Sub class - class of entity, ie, org.apache.cayenne.art.Embeddable
+##
+## Keys of objects available in template are defined in 'org.apache.cayenne.gen.Artifact', namely:
+##
+## object - the Embeddable class: See org.apache.cayenne.map.Embeddable
+## stringUtils - class for string "helper" functions: See org.apache.cayenne.gen.StringUtils
+## importUtils - class for import statement management: See org.apache.cayenne.gen.ImportUtils
+## superClassName
+## superPackageName
+## subClassName
+## subPackageName
+## baseClassName
+## basePackageName
+##
+##
+${importUtils.setPackage($subPackageName)}##
+${importUtils.addReservedType("${subPackageName}.${subClassName}")}##
+${importUtils.addType("${basePackageName}.${baseClassName}")}##
+${importUtils.addType("org.apache.cayenne.Persistent")}##
+#foreach( $attr in ${object.Attributes} )
+$importUtils.addType(${attr.Type})##
+#end
+${importUtils.generate()}
+
+public abstract class ${subClassName} extends ${baseClassName} {
+
+## Create property names
+#foreach( $attr in ${object.Attributes} )
+ public static final String ${stringUtils.capitalizedAsConstant($attr.Name)}_PROPERTY = "${attr.Name}";
+#end
+
+ // special properties injected by Cayenne
+ private Persistent owner;
+ private String embeddedProperty;
+
+ // declared properties
+#foreach( $attr in ${object.Attributes} )
+ protected $importUtils.formatJavaType(${attr.Type}) $stringUtils.formatVariableName(${attr.Name});
+#end
+
+ // lifecycle methods
+ protected void propertyWillChange(String property, Object oldValue, Object newValue) {
+ if (owner != null && owner.getObjectContext() != null) {
+ owner.getObjectContext().propertyChanged(
+ owner,
+ embeddedProperty + "." + property,
+ oldValue,
+ newValue);
+ }
+ }
+
+ // declared getters and setters
+## Create attribute set/get methods
+#foreach( $attr in ${object.Attributes} )
+ public void set${stringUtils.capitalized($attr.Name)}($importUtils.formatJavaType(${attr.Type}) $stringUtils.formatVariableName(${attr.Name})) {
+ propertyWillChange("${attr.Name}", this.$stringUtils.formatVariableName(${attr.Name}), $stringUtils.formatVariableName(${attr.Name}));
+ this.$stringUtils.formatVariableName(${attr.Name}) = $stringUtils.formatVariableName(${attr.Name});
+ }
+#if ( $importUtils.isBoolean(${attr.Type}) )
+ public boolean is${stringUtils.capitalized($attr.Name)}() {
+ return $stringUtils.formatVariableName(${attr.Name});
+ }
+#elseif ( $importUtils.isNonBooleanPrimitive(${attr.Type}) )
+ public $classGen.formatJavaType(${attr.Type}) get${stringUtils.capitalized($attr.Name)}() {
+ return $stringUtils.formatVariableName(${attr.Name});
+ }
+#else
+ public $importUtils.formatJavaType(${attr.Type}) get${stringUtils.capitalized($attr.Name)}() {
+ return $stringUtils.formatVariableName(${attr.Name});
+ }
+#end
+
+#end
+}
Added: cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/embeddable-subclass.vm
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/embeddable-subclass.vm?rev=882430&view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/embeddable-subclass.vm (added)
+++ cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/embeddable-subclass.vm Fri Nov 20 07:30:44 2009
@@ -0,0 +1,45 @@
+## 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.
+##
+## Terminology:
+##
+## Base class - super superclass of embeddable, usually java.lang.Object
+## Super class - superclass of embeddable, ie, org.apache.cayenne.art.auto._Embeddable
+## Sub class - class of entity, ie, org.apache.cayenne.art.Embeddable
+##
+## Keys of objects available in template are defined in 'org.apache.cayenne.gen.Artifact', namely:
+##
+## object - the Embeddable class: See org.apache.cayenne.map.Embeddable
+## stringUtils - class for string "helper" functions: See org.apache.cayenne.gen.StringUtils
+## importUtils - class for import statement management: See org.apache.cayenne.gen.ImportUtils
+## superClassName
+## superPackageName
+## subClassName
+## subPackageName
+## baseClassName
+## basePackageName
+##
+##
+${importUtils.setPackage($subPackageName)}##
+${importUtils.addReservedType("${subPackageName}.${subClassName}")}##
+${importUtils.addType("${superPackageName}.${superClassName}")}##
+${importUtils.generate()}
+
+
+public#if("true" == "${object.getIsAbstract()}") abstract#end class ${subClassName} extends ${superClassName} {
+
+}
\ No newline at end of file
Added: cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/embeddable-superclass.vm
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/embeddable-superclass.vm?rev=882430&view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/embeddable-superclass.vm (added)
+++ cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/embeddable-superclass.vm Fri Nov 20 07:30:44 2009
@@ -0,0 +1,101 @@
+## 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.
+##
+## Terminology:
+##
+## Base class - super superclass of embeddable, usually java.lang.Object
+## Super class - superclass of embeddable, ie, org.apache.cayenne.art.auto._Embeddable
+## Sub class - class of entity, ie, org.apache.cayenne.art.Embeddable
+##
+## Keys of objects available in template are defined in 'org.apache.cayenne.gen.Artifact', namely:
+##
+## object - the Embeddable class: See org.apache.cayenne.map.Embeddable
+## stringUtils - class for string "helper" functions: See org.apache.cayenne.gen.StringUtils
+## importUtils - class for import statement management: See org.apache.cayenne.gen.ImportUtils
+## superClassName
+## superPackageName
+## subClassName
+## subPackageName
+## baseClassName
+## basePackageName
+##
+##
+${importUtils.setPackage($superPackageName)}##
+${importUtils.addReservedType("${superPackageName}.${superClassName}")}##
+${importUtils.addType("${basePackageName}.${baseClassName}")}##
+${importUtils.addType("org.apache.cayenne.Persistent")}##
+#foreach( $attr in ${object.Attributes} )
+$importUtils.addType(${attr.Type})##
+#end
+${importUtils.generate()}
+
+/**
+ * Embeddable class ${superClassName} was generated by Cayenne.
+ * It is probably a good idea to avoid changing this class manually,
+ * since it may be overwritten next time code is regenerated.
+ * If you need to make any customizations, please use subclass.
+ */
+public abstract class ${superClassName} extends ${baseClassName} {
+
+## Create property names
+#foreach( $attr in ${object.Attributes} )
+ public static final String ${stringUtils.capitalizedAsConstant($attr.Name)}_PROPERTY = "${attr.Name}";
+#end
+
+ // special properties injected by Cayenne
+ private Persistent owner;
+ private String embeddedProperty;
+
+ // declared properties
+#foreach( $attr in ${object.Attributes} )
+ protected $importUtils.formatJavaType(${attr.Type}) $stringUtils.formatVariableName(${attr.Name});
+#end
+
+ // lifecycle methods
+ protected void propertyWillChange(String property, Object oldValue, Object newValue) {
+ if (owner != null && owner.getObjectContext() != null) {
+ owner.getObjectContext().propertyChanged(
+ owner,
+ embeddedProperty + "." + property,
+ oldValue,
+ newValue);
+ }
+ }
+
+ // declared getters and setters
+## Create attribute set/get methods
+#foreach( $attr in ${object.Attributes} )
+ public void set${stringUtils.capitalized($attr.Name)}($importUtils.formatJavaType(${attr.Type}) $stringUtils.formatVariableName(${attr.Name})) {
+ propertyWillChange("${attr.Name}", this.$stringUtils.formatVariableName(${attr.Name}), $stringUtils.formatVariableName(${attr.Name}));
+ this.$stringUtils.formatVariableName(${attr.Name}) = $stringUtils.formatVariableName(${attr.Name});
+ }
+#if ( $importUtils.isBoolean(${attr.Type}) )
+ public boolean is${stringUtils.capitalized($attr.Name)}() {
+ return $stringUtils.formatVariableName(${attr.Name});
+ }
+#elseif ( $importUtils.isNonBooleanPrimitive(${attr.Type}) )
+ public $classGen.formatJavaType(${attr.Type}) get${stringUtils.capitalized($attr.Name)}() {
+ return $stringUtils.formatVariableName(${attr.Name});
+ }
+#else
+ public $importUtils.formatJavaType(${attr.Type}) get${stringUtils.capitalized($attr.Name)}() {
+ return $stringUtils.formatVariableName(${attr.Name});
+ }
+#end
+
+#end
+}
Added: cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/singleclass.vm
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/singleclass.vm?rev=882430&view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/singleclass.vm (added)
+++ cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/singleclass.vm Fri Nov 20 07:30:44 2009
@@ -0,0 +1,120 @@
+## 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.
+##
+##Terminology:
+## Base class - super superclass of entity, ie, org.apache.cayenne.CayenneDataObject or MyBaseClass
+## Super class - superclass of entity, ie, org.apache.cayenne.art.auto._Artist
+## Sub class - class of entity, ie, org.apache.cayenne.art.Artist
+##
+## Classes available in template
+## object (duplicated as 'objEntity') - the ObjEntity class: See org.apache.cayenne.map.ObjectEntity
+## stringUtils - class for string "helper" functions: See org.apache.cayenne.gen.StringUtils
+## entityUtils - class for entity "helper" functions: See org.apache.cayenne.gen.EntityUtils
+## importUtils - class for import statement management: See org.apache.cayenne.gen.ImportUtils
+## superClassName
+## superPackageName
+## subClassName
+## subPackageName
+## baseClassName
+## basePackageName
+##
+##
+${importUtils.setPackage($subPackageName)}##
+${importUtils.addReservedType("${subPackageName}.${subClassName}")}##
+${importUtils.addType("${basePackageName}.${baseClassName}")}##
+#foreach( $attr in ${object.DeclaredAttributes} )
+$importUtils.addType(${attr.Type})##
+#end
+#foreach( $rel in ${object.DeclaredRelationships} )
+$importUtils.addType(${rel.TargetEntity.ClassName})##
+#if(${rel.CollectionType})
+$importUtils.addType(${rel.CollectionType})##
+#end
+#end
+${importUtils.generate()}
+
+public#if("true" == "${object.getIsAbstract()}") abstract#end class ${subClassName} extends ${baseClassName} {
+
+## Create property names
+#foreach( $attr in ${object.DeclaredAttributes} )
+ public static final String ${stringUtils.capitalizedAsConstant($attr.Name)}_PROPERTY = "${attr.Name}";
+#end
+#foreach( $rel in ${object.DeclaredRelationships} )
+ public static final String ${stringUtils.capitalizedAsConstant($rel.Name)}_PROPERTY = "${rel.Name}";
+#end
+
+#if( $object.DbEntity )
+#foreach( $idAttr in ${object.DbEntity.PrimaryKey} )
+ public static final String ${stringUtils.capitalizedAsConstant($idAttr.Name)}_PK_COLUMN = "${idAttr.Name}";
+#end
+#end
+
+## Create attribute set/get methods
+#foreach( $attr in ${object.DeclaredAttributes} )
+#if ("true" != "${object.isReadOnly()}")
+ public void set${stringUtils.capitalized($attr.Name)}($importUtils.formatJavaType(${attr.Type}) $stringUtils.formatVariableName(${attr.Name})) {
+ writeProperty("${attr.Name}", $stringUtils.formatVariableName(${attr.Name}));
+ }
+#end
+#if ( $importUtils.isBoolean(${attr.Type}) )
+ public boolean is${stringUtils.capitalized($attr.Name)}() {
+ Boolean value = (Boolean)readProperty("${attr.Name}");
+ return (value != null) ? value.booleanValue() : false;
+ }
+#elseif ( $importUtils.isNonBooleanPrimitive(${attr.Type}) )
+ public ${importUtils.formatJavaType($attr.Type)} get${stringUtils.capitalized($attr.Name)}() {
+ Object value = readProperty("${attr.Name}");
+ return (value != null) ? ($importUtils.formatJavaTypeAsNonBooleanPrimitive(${attr.Type})) value : 0;
+ }
+#else
+ public $importUtils.formatJavaType(${attr.Type}) get${stringUtils.capitalized($attr.Name)}() {
+ return ($importUtils.formatJavaType(${attr.Type}))readProperty("${attr.Name}");
+ }
+#end
+
+#end
+##
+## Create list add/remove/get methods
+#foreach( $rel in ${object.DeclaredRelationships} )
+#if( $rel.ToMany )
+#if ( ! $rel.ReadOnly ) public void addTo${stringUtils.capitalized($rel.Name)}($importUtils.formatJavaType(${rel.TargetEntity.ClassName}) obj) {
+ addToManyTarget("${rel.name}", obj, true);
+ }
+ public void removeFrom${stringUtils.capitalized($rel.Name)}($importUtils.formatJavaType(${rel.TargetEntity.ClassName}) obj) {
+ removeToManyTarget("${rel.name}", obj, true);
+ }
+#end
+ public $importUtils.formatJavaType($rel.CollectionType) get${stringUtils.capitalized($rel.Name)}() {
+ return ($importUtils.formatJavaType($rel.CollectionType))readProperty("${rel.name}");
+ }
+#else
+#if ( ! ${object.isReadOnly()} && ! $rel.ReadOnly )
+ public void set${stringUtils.capitalized($rel.Name)}($importUtils.formatJavaType(${rel.TargetEntity.ClassName}) $stringUtils.formatVariableName(${rel.name})) {
+ setToOneTarget("${rel.name}", $stringUtils.formatVariableName(${rel.name}), true);
+ }
+#end
+ public $importUtils.formatJavaType(${rel.TargetEntity.ClassName}) get${stringUtils.capitalized($rel.Name)}() {
+ return ($importUtils.formatJavaType(${rel.TargetEntity.ClassName}))readProperty("${rel.name}");
+ }
+#end
+
+
+#end
+}
+
+
+
Propchange: cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/singleclass.vm
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/singleclass.vm
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/subclass.vm
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/subclass.vm?rev=882430&view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/subclass.vm (added)
+++ cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/subclass.vm Fri Nov 20 07:30:44 2009
@@ -0,0 +1,45 @@
+## 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.
+##
+##Terminology:
+## Base class - super superclass of entity, ie, org.apache.cayenne.CayenneDataObject or MyBaseClass
+## Super class - superclass of entity, ie, org.apache.cayenne.art.auto._Artist
+## Sub class - class of entity, ie, org.apache.cayenne.art.Artist
+##
+## Classes available in template
+## objEntity - the ObjEntity class: See org.apache.cayenne.map.ObjectEntity
+## stringUtils - class for string "helper" functions: See org.apache.cayenne.gen.StringUtils
+## entityUtils - class for entity "helper" functions: See org.apache.cayenne.gen.EntityUtils
+## importUtils - class for import statement management: See org.apache.cayenne.gen.ImportUtils
+##
+##
+${importUtils.setPackage($subPackageName)}##
+${importUtils.addReservedType("${subPackageName}.${subClassName}")}##
+${importUtils.addType("${superPackageName}.${superClassName}")}##
+${importUtils.generate()}
+
+public#if("true" == "${object.getIsAbstract()}") abstract#end class ${subClassName} extends ${superClassName} {
+
+##callbacks
+#foreach($cbname in ${entityUtils.callbackNames})
+ @Override
+ protected void ${cbname}() {
+ //TODO: implement ${cbname}
+ }
+
+#end
+}
Propchange: cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/subclass.vm
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/subclass.vm
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/superclass.vm
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/superclass.vm?rev=882430&view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/superclass.vm (added)
+++ cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/superclass.vm Fri Nov 20 07:30:44 2009
@@ -0,0 +1,137 @@
+## 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.
+##
+##Terminology:
+## Base class - super superclass of entity, ie, org.apache.cayenne.CayenneDataObject or MyBaseClass
+## Super class - superclass of entity, ie, org.apache.cayenne.art.auto._Artist
+## Sub class - class of entity, ie, org.apache.cayenne.art.Artist
+##
+## Classes available in template
+## object (duplicated as 'objEntity') - the ObjEntity class: See org.apache.cayenne.map.ObjectEntity
+## stringUtils - class for string "helper" functions: See org.apache.cayenne.gen.StringUtils
+## entityUtils - class for entity "helper" functions: See org.apache.cayenne.gen.EntityUtils
+## importUtils - class for import statement management: See org.apache.cayenne.gen.ImportUtils
+## superClassName
+## superPackageName
+## subClassName
+## subPackageName
+## baseClassName
+## basePackageName
+##
+${importUtils.setPackage($superPackageName)}##
+${importUtils.addReservedType("${superPackageName}.${superClassName}")}##
+${importUtils.addType("${basePackageName}.${baseClassName}")}##
+#foreach( $attr in ${object.DeclaredAttributes} )
+$importUtils.addType(${attr.Type})##
+#end
+#foreach( $rel in ${object.DeclaredRelationships} )
+$importUtils.addType(${rel.TargetEntity.ClassName})##
+#if(${rel.CollectionType})
+$importUtils.addType(${rel.CollectionType})##
+#end
+#end
+${importUtils.generate()}
+
+/**
+ * Class ${superClassName} was generated by Cayenne.
+ * It is probably a good idea to avoid changing this class manually,
+ * since it may be overwritten next time code is regenerated.
+ * If you need to make any customizations, please use subclass.
+ */
+public abstract class ${superClassName} extends ${baseClassName} {
+
+## Create property names
+#foreach( $attr in ${object.DeclaredAttributes} )
+ public static final String ${stringUtils.capitalizedAsConstant($attr.Name)}_PROPERTY = "${attr.Name}";
+#end
+#foreach( $rel in ${object.DeclaredRelationships} )
+ public static final String ${stringUtils.capitalizedAsConstant($rel.Name)}_PROPERTY = "${rel.Name}";
+#end
+
+#if( $object.DbEntity )
+#foreach( $idAttr in ${object.DbEntity.PrimaryKey} )
+ public static final String ${stringUtils.capitalizedAsConstant($idAttr.Name)}_PK_COLUMN = "${idAttr.Name}";
+#end
+#end
+
+## Create attribute set/get methods
+#foreach( $attr in ${object.DeclaredAttributes} )
+#if ("true" != "${object.isReadOnly()}")
+ public void set${stringUtils.capitalized($attr.Name)}($importUtils.formatJavaType(${attr.Type}) $stringUtils.formatVariableName(${attr.Name})) {
+ writeProperty("${attr.Name}", $stringUtils.formatVariableName(${attr.Name}));
+ }
+#end
+#if ( $importUtils.isBoolean(${attr.Type}) )
+ public boolean is${stringUtils.capitalized($attr.Name)}() {
+ Boolean value = (Boolean)readProperty("${attr.Name}");
+ return (value != null) ? value.booleanValue() : false;
+ }
+#elseif ( $importUtils.isNonBooleanPrimitive(${attr.Type}) )
+ public ${importUtils.formatJavaType($attr.Type)} get${stringUtils.capitalized($attr.Name)}() {
+ Object value = readProperty("${attr.Name}");
+ return (value != null) ? ($importUtils.formatJavaTypeAsNonBooleanPrimitive(${attr.Type})) value : 0;
+ }
+#else
+ public $importUtils.formatJavaType(${attr.Type}) get${stringUtils.capitalized($attr.Name)}() {
+ return ($importUtils.formatJavaType(${attr.Type}))readProperty("${attr.Name}");
+ }
+#end
+
+#end
+##
+## Create list add/remove/get methods
+#foreach( $rel in ${object.DeclaredRelationships} )
+#if( $rel.ToMany )
+#if ( ! $rel.ReadOnly )
+ public void addTo${stringUtils.capitalized($rel.Name)}($importUtils.formatJavaType(${rel.TargetEntity.ClassName}) obj) {
+ addToManyTarget("${rel.name}", obj, true);
+ }
+ public void removeFrom${stringUtils.capitalized($rel.Name)}($importUtils.formatJavaType(${rel.TargetEntity.ClassName}) obj) {
+ removeToManyTarget("${rel.name}", obj, true);
+ }
+#end
+ @SuppressWarnings("unchecked")
+#if ( ${rel.CollectionType} == "java.util.Map")
+ public $importUtils.formatJavaType($rel.CollectionType)<$importUtils.formatJavaType($entityUtils.getMapKeyType($rel)), $importUtils.formatJavaType($rel.TargetEntity.ClassName)> get${stringUtils.capitalized($rel.Name)}() {
+ return ($importUtils.formatJavaType($rel.CollectionType)<$importUtils.formatJavaType($entityUtils.getMapKeyType($rel)), $importUtils.formatJavaType($rel.TargetEntity.ClassName)>)readProperty("${rel.name}");
+ }
+#else
+ public $importUtils.formatJavaType($rel.CollectionType)<$importUtils.formatJavaType($rel.TargetEntity.ClassName)> get${stringUtils.capitalized($rel.Name)}() {
+ return ($importUtils.formatJavaType($rel.CollectionType)<$importUtils.formatJavaType($rel.TargetEntity.ClassName)>)readProperty("${rel.name}");
+ }
+#end
+#else
+#if ( !${object.isReadOnly()} && !$rel.ReadOnly )
+ public void set${stringUtils.capitalized($rel.Name)}($importUtils.formatJavaType(${rel.TargetEntity.ClassName}) $stringUtils.formatVariableName(${rel.name})) {
+ setToOneTarget("${rel.name}", $stringUtils.formatVariableName(${rel.name}), true);
+ }
+#end
+
+ public $importUtils.formatJavaType(${rel.TargetEntity.ClassName}) get${stringUtils.capitalized($rel.Name)}() {
+ return ($importUtils.formatJavaType(${rel.TargetEntity.ClassName}))readProperty("${rel.name}");
+ }
+#end
+
+
+#end
+##
+##callback methods
+#foreach($cbname in ${entityUtils.callbackNames})
+ protected abstract void ${cbname}();
+
+#end
+}
Propchange: cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/superclass.vm
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cayenne/main/trunk/framework/cayenne-tools/src/main/resources/templates/v1_2/superclass.vm
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision