added aggregateid attribute
This commit is contained in:
parent
dedeb2b10c
commit
c5acb46f5a
25
src/java-unions.js
Normal file
25
src/java-unions.js
Normal file
|
@ -0,0 +1,25 @@
|
|||
const utils = require('./utils')
|
||||
const javaType = require('./java-type')
|
||||
|
||||
|
||||
module.exports = {
|
||||
|
||||
mapUnions: (unions, models, namespace, suffix='models') => {
|
||||
return unions.map(union => {
|
||||
union.package = `${namespace}.${suffix}`
|
||||
union.name = utils.pascalcase(union.name)
|
||||
|
||||
union.types.forEach(type => {
|
||||
models.forEach(model => {
|
||||
if(type.name === model.name) {
|
||||
model.implements = model.implements || []
|
||||
model.implements.push(union.name)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
return union
|
||||
})
|
||||
}
|
||||
|
||||
}
|
|
@ -20,7 +20,7 @@ import lombok.*;
|
|||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class {{name}} {
|
||||
public class {{name}} {{#implements.length}}implements {{#implements}}.{{/implements}}{{/implement.length}} {
|
||||
|
||||
@TargetAggregateIdentifier
|
||||
private {{{aggregateId.type.name}}} {{aggregateId.name}};
|
||||
|
|
|
@ -27,7 +27,7 @@ import {{{.}}};
|
|||
**/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class {{name}} {
|
||||
public class {{name}} {{#implements.length}}implements {{#implements}}.{{/implements}}{{/implement.length}}{
|
||||
|
||||
{{#fields}}
|
||||
{{#description}}/** {{.}} **/{{/description}}
|
||||
|
|
Loading…
Reference in a new issue