|
1 |
| -$[D summary,main "This template contains the author that is responsible for generating the create object service methods."] |
2 |
| -$[D "**Create**"] |
3 |
| -$[D ""] |
4 |
| -$[D "The create method is called by create endpoints implemented in the controller class. This method"] |
5 |
| -$[D "in turn calls a create method in the repository class however before that it will assign"] |
6 |
| -$[D "a UUID primary key. This is also where it places some of the in-memory caching code. It will"] |
7 |
| -$[D "also set relationships associated with the logged in (principle) user."] |
| 1 | +$[log] |
| 2 | +$[foreach typedef in space.typedefs] |
8 | 3 |
|
9 |
| -$[D summary, main "Generates the Spring Boot Service classes for all entities in your project space."] |
10 |
| -$[D main, summary ""] |
11 |
| -$[D main, summary "Generates the Spring Boot Service classes for all entities in your project space."] |
12 |
| -$[D " |
13 |
| -When your application involves release and version management of some entity, this template has functions that can be useful. The template is centered around the support of a particular structure of entities that have specific relationships between eachother. |
14 |
| - |
15 |
| -The entities involved in the pattern shown below are as follows: |
16 |
| - |
17 |
| -| Entity | Description | |
18 |
| -|:------:|-------------| |
19 |
| -| O | **Object** - This is the main entity you are trying to manage in terms of versioning and release management. For instance, lets say your entity is called Widget. This would be the non-versioned Widget.| |
20 |
| -| V | **Version** - This represents a entity that tracks versions of the O entity. It would have attributes that need to be under version control. In our example, this would be a version of a Widget so might be named WidgetVersion.| |
21 |
| -| VR | **Version Release** - This entity binds our O and V entities to a release. So | |
22 |
| -| R | **Release** - This represents a release of one or more O,V pairs. | |
23 |
| -| P | **Parent** - This is an *optional* entity that defines a context for the R entity (as a parent entity to it). | |
24 |
| - |
25 |
| - |
26 |
| -``` |
27 |
| - +-------+ +-------+ +--------+ +-------+ +-------+ |
28 |
| - | P +---<| R +-----<| VR |>-------+ V |>---------+ O |>--+ |
29 |
| - +----+--+ +-------+ +--------+ +-------+ +----+--+ | |
30 |
| - | Y | | |
31 |
| - | +-----------------------------------+ | |
32 |
| - +-----------------------------------------------------------------------+ |
33 |
| -Tag-> release:top release:binder release:version release:object |
34 |
| - |
35 |
| -``` |
36 |
| - |
37 |
| -These functions help support the detection of this pattern not just in terms of the tags but also the relationships between the entities. |
38 |
| -" |
39 |
| -] |
40 |
| -$[D "easily expanded to support many other features."] |
41 |
| -$[let something = !otherthing] |
42 |
| - $[capture parentId]${relationship|domain: Model|wrap:("hello") cache blah:"asdf"}Id$[/capture] |
43 |
| -package ${domain.namespace}; |
44 |
| - |
45 |
| -$[receive distinct imports] |
46 |
| - |
47 |
| -$[import "service/authors/ServiceBaseAuthor"] |
48 |
| -$[import "service/authors/ServiceCRUDAuthors"] |
49 |
| -$[*import "service/authors/ServiceCacheAuthor"*] |
50 |
| -$[import "service/authors/ServiceUploadAuthor"] |
51 |
| - |
52 |
| -$[foreach space.modules] |
53 |
| -${module.name} is one of the modules. |
| 4 | +Typedef: ${typedef.name} |
54 | 5 | $[/foreach]
|
| 6 | +$[foreach enum in space.enums] |
55 | 7 |
|
56 |
| -$[function abc D "this is a description of this function" (argument1 D "description for arg 1 that can be pretty long because it has a lot to say about this argument for some reason so it just keeps rambling on and on aobut it.", argument2 D "another description this time for arg 2")] |
57 |
| -$[/function] |
58 |
| - |
59 |
| -$[function xyz |
60 |
| - D main, summary "this is a description of this function" |
61 |
| - (argumentA D "description for arg 1 that can be pretty long because it has a lot to say about this argument for some reason so it just keeps rambling on and on aobut it.",argumentHLM D "another description this time for arg 2" |
62 |
| - ) |
63 |
| -] |
64 |
| -$[/function] |
65 |
| -$[call xyz ( argumentA:"", argumentHLM:5 )] |
66 |
| - |
67 |
| -$[publisher org.entitycompiler.springboot.service |
68 |
| - D "This publisher ultimately builds the Service classes for the Spring Boot application but it relies on many" |
69 |
| - D "authors to fill it out with methods required to implement the application." |
70 |
| -] |
71 |
| -$[language java] |
72 |
| -$[domain Service] |
73 |
| -$[switch track] |
74 |
| - $[case justin]laskdjf;askljdf |
75 |
| - $[case hard] qwerqwer |
76 |
| - $[default]do this |
| 8 | +Enum: ${enum.name} |
| 9 | +$[/foreach] |
| 10 | +$[foreach entity in space.entities] |
| 11 | + |
| 12 | +$[let qualifier = entity.isSecondary ? "Secondary " : ""] |
| 13 | +${qualifier}Entity: ${entity.name} |
| 14 | +$[foreach attribute in entity.attributes] |
| 15 | +$[switch attribute.type] |
| 16 | +$[case uuid] |
| 17 | +$[let typeLongName="Unique Identifier - 128 bits"] |
| 18 | +$[case int32] |
| 19 | +$[let typeLongName="32-bit Integer"] |
| 20 | +$[case int64] |
| 21 | +$[let typeLongName="64-bit Integer"] |
| 22 | +$[case float] |
| 23 | +$[let typeLongName="32-bit Floating Point"] |
| 24 | +$[case double] |
| 25 | +$[let typeLongName="64-bit Floating Point"] |
| 26 | +$[case string] |
| 27 | +$[let typeLongName="String of characters"] |
| 28 | +$[case enum] |
| 29 | +$[let typeLongName="Enum named " + attribute.type.name] |
| 30 | +$[case typedef] |
| 31 | +$[let typeLongName="Typedef named " + attribute.type.name] |
| 32 | +$[case entity] |
| 33 | +$[let typeLongName="Entity named " + attribute.type.name] |
| 34 | +$[default] |
| 35 | +$[let typeLongName="Unknown"] |
77 | 36 | $[/switch]
|
78 |
| -$[foreach module in space.modules] |
79 |
| - $[if module.isIncluded]$[continue]$[/if] |
80 |
| - $[outlet moduleLoopTop |
81 |
| - D "This is just inside the module foreach. An author could use this to filter out modules, for instance."] |
82 |
| -$[/outlet] |
83 |
| - $[foreach module.entities as entity] |
84 |
| - $[if !(entity.isSecondary || entity.isImplicit|| entity.isExtern || entity.isTransient)+5*(4+xyz*efv)]xx$[continue]$[/if] |
85 |
| - $[outlet entityLoopTop |
86 |
| - D "This is just inside the entity foreach. An author could use this to filter out entities, for instance."] |
87 |
| - $[/outlet] |
88 |
| - $[file domain.namespace|path entity|domain|name "java"] |
89 |
| -$[outlet commentHeader |
90 |
| -D "This outlet simply allows you to place comments at the top of the source file." |
91 |
| -]$[/outlet] |
92 |
| - |
93 |
| -$[foreach ab in bc] |
94 |
| - ${ab.name}dude$[let this=that]wer |
| 37 | + Attribute |
| 38 | + Name: ${attribute.name} |
| 39 | + Type: ${typeLongName} |
95 | 40 | $[/foreach]
|
96 |
| - |
97 |
| -package ${domain.namespace}; |
98 |
| - |
99 |
| -$[receive distinct imports D "This will receive Java import statements."] |
100 |
| -$[send imports] |
101 |
| -import org.springframework.stereotype.Service; |
102 |
| -import org.springframework.transaction.annotation.Transactional; |
103 |
| -$[/send] |
104 |
| - |
105 |
| -@Service |
106 |
| -@Transactional |
107 |
| -$[outlet classAnnotation |
108 |
| -D "This allows an author to add an annotation to the class definition." |
109 |
| -]$[/outlet] |
110 |
| -public class ${className} { |
111 |
| - |
112 |
| -$[receive distinct memberDecl] |
113 |
| -$[receive distinct caches] |
114 |
| - |
115 |
| -$[outlet members |
116 |
| -D "This is the top section of the class where member variables typically are placed." |
117 |
| -] |
118 |
| - // no members |
119 |
| -$[/outlet] |
120 |
| - |
121 |
| -$[outlet constructor |
122 |
| -D "The constructor outlet lets you replace the simple constructor with one that supports other functions such as" |
123 |
| -D "auto wired objects." |
124 |
| -] |
125 |
| - public ${className}() {} |
126 |
| -$[/outlet] |
127 |
| - |
128 |
| -$[outlet methods |
129 |
| -D "This outlet is where authors place the build of generated code. Some of these authors may also be publishers" |
130 |
| -D "to give access to specific methods." |
131 |
| -] |
132 |
| - // no methods |
133 |
| -$[/outlet] |
134 |
| -} |
135 |
| - $[/file] |
136 |
| - $[/foreach] |
137 | 41 | $[/foreach]
|
138 |
| -$[/publisher] |
139 |
| -$[file domain.namespace|path "README" "md"] |
140 |
| -# Service Classes |
141 |
| - |
142 |
| -The classes in this directory are Service classes as part of the Spring Framework. |
143 |
| - |
144 |
| -## Generated by |
145 |
| - |
146 |
| -Entity Compiler v${compiler.version} |
147 |
| - |
148 |
| -Template: `${template.name}` |
149 |
| - |
150 |
| -$[/file] |
| 42 | +$[/log] |
0 commit comments