Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'jpa/plugins/org.eclipse.jpt.gen/templates/entities/main.java.vm')
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/templates/entities/main.java.vm14
1 files changed, 9 insertions, 5 deletions
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