Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
StarUML Evológica Plugin
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
evologica
StarUML Evológica Plugin
Commits
66d0b061
Commit
66d0b061
authored
Aug 27, 2020
by
Erika Segatto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ajustes na geração de classes hibernate
parent
becd55ca
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
163 additions
and
103 deletions
+163
-103
IntegracaoDelphiSUML.pas
EvoUMLPlugin/src/IntegracaoDelphiSUML.pas
+163
-103
No files found.
EvoUMLPlugin/src/IntegracaoDelphiSUML.pas
View file @
66d0b061
...
...
@@ -5126,22 +5126,17 @@ function TUtil.GerarClassPreview_JavaHibernate(piClass: IUMLClass): string;
procedure
IncluirImports
(
const
piCodigoClasse
:
PStringWriter
;
piClassTicket
:
acClassTicket
;
const
piTipoId
:
string
);
var
lAttributeTicket
:
acAttributeTicket
;
lHasImport
:
array
[
0..4
]
of
Boolean
;
lRelation
:
acRelationTicket
;
lHasImport
:
array
[
0..5
]
of
Boolean
;
index
:
integer
;
lsTipoAttribute
:
string
;
lClassTicketPai
:
acClassTicket
;
lDone
:
Boolean
;
begin
piCodigoClasse
.
WriteLine
(
'import javax.persistence.*;'
);
piCodigoClasse
.
WriteLine
(
'import java.util.List;'
);
piCodigoClasse
.
WriteLine
(
'import java.util.ArrayList;'
);
for
index
:=
0
to
4
do
for
index
:=
0
to
5
do
lHasImport
[
index
]
:=
False
;
if
piTipoId
=
'Long'
then
begin
piCodigoClasse
.
WriteLine
(
'import java.lang.Long;'
);
lHasImport
[
1
]
:=
True
;
end
;
if
piTipoId
=
'Long'
then
lHasImport
[
1
]
:=
True
;
lDone
:=
False
;
lClassTicketPai
:=
piClassTicket
;
while
Assigned
(
lClassTicketPai
)
do
...
...
@@ -5150,35 +5145,41 @@ function TUtil.GerarClassPreview_JavaHibernate(piClass: IUMLClass): string;
begin
lAttributeTicket
:=
lClassTicketPai
.
Attributes
.
Objects
[
index
]
as
acAttributeTicket
;
lsTipoAttribute
:=
ObterTipoAtributoJava
(
lAttributeTicket
.
AttributeType
);
if
(
lsTipoAttribute
=
'BigDecimal'
)
and
(
not
lHasImport
[
0
])
then
begin
piCodigoClasse
.
WriteLine
(
'import java.math.BigDecimal;'
);
lHasImport
[
0
]
:=
True
;
end
else
if
(
lsTipoAttribute
=
'Long'
)
and
(
not
lHasImport
[
1
])
then
if
(
lsTipoAttribute
=
'BigDecimal'
)
then
lHasImport
[
0
]
:=
True
else
if
(
lsTipoAttribute
=
'Long'
)
then
lHasImport
[
1
]
:=
True
else
if
(
lsTipoAttribute
=
'OffsetDateTime'
)
then
lHasImport
[
2
]
:=
True
else
if
(
lsTipoAttribute
=
'Boolean'
)
then
lHasImport
[
3
]
:=
True
;
if
((
not
lDone
)
and
lAttributeTicket
.
Mandatory
)
then
lHasImport
[
4
]
:=
True
;
end
;
for
index
:=
0
to
lClassTicketPai
.
RelationTicketsIn
.
Count
-
1
do
begin
piCodigoClasse
.
WriteLine
(
'import java.lang.Long;'
);
lHasImport
[
1
]
:=
True
;
end
else
if
(
lsTipoAttribute
=
'OffsetDateTime'
)
and
(
not
lHasImport
[
2
])
then
lRelation
:=
(
lClassTicketPai
.
RelationTicketsIn
.
Objects
[
index
]
as
acRelationTicket
);
if
(
lRelation
.
DestinationPropertyName
<>
''
)
then
begin
piCodigoClasse
.
WriteLine
(
'import java.time.OffsetDateTime;'
);
lHasImport
[
2
]
:=
True
;
end
else
if
(
lsTipoAttribute
=
'Boolean'
)
and
(
not
lHasImport
[
3
])
then
if
lRelation
.
DestinationMaxMultiplicity
>
1
then
lHasImport
[
5
]
:=
True
;
if
lRelation
.
DestinationMinMultiplicity
>=
1
then
lHasImport
[
4
]
:=
True
;
end
;
end
;
for
index
:=
0
to
lClassTicketPai
.
RelationTicketsOut
.
Count
-
1
do
begin
piCodigoClasse
.
WriteLine
(
'import java.lang.Boolean;'
);
lHasImport
[
3
]
:=
True
;
end
else
if
((
not
lDone
)
and
lAttributeTicket
.
Mandatory
)
and
(
not
lHasImport
[
4
])
then
lRelation
:=
(
lClassTicketPai
.
RelationTicketsOut
.
Objects
[
index
]
as
acRelationTicket
);
if
(
lRelation
.
OriginPropertyName
<>
''
)
then
begin
piCodigoClasse
.
WriteLine
(
'import javax.validation.constraints.NotNull;'
)
;
lHasImport
[
4
]
:=
True
;
if
lRelation
.
OriginMaxMultiplicity
>
1
then
lHasImport
[
5
]
:=
True
;
if
lRelation
.
OriginMinMultiplicity
>=
1
then
lHasImport
[
4
]
:=
True
;
end
;
end
;
lClassTicketPai
:=
lClassTicketPai
.
ParentClassTicket
;
lDone
:=
True
;
end
;
if
lHasImport
[
1
]
then
piCodigoClasse
.
WriteLine
(
'import java.lang.Long;'
);
if
lHasImport
[
3
]
then
piCodigoClasse
.
WriteLine
(
'import java.lang.Boolean;'
);
if
lHasImport
[
0
]
then
piCodigoClasse
.
WriteLine
(
'import java.math.BigDecimal;'
);
if
lHasImport
[
2
]
then
piCodigoClasse
.
WriteLine
(
'import java.time.OffsetDateTime;'
);
if
lHasImport
[
5
]
then
piCodigoClasse
.
WriteLine
(
'import java.util.List;'
);
if
lHasImport
[
5
]
then
piCodigoClasse
.
WriteLine
(
'import java.util.ArrayList;'
);
if
lHasImport
[
4
]
then
piCodigoClasse
.
WriteLine
(
'import javax.validation.constraints.NotNull;'
);
end
;
function
ObterTipoHeranca
(
const
piClassTicket
:
acClassTicket
;
const
piNomeTabela
:
string
):
string
;
...
...
@@ -5202,6 +5203,116 @@ function TUtil.GerarClassPreview_JavaHibernate(piClass: IUMLClass): string;
end
;
end
;
procedure
EscreverAnotacoesAtributo
(
const
piCodigoClasse
:
PStringWriter
;
piAttributeTicket
:
acAttributeTicket
;
piColumnTicket
:
acDBColumnMapTicket
);
begin
if
piAttributeTicket
.
Mandatory
then
piCodigoClasse
.
WriteLine
(
'@NotNull'
);
piCodigoClasse
.
Write
(
'@Column(name = "'
+
piColumnTicket
.
ColumnName
+
'"'
);
if
piAttributeTicket
.
DBType
=
'VARCHAR'
then
piCodigoClasse
.
Write
(
', length = '
+
IntToStr
(
piAttributeTicket
.
VarSize
));
if
piAttributeTicket
.
Mandatory
then
piCodigoClasse
.
Write
(
', nullable = false'
);
piCodigoClasse
.
WriteLine
(
')'
);
end
;
procedure
EscreverAnotacoesRelationsIn
(
const
piCodigoClasse
:
PStringWriter
;
piRelationTicket
:
acRelationTicket
);
var
lRelationPersistenceMapTicket
:
acRelationSQLPersistenceMapTicket
;
lMandatory
:
Boolean
;
begin
lRelationPersistenceMapTicket
:=
(
fMetaModelPersistenceMap
as
acMetaModelPersistenceMapSQL
).
GetRelationsSQLPersistenceMapTicket
(
piRelationTicket
);
lMandatory
:=
piRelationTicket
.
DestinationMinMultiplicity
>=
1
;
if
piRelationTicket
.
DestinationMaxMultiplicity
=
1
then
begin
if
lMandatory
then
piCodigoClasse
.
WriteLine
(
'@NotNull'
);
if
piRelationTicket
.
OriginMaxMultiplicity
=
1
then
piCodigoClasse
.
Write
(
'@OneToOne(fetch = FetchType.EAGER'
)
else
piCodigoClasse
.
Write
(
'@ManyToOne(fetch = FetchType.EAGER'
);
if
lMandatory
then
piCodigoClasse
.
Write
(
', optional = false'
);
end
else
begin
if
lMandatory
then
piCodigoClasse
.
WriteLine
(
'@NotEmpty'
);
if
piRelationTicket
.
OriginMaxMultiplicity
=
1
then
piCodigoClasse
.
Write
(
'@OneToMany(fetch = FetchType.LAZY'
)
else
piCodigoClasse
.
Write
(
'@ManyToMany(fetch = FetchType.LAZY'
);
end
;
if
piRelationTicket
.
DestinationAggregation
=
acPropertyAggregation
.
pvComposite
then
piCodigoClasse
.
Write
(
', cascade = CascadeType.ALL'
)
else
piCodigoClasse
.
Write
(
', cascade = CascadeType.DETACH'
);
piCodigoClasse
.
WriteLine
(
')'
);
if
lRelationPersistenceMapTicket
is
acDirectDBRelationMapTicket
then
begin
piCodigoClasse
.
Write
(
'@JoinColumn(name = "'
+
acDirectDBRelationMapTicket
(
lRelationPersistenceMapTicket
).
FKColumnName
+
'"'
);
if
lMandatory
then
piCodigoClasse
.
Write
(
', nullable = false'
);
end
else
piCodigoClasse
.
Write
(
'@JoinTable(name = "'
+
acIndirectDBRelationMapTicket
(
lRelationPersistenceMapTicket
).
TableName
+
'"'
+
', joinColumns = { @JoinColumn(name = "'
+
acIndirectDBRelationMapTicket
(
lRelationPersistenceMapTicket
).
FKOrigemName
+
'") }'
+
', inverseJoinColumns = { @JoinColumn(name = "'
+
acIndirectDBRelationMapTicket
(
lRelationPersistenceMapTicket
).
FKDestinoName
+
'")'
+
'} '
);
piCodigoClasse
.
WriteLine
(
')'
);
end
;
procedure
EscreverAnotacoesRelationsOut
(
const
piCodigoClasse
:
PStringWriter
;
piRelationTicket
:
acRelationTicket
);
var
lRelationPersistenceMapTicket
:
acRelationSQLPersistenceMapTicket
;
lMandatory
:
Boolean
;
begin
lRelationPersistenceMapTicket
:=
(
fMetaModelPersistenceMap
as
acMetaModelPersistenceMapSQL
).
GetRelationsSQLPersistenceMapTicket
(
piRelationTicket
);
lMandatory
:=
piRelationTicket
.
OriginMinMultiplicity
>=
1
;
if
piRelationTicket
.
OriginMaxMultiplicity
=
1
then
begin
if
lMandatory
then
piCodigoClasse
.
WriteLine
(
'@NotNull'
);
if
piRelationTicket
.
DestinationMaxMultiplicity
=
1
then
piCodigoClasse
.
Write
(
'@OneToOne(fetch = FetchType.LAZY'
)
else
piCodigoClasse
.
Write
(
'@ManyToOne(fetch = FetchType.LAZY'
);
if
lMandatory
then
piCodigoClasse
.
Write
(
', optional = false'
);
end
else
begin
if
lMandatory
then
piCodigoClasse
.
WriteLine
(
'@NotEmpty'
);
if
piRelationTicket
.
DestinationMaxMultiplicity
=
1
then
piCodigoClasse
.
Write
(
'@OneToMany(fetch = FetchType.LAZY'
)
else
piCodigoClasse
.
Write
(
'@ManyToMany(fetch = FetchType.LAZY'
);
end
;
if
piRelationTicket
.
OriginAggregation
=
acPropertyAggregation
.
pvComposite
then
piCodigoClasse
.
Write
(
', cascade = CascadeType.ALL'
)
else
piCodigoClasse
.
Write
(
', cascade = CascadeType.DETACH'
);
if
piRelationTicket
.
DestinationPropertyName
<>
''
then
piCodigoClasse
.
WriteLine
(
', mappedBy = "'
+
FirstLetterLowerCase
(
piRelationTicket
.
DestinationPropertyName
)+
'")'
)
else
begin
piCodigoClasse
.
WriteLine
(
')'
);
if
(
lRelationPersistenceMapTicket
is
acDirectDBRelationMapTicket
)
and
(
acDirectDBRelationMapTicket
(
lRelationPersistenceMapTicket
).
FKColumnName
<>
''
)
then
begin
piCodigoClasse
.
Write
(
'@JoinColumn(name = "'
+
acDirectDBRelationMapTicket
(
lRelationPersistenceMapTicket
).
FKColumnName
+
'"'
);
if
lMandatory
then
piCodigoClasse
.
Write
(
', nullable = false'
);
end
else
if
(
lRelationPersistenceMapTicket
is
acIndirectDBRelationMapTicket
)
and
(
acIndirectDBRelationMapTicket
(
lRelationPersistenceMapTicket
).
TableName
<>
''
)
then
piCodigoClasse
.
Write
(
'@JoinTable(name = "'
+
acIndirectDBRelationMapTicket
(
lRelationPersistenceMapTicket
).
TableName
+
'"'
+
', joinColumns = { @JoinColumn(name = "'
+
acIndirectDBRelationMapTicket
(
lRelationPersistenceMapTicket
).
FKDestinoName
+
'") }'
+
', inverseJoinColumns = { @JoinColumn(name = "'
+
acIndirectDBRelationMapTicket
(
lRelationPersistenceMapTicket
).
FKOrigemName
+
'")'
+
'}'
);
piCodigoClasse
.
WriteLine
(
')'
);
end
;
end
;
const
_NomeId
=
'Id'
;
_DBTipoId
=
'Long'
;
...
...
@@ -5227,8 +5338,6 @@ var
lParamsConstrutor
,
lParamsConstrutorSemRelOut
:
string
;
lRelation
:
acRelationTicket
;
lRelationPersistenceMapTicket
:
acRelationSQLPersistenceMapTicket
;
lColumnTicket
:
acDBColumnMapTicket
;
lEhClasseHerdada
:
Boolean
;
lListaChamadaConstr
,
lListaChamadaSuper
,
...
...
@@ -5270,6 +5379,7 @@ begin
lInheritanceType
:=
ObterTipoHeranca
(
lClassTicket
,
lsNomeTabela
);
lCodigoClasse
.
WriteLine
(
'@Inheritance(strategy = '
+
lInheritanceType
+
')'
);
lCodigoClasse
.
WriteLine
(
'@DiscriminatorColumn(name = "'
+
lClassToDBMapTicket
.
TypeColumnName
+
'")'
);
lCodigoClasse
.
WriteLine
(
'@DiscriminatorValue("'
+
lClassToDBMapTicket
.
DBClassMapCode
+
'")'
);
end
else
if
lEhClasseHerdada
then
...
...
@@ -5304,85 +5414,35 @@ begin
lsAtributo
:=
lClassTicket
.
Attributes
.
Strings
[
index
];
lsTipoAttribute
:=
ObterTipoAtributoJava
(
lAttributeTicket
.
AttributeType
);
lColumnTicket
:=
acDBColumnMapTicket
(
lClassToDBMapTicket
.
Columns
.
ValueOf
(
UpCase
(
lsAtributo
)));
if
lAttributeTicket
.
DBType
=
'VARCHAR'
then
lCodigoClasse
.
WriteLine
(
'@Column(name = "'
+
lColumnTicket
.
ColumnName
+
'", length = '
+
IntToStr
(
lAttributeTicket
.
VarSize
)
+
')'
)
else
lCodigoClasse
.
WriteLine
(
'@Column(name = "'
+
lColumnTicket
.
ColumnName
+
'")'
);
if
lAttributeTicket
.
Mandatory
then
lCodigoClasse
.
WriteLine
(
'@NotNull'
);
EscreverAnotacoesAtributo
(
lCodigoClasse
,
lAttributeTicket
,
acDBColumnMapTicket
(
lClassToDBMapTicket
.
Columns
.
ValueOf
(
UpCase
(
lsAtributo
))));
EscreverDeclaracaoAtributo
(
lCodigoClasse
,
lsTipoAttribute
,
lsAtributo
,
lClassTicket
.
HasDescendants
);
end
;
// DECLARAO ATRIBUTOS: Percorre relacionamentos
for
index
:=
0
to
lClassTicket
.
RelationTicketsIn
.
Count
-
1
do
begin
lRelation
:=
(
lClassTicket
.
RelationTicketsIn
.
Objects
[
index
]
as
acRelationTicket
);
lRelationPersistenceMapTicket
:=
lMetaModelPersistenceMapSQL
.
GetRelationsSQLPersistenceMapTicket
(
lRelation
);
if
(
lRelation
.
DestinationPropertyName
<>
''
)
then
begin
lsAtributo
:=
lRelation
.
DestinationPropertyName
;
lsTipoAttribute
:=
lRelation
.
OriginClassTicket
.
DisplayName
;
if
lRelation
.
DestinationMaxMultiplicity
=
1
then
begin
if
lRelation
.
OriginMaxMultiplicity
=
1
then
lCodigoClasse
.
Write
(
'@OneToOne(fetch = FetchType.EAGER'
)
else
lCodigoClasse
.
Write
(
'@ManyToOne(fetch = FetchType.EAGER'
);
end
else
begin
if
lRelation
.
DestinationMaxMultiplicity
>
1
then
lsTipoAttribute
:=
'final List<'
+
lsTipoAttribute
+
'>'
;
if
lRelation
.
OriginMaxMultiplicity
=
1
then
lCodigoClasse
.
Write
(
'@OneToMany(fetch = FetchType.LAZY'
)
else
lCodigoClasse
.
Write
(
'@ManyToMany(fetch = FetchType.LAZY'
);
end
;
if
lRelation
.
DestinationAggregation
=
acPropertyAggregation
.
pvComposite
then
lCodigoClasse
.
WriteLine
(
', cascade = CascadeType.ALL)'
)
else
lCodigoClasse
.
WriteLine
(
', cascade = CascadeType.DETACH)'
);
if
lRelationPersistenceMapTicket
is
acDirectDBRelationMapTicket
then
lCodigoClasse
.
WriteLine
(
'@JoinColumn(name = "'
+
acDirectDBRelationMapTicket
(
lRelationPersistenceMapTicket
).
FKColumnName
+
'")'
)
else
lCodigoClasse
.
WriteLine
(
'@JoinTable(name = "'
+
acIndirectDBRelationMapTicket
(
lRelationPersistenceMapTicket
).
TableName
+
'"'
+
', joinColumns = { @JoinColumn(name = "'
+
acIndirectDBRelationMapTicket
(
lRelationPersistenceMapTicket
).
FKOrigemName
+
'") }'
+
', inverseJoinColumns = { @JoinColumn(name = "'
+
acIndirectDBRelationMapTicket
(
lRelationPersistenceMapTicket
).
FKDestinoName
+
'")'
+
'} )'
);
EscreverAnotacoesRelationsIn
(
lCodigoClasse
,
lRelation
);
EscreverDeclaracaoAtributo
(
lCodigoClasse
,
lsTipoAttribute
,
lsAtributo
,
lClassTicket
.
HasDescendants
);
end
;
end
;
for
index
:=
0
to
lClassTicket
.
RelationTicketsOut
.
Count
-
1
do
begin
lRelation
:=
(
lClassTicket
.
RelationTicketsOut
.
Objects
[
index
]
as
acRelationTicket
);
lRelationPersistenceMapTicket
:=
lMetaModelPersistenceMapSQL
.
GetRelationsSQLPersistenceMapTicket
(
lRelation
);
if
(
lRelation
.
OriginPropertyName
<>
''
)
then
begin
lsAtributo
:=
lRelation
.
OriginPropertyName
;
lsTipoAttribute
:=
lRelation
.
DestinationClassTicket
.
DisplayName
;
if
lRelation
.
OriginMaxMultiplicity
=
1
then
begin
if
lRelation
.
DestinationMaxMultiplicity
=
1
then
lCodigoClasse
.
Write
(
'@OneToOne(fetch = FetchType.LAZY'
)
else
lCodigoClasse
.
Write
(
'@ManyToOne(fetch = FetchType.LAZY'
);
end
else
begin
if
lRelation
.
OriginMaxMultiplicity
>
1
then
lsTipoAttribute
:=
'final List<'
+
lsTipoAttribute
+
'>'
;
if
lRelation
.
DestinationMaxMultiplicity
=
1
then
lCodigoClasse
.
Write
(
'@OneToMany(fetch = FetchType.LAZY'
)
else
lCodigoClasse
.
Write
(
'@ManyToMany(fetch = FetchType.LAZY'
);
end
;
if
lRelation
.
OriginAggregation
=
acPropertyAggregation
.
pvComposite
then
lCodigoClasse
.
Write
(
', cascade = CascadeType.ALL'
)
else
lCodigoClasse
.
Write
(
', cascade = CascadeType.DETACH'
);
if
lRelation
.
DestinationPropertyName
<>
''
then
lCodigoClasse
.
WriteLine
(
', mappedBy = "'
+
FirstLetterLowerCase
(
lRelation
.
DestinationPropertyName
)+
'")'
)
else
begin
lCodigoClasse
.
WriteLine
(
')'
);
if
(
lRelationPersistenceMapTicket
is
acDirectDBRelationMapTicket
)
and
(
acDirectDBRelationMapTicket
(
lRelationPersistenceMapTicket
).
FKColumnName
<>
''
)
then
lCodigoClasse
.
WriteLine
(
'@JoinColumn(name = "'
+
acDirectDBRelationMapTicket
(
lRelationPersistenceMapTicket
).
FKColumnName
+
'")'
)
else
if
(
lRelationPersistenceMapTicket
is
acIndirectDBRelationMapTicket
)
and
(
acIndirectDBRelationMapTicket
(
lRelationPersistenceMapTicket
).
TableName
<>
''
)
then
lCodigoClasse
.
WriteLine
(
'@JoinTable(name = "'
+
acIndirectDBRelationMapTicket
(
lRelationPersistenceMapTicket
).
TableName
+
'"'
+
', joinColumns = { @JoinColumn(name = "'
+
acIndirectDBRelationMapTicket
(
lRelationPersistenceMapTicket
).
FKDestinoName
+
'") }'
+
', inverseJoinColumns = { @JoinColumn(name = "'
+
acIndirectDBRelationMapTicket
(
lRelationPersistenceMapTicket
).
FKOrigemName
+
'")'
+
'} )'
);
end
;
EscreverAnotacoesRelationsOut
(
lCodigoClasse
,
lRelation
);
EscreverDeclaracaoAtributo
(
lCodigoClasse
,
lsTipoAttribute
,
lsAtributo
,
lClassTicket
.
HasDescendants
);
end
;
end
;
...
...
@@ -5435,13 +5495,13 @@ begin
lsTipoAttribute
:=
ObterTipoAtributoJava
(
lAttributeTicket
.
AttributeType
);
lParamsConstrutor
:=
lParamsConstrutor
+
lsTipoAttribute
+
' pi'
+
lsAtributo
+
', '
;
lParamsConstrutorSemRelOut
:=
lParamsConstrutorSemRelOut
+
lsTipoAttribute
+
' pi'
+
lsAtributo
+
', '
;
lListaChamadaConstr
.
Add
(
'pi'
+
lsAtributo
);
if
lClassTicketPai
.
ID
<>
lClassTicket
.
ID
then
begin
lListaChamadaSuper
.
Add
(
'pi'
+
lsAtributo
);
lListaChamadaSuperSemRelOut
.
Add
(
'pi'
+
lsAtributo
);
end
else
begin
lListaChamadaConstr
.
Add
(
'pi'
+
lsAtributo
);
EscreverInicializacaoAtributo
(
lCodigoConstrutor
,
lsAtributo
,
1
);
EscreverInicializacaoAtributo
(
lCodigoConstrutorSemRelOut
,
lsAtributo
,
1
);
end
;
...
...
@@ -5456,12 +5516,12 @@ begin
then
lsTipoAttribute
:=
'List<'
+
lRelation
.
OriginClassTicket
.
DisplayName
+
'>'
else
lsTipoAttribute
:=
lRelation
.
OriginClassTicket
.
DisplayName
;
lParamsConstrutor
:=
lParamsConstrutor
+
lsTipoAttribute
+
' pi'
+
lsAtributo
+
', '
;
lListaChamadaConstr
.
Add
(
'pi'
+
lsAtributo
);
if
lClassTicketPai
.
ID
<>
lClassTicket
.
ID
then
begin
lListaChamadaSuper
.
Add
(
'pi'
+
lsAtributo
);
end
else
begin
lListaChamadaConstr
.
Add
(
'pi'
+
lsAtributo
);
EscreverInicializacaoAtributo
(
lCodigoConstrutor
,
lRelation
.
DestinationPropertyName
,
lRelation
.
DestinationMaxMultiplicity
);
EscreverCriacaoLista
(
lCodigoConstrutorSemRelOut
,
lRelation
.
DestinationPropertyName
,
lRelation
.
DestinationMaxMultiplicity
);
end
;
...
...
@@ -5477,10 +5537,10 @@ begin
then
lsTipoAttribute
:=
'List<'
+
lRelation
.
DestinationClassTicket
.
DisplayName
+
'>'
else
lsTipoAttribute
:=
lRelation
.
DestinationClassTicket
.
DisplayName
;
lParamsConstrutor
:=
lParamsConstrutor
+
lsTipoAttribute
+
' pi'
+
lsAtributo
+
', '
;
lListaChamadaConstr
.
Add
(
'pi'
+
lsAtributo
);
if
lClassTicketPai
.
ID
<>
lClassTicket
.
ID
then
lListaChamadaSuper
.
Add
(
'pi'
+
lsAtributo
)
else
begin
lListaChamadaConstr
.
Add
(
'pi'
+
lsAtributo
);
EscreverInicializacaoAtributo
(
lCodigoConstrutor
,
lRelation
.
OriginPropertyName
,
lRelation
.
OriginMaxMultiplicity
);
EscreverCriacaoLista
(
lCodigoConstrutorSemRelOut
,
lRelation
.
OriginPropertyName
,
lRelation
.
OriginMaxMultiplicity
);
end
;
...
...
@@ -5501,7 +5561,7 @@ begin
lRelation
:=
(
lClassTicket
.
RelationTicketsIn
.
Objects
[
index
]
as
acRelationTicket
);
lsAtributo
:=
lRelation
.
DestinationPropertyName
;
if
(
lsAtributo
<>
''
)
and
(
lRelation
.
DestinationMaxMultiplicity
>
1
)
then
lCodigoClasse
.
WriteLine
(
lsAtributo
+
' = new ArrayList<>();'
);
lCodigoClasse
.
WriteLine
(
FirstLetterLowerCase
(
lsAtributo
)
+
' = new ArrayList<>();'
);
end
;
for
index
:=
0
to
lClassTicket
.
RelationTicketsOut
.
Count
-
1
do
begin
...
...
@@ -5527,7 +5587,7 @@ begin
then
lCodigoClasse
.
WriteLine
(
'public '
+
lsNomeClasseDB
+
'('
+
_DBTipoId
+
' piId, '
+
strutils
.
LeftStr
(
lParamsConstrutor
,
Length
(
lParamsConstrutor
)-
2
)+
') {'
)
else
lCodigoClasse
.
WriteLine
(
'public '
+
lsNomeClasseDB
+
'('
+
_DBTipoId
+
' piId) {'
);
lCodigoClasse
.
Indent
();
lCodigoClasse
.
WriteLine
(
'this('
+
lListaChamadaConstr
.
CommaText
+
')'
);
lCodigoClasse
.
WriteLine
(
'this('
+
lListaChamadaConstr
.
CommaText
+
')
;
'
);
lCodigoClasse
.
WriteLine
(
FirstLetterLowerCase
(
_NomeId
)+
' = piId;'
);
lCodigoClasse
.
Outdent
();
lCodigoClasse
.
WriteLine
(
'}'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment