Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkmoore2009-04-17 13:48:59 +0000
committerkmoore2009-04-17 13:48:59 +0000
commitefdb5990fbe9478740f476421611ec12eab80ae8 (patch)
treed7341182e3a1bbf6561ce2526d24d54573171a89 /jpa/plugins/org.eclipse.jpt.gen/templates
parent74db39207e51a501e622d194bcf50b42f7ffb15f (diff)
downloadwebtools.dali-efdb5990fbe9478740f476421611ec12eab80ae8.tar.gz
webtools.dali-efdb5990fbe9478740f476421611ec12eab80ae8.tar.xz
webtools.dali-efdb5990fbe9478740f476421611ec12eab80ae8.zip
268552 - patch from Danny Ju - Entity Generation - fully qualified class names generated
Diffstat (limited to 'jpa/plugins/org.eclipse.jpt.gen/templates')
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/templates/entities/join.vm3
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/templates/entities/main.java.vm14
2 files changed, 9 insertions, 8 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.gen/templates/entities/join.vm b/jpa/plugins/org.eclipse.jpt.gen/templates/entities/join.vm
index f52a4b7178..8e211d3584 100644
--- a/jpa/plugins/org.eclipse.jpt.gen/templates/entities/join.vm
+++ b/jpa/plugins/org.eclipse.jpt.gen/templates/entities/join.vm
@@ -26,9 +26,6 @@
#set ($joinTable = $role.association.joinTable)
@JoinTable(
name="${joinTable.joinTableAnnotationName}"
-#if ($joinTable.schema!="")
- , schema="${joinTable.schema}"
-#end
, joinColumns={
#foreach ($column in $role.referrerColumns)
#set ($referencedColumn = $role.getReferencedColumn(${column.name}))
diff --git a/jpa/plugins/org.eclipse.jpt.gen/templates/entities/main.java.vm b/jpa/plugins/org.eclipse.jpt.gen/templates/entities/main.java.vm
index d9e399aadd..6f50a76f48 100644
--- a/jpa/plugins/org.eclipse.jpt.gen/templates/entities/main.java.vm
+++ b/jpa/plugins/org.eclipse.jpt.gen/templates/entities/main.java.vm
@@ -4,6 +4,7 @@ package ${table.package};
import java.io.Serializable;
import javax.persistence.*;
+${table.importStatements}
/**
* The persistent class for the ${table.name} database table.
@@ -31,7 +32,7 @@ public class ${table.className} ${table.generateExtendsImplements()} {
#parse("mappingKind.vm")
#parse("column.vm")
#end
- ${column.fieldScope} ${column.propertyType} ${column.propertyName};
+ ${column.fieldScope} ${column.simplePropertyType} ${column.propertyName};
#end
#foreach ($role in $table.associationRoles)
#####
@@ -56,7 +57,7 @@ public class ${table.className} ${table.generateExtendsImplements()} {
#if ($role.cardinality == "many-to-one" || $role.cardinality == "one-to-one")
#set ($propertyType = ${role.referencedTable.className})
#elseif ($role.cardinality == "many-to-many" || $role.cardinality == "one-to-many")
-#set ($propertyType = "${role.referencedTable.defaultCollectionType}<${role.referencedTable.className}>")
+#set ($propertyType = "${role.referencedTable.simpleCollectionType}<${role.referencedTable.className}>")
#end
private $propertyType $role.propertyName;
#end
@@ -69,6 +70,7 @@ public class ${table.className} ${table.generateExtendsImplements()} {
#####
#if ($table.compositeKey)
#if ($table.access == "property")
+
@EmbeddedId
#end
public $table.compositeKeyClassName $customizer.propertyGetter($table.compositeKeyPropertyName)() {
@@ -82,14 +84,15 @@ public class ${table.className} ${table.generateExtendsImplements()} {
#end
#foreach ($column in $table.getSimpleColumns(true, true, false))
#if ($table.access == "property")
+
#parse("mappingKind.vm")
#parse("column.vm")
#end
- $column.propertyGetScope $column.propertyType $customizer.propertyGetter($column.propertyName)() {
+ $column.propertyGetScope $column.simplePropertyType $customizer.propertyGetter($column.propertyName)() {
return this.${column.propertyName};
}
- $column.propertySetScope void $customizer.propertySetter($column.propertyName)($column.propertyType $column.propertyName) {
+ $column.propertySetScope void $customizer.propertySetter($column.propertyName)($column.simplePropertyType $column.propertyName) {
this.${column.propertyName} = ${column.propertyName};
}
@@ -99,6 +102,7 @@ public class ${table.className} ${table.generateExtendsImplements()} {
#####
#foreach ($role in $table.associationRoles)
#if ($table.access == "property")
+
//${role.description}
#if ($role.cardinality == "many-to-one")
#parse("manyToOne.vm")
@@ -114,7 +118,7 @@ public class ${table.className} ${table.generateExtendsImplements()} {
#if ($role.cardinality == "many-to-one" || $role.cardinality == "one-to-one")
#set ($propertyType = $role.referencedTable.className)
#elseif ($role.cardinality == "many-to-many" || $role.cardinality == "one-to-many")
-#set ($propertyType = "${role.referencedTable.defaultCollectionType}<${role.referencedTable.className}>")
+#set ($propertyType = "${role.referencedTable.simpleCollectionType}<${role.referencedTable.className}>")
#end
public $propertyType $customizer.propertyGetter($role.propertyName)() {
return this.${role.propertyName};

Back to the top