Java Reference
In-Depth Information
«
DEFINE
idAttribute
FOR
oocore::Class-»
«
EXPAND
generatedComment
FOR this
-»
@Id
@Column(name="«name.toUpperCase()-»_ID")
@GeneratedValue(strategy=GenerationType.AUTO)
private int «name.toLowerCase()-»Id;
«
ENDDEFINE
»
«
DEFINE
attribute
FOR
oocore::Attribute-»
«
EXPAND
generatedComment
FOR this
-»
«
IF
name.toLowerCase() != name-» @Column(name="
«
EXPAND
toColumnName
FOR
name-»")«
ENDIF
»
«visibility.toString().toLowerCase()» «dataType.name» «name-»;
«
ENDDEFINE
»
«
DEFINE
reference
FOR
dnc::Association-»
«
IF this
.type.isEntity()-»
«
EXPAND
generatedComment
FOR this
-»
«
IF this
.upperBound == -1-»
@OneToMany(mappedBy="«
this
.owner.name.toLowerCase()»Id")
«
ELSEIF this
.upperBound == 1-»
@OneToOne(targetEntity=«
this
.opposite.owner.fullyQualifiedName()».class
)«
ENDIF
»
private «wrapIfCollection(
this
)» «name-»;
«
ENDIF
»
«
ENDDEFINE
»
«
DEFINE
reference
FOR
oocore::Reference-»
«
IF this
.generateReference()-»
«
EXPAND
generatedComment
FOR this
-»
@ManyToOne
@JoinColumn(name="«
this
.owner.name.toUpperCase()»_ID")
private «wrapIfCollection(
this
)» «name-»;
«
ENDIF
»
«
ENDDEFINE
»
«
DEFINE
idGetter
FOR
oocore::Class-»
«
EXPAND
generatedComment
FOR this
-»
public int get«name.toFirstUpper()»Id() {
return «name.toLowerCase()»Id;
}
«
ENDDEFINE
»
«
REM
»Abstract - do nothing, but here to keep Xpand editor happy«ENDREM»
«
DEFINE
getter
FOR
oocore::StructuralFeature»
«
ENDDEFINE
»
«
DEFINE
setter
FOR
oocore::StructuralFeature»
«
ENDDEFINE
»
«
DEFINE
getter
FOR
oocore::Attribute-»
«
EXPAND
generatedComment
FOR this
-»
public «
this
.dataType.name» get«name.toFirstUpper()»() {
return «name»;
}
«
ENDDEFINE
»
Search WWH ::
Custom Search