Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibizlab-generator
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibizlab-generator
提交
224da2a8
提交
224da2a8
编写于
12月 15, 2021
作者:
sq3536
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
拉平model属性
上级
c6c2fbb9
变更
15
显示空白字符变更
内嵌
并排
正在显示
15 个修改的文件
包含
360 行增加
和
222 行删除
+360
-222
BaseModel.java
...ore/src/main/java/cn/ibizlab/codegen/model/BaseModel.java
+38
-0
DataSetModel.java
.../src/main/java/cn/ibizlab/codegen/model/DataSetModel.java
+7
-24
DynamicModelStorage.java
...in/java/cn/ibizlab/codegen/model/DynamicModelStorage.java
+6
-9
EntityModel.java
...e/src/main/java/cn/ibizlab/codegen/model/EntityModel.java
+17
-53
FieldModel.java
...re/src/main/java/cn/ibizlab/codegen/model/FieldModel.java
+11
-104
LookupModel.java
...e/src/main/java/cn/ibizlab/codegen/model/LookupModel.java
+0
-17
POSchema.java
...core/src/main/java/cn/ibizlab/codegen/model/POSchema.java
+7
-8
PropType.java
...core/src/main/java/cn/ibizlab/codegen/model/PropType.java
+80
-0
RelationshipModel.java
...main/java/cn/ibizlab/codegen/model/RelationshipModel.java
+6
-3
SystemModel.java
...e/src/main/java/cn/ibizlab/codegen/model/SystemModel.java
+6
-0
TransUtils.java
...re/src/main/java/cn/ibizlab/codegen/model/TransUtils.java
+2
-2
MustacheCollector.java
...java/cn/ibizlab/codegen/templating/MustacheCollector.java
+177
-0
MustacheEngineAdapter.java
.../cn/ibizlab/codegen/templating/MustacheEngineAdapter.java
+1
-1
pom.xml
...bizlab-generator-core/src/main/resources/templ/r7/pom.xml
+1
-0
{{entities}}.java
...java/{{packageName}}/{{modules}}/domain/{{entities}}.java
+1
-1
未找到文件。
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/model/BaseModel.java
0 → 100644
浏览文件 @
224da2a8
package
cn
.
ibizlab
.
codegen
.
model
;
public
class
BaseModel
{
protected
Object
opt
;
public
<
T
>
T
setOpt
(
Object
opt
)
{
this
.
opt
=
opt
;
return
(
T
)
this
;
}
protected
DataObj
extParams
=
new
DataObj
();
public
<
T
>
T
set
(
String
key
,
Object
val
)
{
extParams
.
set
(
key
,
val
);
return
(
T
)
this
;
}
public
Object
get
(
String
key
)
{
return
extParams
.
get
(
key
);
}
public
Object
getOpt
()
{
return
opt
;
}
public
DataObj
getExtParams
()
{
return
extParams
;
}
public
<
T
>
T
setExtParams
(
DataObj
extParams
)
{
this
.
extParams
=
extParams
;
return
(
T
)
this
;
}
}
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/model/DataSetModel.java
浏览文件 @
224da2a8
...
@@ -9,6 +9,7 @@ import lombok.Getter;
...
@@ -9,6 +9,7 @@ import lombok.Getter;
import
lombok.NoArgsConstructor
;
import
lombok.NoArgsConstructor
;
import
lombok.Setter
;
import
lombok.Setter
;
import
lombok.experimental.Accessors
;
import
lombok.experimental.Accessors
;
import
net.ibizsys.model.dataentity.ds.IPSDEDataSet
;
/**
/**
* 实体[数据集]
* 实体[数据集]
...
@@ -17,60 +18,42 @@ import lombok.experimental.Accessors;
...
@@ -17,60 +18,42 @@ import lombok.experimental.Accessors;
@Setter
@Setter
@NoArgsConstructor
@NoArgsConstructor
@Accessors
(
chain
=
true
)
@Accessors
(
chain
=
true
)
@JsonIgnoreProperties
(
value
=
"handler"
)
public
class
DataSetModel
extends
BaseModel
{
@ApiModel
(
"数据集"
)
public
class
DataSetModel
{
/**
/**
* 标识
* 标识
*/
*/
@JSONField
(
name
=
"dataset_id"
)
@JsonProperty
(
"dataset_id"
)
@ApiModelProperty
(
"标识"
)
private
String
datasetId
;
private
String
datasetId
;
/**
/**
* 名称
* 名称
*/
*/
@JSONField
(
name
=
"dataset_name"
)
@JsonProperty
(
"dataset_name"
)
@ApiModelProperty
(
"名称"
)
private
String
datasetName
;
private
String
datasetName
;
/**
/**
* 实体标识
* 实体标识
*/
*/
@JSONField
(
name
=
"entity_id"
)
@JsonProperty
(
"entity_id"
)
@ApiModelProperty
(
"实体标识"
)
private
String
entityId
;
private
String
entityId
;
/**
/**
* 实体
* 实体
*/
*/
@JSONField
(
name
=
"entity_name"
)
@JsonProperty
(
"entity_name"
)
@ApiModelProperty
(
"实体"
)
private
String
entityName
;
private
String
entityName
;
/**
/**
* 代码名称
* 代码名称
*/
*/
@JSONField
(
name
=
"code_name"
)
@JsonProperty
(
"code_name"
)
@ApiModelProperty
(
"代码名称"
)
private
String
codeName
;
private
String
codeName
;
/**
/**
* 代码
* 代码
*/
*/
@JSONField
(
name
=
"ds_code"
)
@JsonProperty
(
"ds_code"
)
@ApiModelProperty
(
"代码"
)
private
String
dsCode
;
private
String
dsCode
;
/**
/**
* 模型
* 模型
*/
*/
@JSONField
(
name
=
"ds_model"
)
@JsonProperty
(
"ds_model"
)
@ApiModelProperty
(
"模型"
)
private
String
dsModel
;
private
String
dsModel
;
public
IPSDEDataSet
getDataSets
()
{
return
(
IPSDEDataSet
)
opt
;
}
}
}
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/model/DynamicModelStorage.java
浏览文件 @
224da2a8
...
@@ -89,9 +89,8 @@ public class DynamicModelStorage {
...
@@ -89,9 +89,8 @@ public class DynamicModelStorage {
IPSSystem
iPSSystem
=
getPSSystem
();
IPSSystem
iPSSystem
=
getPSSystem
();
IPSDataEntity
dataEntity
=
iPSSystem
.
getPSDataEntity
(
entity
,
true
);
IPSDataEntity
dataEntity
=
iPSSystem
.
getPSDataEntity
(
entity
,
true
);
Assert
.
notNull
(
dataEntity
,
"未找到对应的实体模型:"
+
entity
);
Assert
.
notNull
(
dataEntity
,
"未找到对应的实体模型:"
+
entity
);
EntityModel
entityModel
=
new
EntityModel
();
EntityModel
entityModel
=
new
EntityModel
()
.
setOpt
(
dataEntity
)
;
entityModel
.
setStorageMode
(
dataEntity
.
getStorageMode
());
entityModel
.
setStorageMode
(
dataEntity
.
getStorageMode
());
entityModel
.
setEntity
(
dataEntity
);
List
<
String
>
dsTypes
=
new
ArrayList
<>();
List
<
String
>
dsTypes
=
new
ArrayList
<>();
if
(
dataEntity
.
getAllPSDEDBConfigs
()!=
null
)
if
(
dataEntity
.
getAllPSDEDBConfigs
()!=
null
)
...
@@ -111,8 +110,7 @@ public class DynamicModelStorage {
...
@@ -111,8 +110,7 @@ public class DynamicModelStorage {
{
{
for
(
IPSDERBase
der
:
dataEntity
.
getMinorPSDERs
())
for
(
IPSDERBase
der
:
dataEntity
.
getMinorPSDERs
())
{
{
RelationshipModel
rel
=
new
RelationshipModel
();
RelationshipModel
rel
=
new
RelationshipModel
().
setOpt
(
der
);
rel
.
setRelation
(
der
);
rel
.
setName
(
der
.
getName
()).
setRelationType
(
der
.
getDERType
()).
setCodeName
(
der
.
getCodeName
()).
setEntityId
(
der
.
getMajorPSDataEntity
().
getId
())
rel
.
setName
(
der
.
getName
()).
setRelationType
(
der
.
getDERType
()).
setCodeName
(
der
.
getCodeName
()).
setEntityId
(
der
.
getMajorPSDataEntity
().
getId
())
.
setEntityCodeName
(
der
.
getMajorPSDataEntity
().
getCodeName
()).
setEntityName
(
der
.
getMajorPSDataEntity
().
getName
())
.
setEntityCodeName
(
der
.
getMajorPSDataEntity
().
getCodeName
()).
setEntityName
(
der
.
getMajorPSDataEntity
().
getName
())
.
setEntityLogicName
(
der
.
getMajorPSDataEntity
().
getLogicName
()).
setTableName
(
der
.
getMajorPSDataEntity
().
getTableName
());
.
setEntityLogicName
(
der
.
getMajorPSDataEntity
().
getLogicName
()).
setTableName
(
der
.
getMajorPSDataEntity
().
getTableName
());
...
@@ -141,8 +139,7 @@ public class DynamicModelStorage {
...
@@ -141,8 +139,7 @@ public class DynamicModelStorage {
{
{
if
(
StringUtils
.
isEmpty
(
der
.
getMinorCodeName
()))
if
(
StringUtils
.
isEmpty
(
der
.
getMinorCodeName
()))
continue
;
continue
;
RelationshipModel
rel
=
new
RelationshipModel
();
RelationshipModel
rel
=
new
RelationshipModel
().
setOpt
(
der
);
rel
.
setRelation
(
der
);
rel
.
setName
(
der
.
getName
()).
setRelationType
(
der
.
getDERType
()).
setCodeName
(
der
.
getMinorCodeName
()).
setEntityId
(
der
.
getMinorPSDataEntity
().
getId
())
rel
.
setName
(
der
.
getName
()).
setRelationType
(
der
.
getDERType
()).
setCodeName
(
der
.
getMinorCodeName
()).
setEntityId
(
der
.
getMinorPSDataEntity
().
getId
())
.
setEntityCodeName
(
der
.
getMinorPSDataEntity
().
getCodeName
()).
setEntityName
(
der
.
getMinorPSDataEntity
().
getName
())
.
setEntityCodeName
(
der
.
getMinorPSDataEntity
().
getCodeName
()).
setEntityName
(
der
.
getMinorPSDataEntity
().
getName
())
.
setEntityLogicName
(
der
.
getMinorPSDataEntity
().
getLogicName
()).
setTableName
(
der
.
getMinorPSDataEntity
().
getTableName
());
.
setEntityLogicName
(
der
.
getMinorPSDataEntity
().
getLogicName
()).
setTableName
(
der
.
getMinorPSDataEntity
().
getTableName
());
...
@@ -169,8 +166,7 @@ public class DynamicModelStorage {
...
@@ -169,8 +166,7 @@ public class DynamicModelStorage {
String
dict
=
null
;
String
dict
=
null
;
try
{
dict
=
defield
.
getPSCodeList
()!=
null
?
defield
.
getPSCodeList
().
getCodeName
():
null
;
}
catch
(
Exception
ex
){}
try
{
dict
=
defield
.
getPSCodeList
()!=
null
?
defield
.
getPSCodeList
().
getCodeName
():
null
;
}
catch
(
Exception
ex
){}
FieldModel
fieldModel
=
new
FieldModel
();
FieldModel
fieldModel
=
new
FieldModel
().
setOpt
(
defield
);
fieldModel
.
setField
(
defield
);
if
(
defield
.
getAllPSDEFDTColumns
()!=
null
)
if
(
defield
.
getAllPSDEFDTColumns
()!=
null
)
{
{
...
@@ -347,7 +343,8 @@ public class DynamicModelStorage {
...
@@ -347,7 +343,8 @@ public class DynamicModelStorage {
}
}
}
}
}
}
DataSetModel
dsModel
=
new
DataSetModel
().
setDatasetId
(
entityModel
.
getEntityName
().
toLowerCase
()+
"-ds-"
+
dataSet
.
getCodeName
()+
"-"
+
entry
.
getKey
().
toLowerCase
().
replace
(
"mysql5"
,
"mysql"
))
DataSetModel
dsModel
=
new
DataSetModel
().
setOpt
(
dataSet
);
dsModel
.
setDatasetId
(
entityModel
.
getEntityName
().
toLowerCase
()+
"-ds-"
+
dataSet
.
getCodeName
()+
"-"
+
entry
.
getKey
().
toLowerCase
().
replace
(
"mysql5"
,
"mysql"
))
.
setDatasetName
(
dataSet
.
getLogicName
()).
setCodeName
(
dataSet
.
getCodeName
())
.
setDatasetName
(
dataSet
.
getLogicName
()).
setCodeName
(
dataSet
.
getCodeName
())
.
setEntityId
(
entityModel
.
getEntityId
()).
setEntityName
(
entityModel
.
getEntityName
()).
setDsCode
(
entry
.
getValue
().
toLowerCase
().
replace
(
"mysql5"
,
"mysql"
)).
setDsModel
(
sql
);
.
setEntityId
(
entityModel
.
getEntityId
()).
setEntityName
(
entityModel
.
getEntityName
()).
setDsCode
(
entry
.
getValue
().
toLowerCase
().
replace
(
"mysql5"
,
"mysql"
)).
setDsModel
(
sql
);
entityModel
.
addDataSet
(
dsModel
);
entityModel
.
addDataSet
(
dsModel
);
...
...
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/model/EntityModel.java
浏览文件 @
224da2a8
...
@@ -19,7 +19,7 @@ import java.util.Map;
...
@@ -19,7 +19,7 @@ import java.util.Map;
@Setter
@Setter
@NoArgsConstructor
@NoArgsConstructor
@Accessors
(
chain
=
true
)
@Accessors
(
chain
=
true
)
public
class
EntityModel
{
public
class
EntityModel
extends
BaseModel
{
...
@@ -53,11 +53,14 @@ public class EntityModel {
...
@@ -53,11 +53,14 @@ public class EntityModel {
public
String
getModule
()
{
public
String
getModule
()
{
if
(
getEntity
().
getPSSystemModule
()!=
null
)
if
(
getEntity
().
getPSSystemModule
()!=
null
)
return
getEntity
().
getPSSystemModule
().
getCodeName
();
return
getEntity
().
getPSSystemModule
().
getCodeName
()
.
toLowerCase
()
;
return
"
U
ngroup"
;
return
"
u
ngroup"
;
}
}
private
IPSDataEntity
entity
;
public
IPSDataEntity
getEntity
(){
return
(
IPSDataEntity
)
opt
;
}
private
List
<
DataSetModel
>
dataSets
;
private
List
<
DataSetModel
>
dataSets
;
...
@@ -103,7 +106,7 @@ public class EntityModel {
...
@@ -103,7 +106,7 @@ public class EntityModel {
references
.
forEach
(
ship
->{
references
.
forEach
(
ship
->{
if
(!
StringUtils
.
isEmpty
(
ship
.
getCodeName
()))
if
(!
StringUtils
.
isEmpty
(
ship
.
getCodeName
()))
refMaps
.
put
(
ship
.
getCodeName
(),
ship
);
refMaps
.
put
(
ship
.
getCodeName
(),
ship
);
if
(!
StringUtils
.
isEmpty
(
ship
.
get
Relation
()))
{
if
(!
StringUtils
.
isEmpty
(
ship
.
get
Name
()))
{
String
fkname
=
DataObject
.
getStringValue
(
ship
.
getRelation
().
getName
(),
""
);
String
fkname
=
DataObject
.
getStringValue
(
ship
.
getRelation
().
getName
(),
""
);
if
(!
StringUtils
.
isEmpty
(
fkname
))
if
(!
StringUtils
.
isEmpty
(
fkname
))
refMaps
.
put
(
fkname
,
ship
);
refMaps
.
put
(
fkname
,
ship
);
...
@@ -135,7 +138,7 @@ public class EntityModel {
...
@@ -135,7 +138,7 @@ public class EntityModel {
{
{
fieldMap
=
new
LinkedHashMap
<>();
fieldMap
=
new
LinkedHashMap
<>();
fields
.
forEach
(
field
->{
fields
.
forEach
(
field
->{
fieldMap
.
put
(
field
.
get
Column
Name
(),
field
);
fieldMap
.
put
(
field
.
get
Field
Name
(),
field
);
fieldMap
.
put
(
field
.
getCodeName
(),
field
);
fieldMap
.
put
(
field
.
getCodeName
(),
field
);
});
});
}
}
...
@@ -160,24 +163,9 @@ public class EntityModel {
...
@@ -160,24 +163,9 @@ public class EntityModel {
private
boolean
isLogicValid
=
true
;
public
boolean
isLogicValid
()
public
boolean
isLogicValid
()
{
{
if
(
isLogicValid
&&
logicValidField
==
null
)
{
return
getEntity
().
isLogicValid
();
if
(
fields
!=
null
)
{
for
(
FieldModel
fieldModel
:
fields
)
{
if
(
fieldModel
.
isLogicValidField
())
{
logicValidField
=
fieldModel
;
return
isLogicValid
;
}
}
}
isLogicValid
=
false
;
}
return
isLogicValid
;
}
}
...
@@ -185,7 +173,7 @@ public class EntityModel {
...
@@ -185,7 +173,7 @@ public class EntityModel {
public
FieldModel
getLogicValidField
()
{
public
FieldModel
getLogicValidField
()
{
if
(
isLogicValid
&&
logicValidField
==
null
)
{
if
(
isLogicValid
()
&&
logicValidField
==
null
)
{
if
(
fields
!=
null
)
{
if
(
fields
!=
null
)
{
for
(
FieldModel
fieldModel
:
fields
)
{
for
(
FieldModel
fieldModel
:
fields
)
{
if
(
fieldModel
.
isLogicValidField
())
{
if
(
fieldModel
.
isLogicValidField
())
{
...
@@ -194,33 +182,24 @@ public class EntityModel {
...
@@ -194,33 +182,24 @@ public class EntityModel {
}
}
}
}
}
}
isLogicValid
=
false
;
}
}
return
logicValidField
;
return
logicValidField
;
}
}
private
String
validLogicValue
;
public
String
getValidLogicValue
()
public
String
getValidLogicValue
()
{
{
if
(
StringUtils
.
isEmpty
(
validLogicValue
))
String
validLogicValue
=
this
.
getEntity
().
getValidLogicValue
();
validLogicValue
=
this
.
getEntity
().
getValidLogicValue
();
if
(
StringUtils
.
isEmpty
(
validLogicValue
))
if
(
StringUtils
.
isEmpty
(
validLogicValue
))
validLogicValue
=
"1"
;
validLogicValue
=
"1"
;
return
validLogicValue
;
return
validLogicValue
;
}
}
private
String
invalidLogicValue
;
public
String
getInvalidLogicValue
()
public
String
getInvalidLogicValue
()
{
{
if
(
StringUtils
.
isEmpty
(
invalidLogicValue
))
String
invalidLogicValue
=
this
.
getEntity
().
getInvalidLogicValue
();
invalidLogicValue
=
this
.
getEntity
().
getInvalidLogicValue
();
if
(
StringUtils
.
isEmpty
(
invalidLogicValue
))
if
(
StringUtils
.
isEmpty
(
invalidLogicValue
))
invalidLogicValue
=
"0"
;
invalidLogicValue
=
"0"
;
return
invalidLogicValue
;
return
invalidLogicValue
;
...
@@ -233,7 +212,7 @@ public class EntityModel {
...
@@ -233,7 +212,7 @@ public class EntityModel {
public
FieldModel
getKeyField
()
{
public
FieldModel
getKeyField
()
{
if
(
fields
!=
null
&&
keyField
==
null
)
if
(
fields
!=
null
&&
keyField
==
null
)
for
(
FieldModel
fieldModel:
fields
)
for
(
FieldModel
fieldModel:
fields
)
if
(
fieldModel
.
isKeyField
())
{
if
(
fieldModel
.
isKey
DE
Field
())
{
keyField
=
fieldModel
;
keyField
=
fieldModel
;
return
keyField
;
return
keyField
;
}
}
...
@@ -258,7 +237,7 @@ public class EntityModel {
...
@@ -258,7 +237,7 @@ public class EntityModel {
public
List
<
FieldModel
>
getKeyFields
()
{
public
List
<
FieldModel
>
getKeyFields
()
{
if
(
this
.
getKeyField
()!=
null
&&
this
.
getKeyField
().
isPh
ysical
Field
())
{
if
(
this
.
getKeyField
()!=
null
&&
this
.
getKeyField
().
isPh
isicalDE
Field
())
{
List
<
FieldModel
>
keyFields
=
new
ArrayList
<>();
List
<
FieldModel
>
keyFields
=
new
ArrayList
<>();
keyFields
.
add
(
getKeyField
());
keyFields
.
add
(
getKeyField
());
return
keyFields
;
return
keyFields
;
...
@@ -329,12 +308,8 @@ public class EntityModel {
...
@@ -329,12 +308,8 @@ public class EntityModel {
@JSONField
(
serialize
=
false
)
@JsonIgnore
private
Map
<
String
,
POSchema
>
poSchemas
;
private
Map
<
String
,
POSchema
>
poSchemas
;
@JSONField
(
serialize
=
false
)
@JsonIgnore
public
POSchema
getDefaultPOSchema
()
public
POSchema
getDefaultPOSchema
()
{
{
return
getPOSchema
(
"default"
);
return
getPOSchema
(
"default"
);
...
@@ -374,18 +349,7 @@ public class EntityModel {
...
@@ -374,18 +349,7 @@ public class EntityModel {
return
null
;
return
null
;
}
}
private
DataObj
extParams
=
new
DataObj
();
public
EntityModel
set
(
String
key
,
Object
val
)
{
extParams
.
set
(
key
,
val
);
return
this
;
}
public
Object
get
(
String
key
)
{
return
key
;
}
public
String
getStringValue
(
String
key
,
String
defaultVal
)
public
String
getStringValue
(
String
key
,
String
defaultVal
)
{
{
...
...
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/model/FieldModel.java
浏览文件 @
224da2a8
...
@@ -18,35 +18,32 @@ import java.util.Set;
...
@@ -18,35 +18,32 @@ import java.util.Set;
@NoArgsConstructor
@NoArgsConstructor
@Accessors
(
chain
=
true
)
@Accessors
(
chain
=
true
)
@JsonIgnoreProperties
(
value
=
"handler"
)
@JsonIgnoreProperties
(
value
=
"handler"
)
public
class
FieldModel
{
public
class
FieldModel
extends
BaseModel
{
public
String
getCodeName
()
{
public
String
getCodeName
()
{
return
getField
().
getCodeName
();
return
getField
().
getCodeName
();
}
}
public
String
getFieldName
()
{
public
String
getFieldName
()
{
return
getField
().
getName
();
return
getField
().
getName
();
}
}
public
String
getColumnName
(){
return
getField
().
getName
();
}
public
String
getLogicName
()
{
public
String
getLogicName
()
{
return
getField
().
getLogicName
();
return
getField
().
getLogicName
();
}
}
public
Data
Type
getType
()
public
Prop
Type
getType
()
{
{
return
DataType
.
findTypeNam
e
(
this
.
getField
().
getStdDataType
());
return
PropType
.
findTyp
e
(
this
.
getField
().
getStdDataType
());
}
}
private
String
expression
;
private
String
expression
;
private
IPSDEField
field
;
public
IPSDEField
getField
()
{
return
(
IPSDEField
)
opt
;
}
private
RelationshipModel
reference
;
private
RelationshipModel
reference
;
...
@@ -54,45 +51,31 @@ public class FieldModel {
...
@@ -54,45 +51,31 @@ public class FieldModel {
private
String
refFieldCodeName
;
private
String
refFieldCodeName
;
public
boolean
isPhisicalDEField
()
@JsonIgnore
@JSONField
(
serialize
=
false
)
public
boolean
isPhysicalField
()
{
{
return
this
.
getField
().
isPhisicalDEField
();
return
this
.
getField
().
isPhisicalDEField
();
}
}
@JsonIgnore
public
boolean
isKeyDEField
()
@JSONField
(
serialize
=
false
)
public
boolean
isKeyField
()
{
{
return
this
.
getField
().
isKeyDEField
();
return
this
.
getField
().
isKeyDEField
();
}
}
@JsonIgnore
@JSONField
(
serialize
=
false
)
public
boolean
isLogicValidField
()
public
boolean
isLogicValidField
()
{
{
return
"LOGICVALID"
.
equals
(
this
.
getField
().
getPredefinedType
());
return
"LOGICVALID"
.
equals
(
this
.
getField
().
getPredefinedType
());
}
}
@JsonIgnore
@JSONField
(
serialize
=
false
)
public
boolean
isLastModifyField
()
public
boolean
isLastModifyField
()
{
{
return
"UPDATEDATE"
.
equals
(
this
.
getField
().
getPredefinedType
());
return
"UPDATEDATE"
.
equals
(
this
.
getField
().
getPredefinedType
());
}
}
@JsonIgnore
@JSONField
(
serialize
=
false
)
public
boolean
isCreateTimeField
()
public
boolean
isCreateTimeField
()
{
{
return
"CREATEDATE"
.
equals
(
this
.
getField
().
getPredefinedType
());
return
"CREATEDATE"
.
equals
(
this
.
getField
().
getPredefinedType
());
}
}
@JsonIgnore
@JSONField
(
serialize
=
false
)
public
boolean
isUnionKeyField
()
public
boolean
isUnionKeyField
()
{
{
return
!
StringUtils
.
isEmpty
(
this
.
getField
().
getUnionKeyValue
());
return
!
StringUtils
.
isEmpty
(
this
.
getField
().
getUnionKeyValue
());
...
@@ -133,13 +116,6 @@ public class FieldModel {
...
@@ -133,13 +116,6 @@ public class FieldModel {
}
}
private
DataObj
extParams
=
new
DataObj
();
public
FieldModel
set
(
String
key
,
Object
val
)
{
extParams
.
set
(
key
,
val
);
return
this
;
}
public
String
getStringValue
(
String
key
,
String
defaultVal
)
public
String
getStringValue
(
String
key
,
String
defaultVal
)
{
{
...
@@ -148,78 +124,9 @@ public class FieldModel {
...
@@ -148,78 +124,9 @@ public class FieldModel {
public
String
getColumnName
(
String
dsType
)
public
String
getColumnName
(
String
dsType
)
{
{
return
this
.
getStringValue
(
"column-"
+
dsType
.
toLowerCase
(),
get
Column
Name
());
return
this
.
getStringValue
(
"column-"
+
dsType
.
toLowerCase
(),
get
Field
Name
());
}
}
public
static
enum
DataType
{
UNKNOWN
(
0
,
"UNKNOWN"
,
"string"
,
"String"
),
BIGINT
(
1
,
"BIGINT"
,
"number"
,
"Long"
),
BINARY
(
2
,
"BINARY"
,
"string"
,
"String"
),
BIT
(
3
,
"BIT"
,
"boolean"
,
"Boolean"
),
CHAR
(
4
,
"CHAR"
,
"string"
,
"String"
),
DATETIME
(
5
,
"DATETIME"
,
"string"
,
"Timestamp"
),
DECIMAL
(
6
,
"DECIMAL"
,
"number"
,
"BigDecimal"
),
FLOAT
(
7
,
"FLOAT"
,
"number"
,
"BigDecimal"
),
IMAGE
(
8
,
"IMAGE"
,
"string"
,
"String"
),
INT
(
9
,
"INT"
,
"number"
,
"Integer"
),
MONEY
(
10
,
"MONEY"
,
"number"
,
"BigDecimal"
),
NCHAR
(
11
,
"NCHAR"
,
"string"
,
"String"
),
NTEXT
(
12
,
"NTEXT"
,
"string"
,
"String"
),
NVARCHAR
(
13
,
"NVARCHAR"
,
"string"
,
"String"
),
NUMERIC
(
14
,
"NUMERIC"
,
"number"
,
"BigDecimal"
),
REAL
(
15
,
"REAL"
,
"number"
,
"Float"
),
SMALLDATETIME
(
16
,
"SMALLDATETIME"
,
"string"
,
"Timestamp"
),
SMALLINT
(
17
,
"SMALLINT"
,
"number"
,
"Integer"
),
SMALLMONEY
(
18
,
"SMALLMONEY"
,
"number"
,
"BigDecimal"
),
SQL_VARIANT
(
19
,
"SQL_VARIANT"
,
"string"
,
"String"
),
SYSNAME
(
20
,
"SYSNAME"
,
"string"
,
"String"
),
TEXT
(
21
,
"TEXT"
,
"string"
,
"String"
),
TIMESTAMP
(
22
,
"TIMESTAMP"
,
"string"
,
"Timestamp"
),
TINYINT
(
23
,
"TINYINT"
,
"number"
,
"Integer"
),
VARBINARY
(
24
,
"VARBINARY"
,
"string"
,
"String"
),
VARCHAR
(
25
,
"VARCHAR"
,
"string"
,
"String"
),
UNIQUEIDENTIFIER
(
26
,
"UNIQUEIDENTIFIER"
,
"string"
,
"String"
),
DATE
(
27
,
"DATE"
,
"string"
,
"Timestamp"
),
TIME
(
28
,
"TIME"
,
"string"
,
"Timestamp"
);
public
final
int
code
;
public
final
String
name
;
public
final
String
prop
;
public
final
String
java
;
private
DataType
(
int
code
,
String
name
,
String
prop
,
String
java
)
{
this
.
code
=
code
;
this
.
name
=
name
;
this
.
prop
=
prop
;
this
.
java
=
java
;
}
public
int
getCode
()
{
return
code
;
}
public
String
getName
()
{
return
name
;
}
public
String
getProp
()
{
return
prop
;
}
public
String
getJava
()
{
return
java
;
}
public
static
DataType
findTypeName
(
Integer
type
)
{
for
(
DataType
userTypeEnum
:
DataType
.
values
())
{
if
(
userTypeEnum
.
getCode
()==
type
)
{
return
userTypeEnum
;
}
}
return
VARCHAR
;
}
}
...
...
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/model/LookupModel.java
浏览文件 @
224da2a8
...
@@ -19,39 +19,22 @@ import java.io.Serializable;
...
@@ -19,39 +19,22 @@ import java.io.Serializable;
@Setter
@Setter
@NoArgsConstructor
@NoArgsConstructor
@Accessors
(
chain
=
true
)
@Accessors
(
chain
=
true
)
@ApiModel
(
"lookup"
)
public
class
LookupModel
implements
Serializable
{
public
class
LookupModel
implements
Serializable
{
/**
* 标识
*/
@JSONField
(
name
=
"id"
)
@JsonProperty
(
"id"
)
@ApiModelProperty
(
"标识"
)
private
String
id
;
/**
/**
* 关系标识
* 关系标识
*/
*/
@JSONField
(
name
=
"relationId"
)
@JsonProperty
(
"relationId"
)
@ApiModelProperty
(
"关系标识"
)
private
String
relationid
;
private
String
relationid
;
/**
/**
* 属性名称
* 属性名称
*/
*/
@JSONField
(
name
=
"fieldName"
)
@JsonProperty
(
"fieldName"
)
@ApiModelProperty
(
"属性名称"
)
private
String
fieldname
;
private
String
fieldname
;
/**
/**
* 引用属性名称
* 引用属性名称
*/
*/
@JSONField
(
name
=
"refFieldName"
)
@JsonProperty
(
"refFieldName"
)
@ApiModelProperty
(
"引用属性名称"
)
private
String
reffieldname
;
private
String
reffieldname
;
...
...
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/model/POSchema.java
浏览文件 @
224da2a8
...
@@ -10,6 +10,7 @@ import lombok.Getter;
...
@@ -10,6 +10,7 @@ import lombok.Getter;
import
lombok.NoArgsConstructor
;
import
lombok.NoArgsConstructor
;
import
lombok.Setter
;
import
lombok.Setter
;
import
lombok.experimental.Accessors
;
import
lombok.experimental.Accessors
;
import
net.ibizsys.model.dataentity.IPSDataEntity
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
...
@@ -57,7 +58,7 @@ public class POSchema {
...
@@ -57,7 +58,7 @@ public class POSchema {
@JSONField
(
serialize
=
false
)
@JSONField
(
serialize
=
false
)
@JsonIgnore
@JsonIgnore
private
Object
node
;
private
IPSDataEntity
node
;
@JSONField
(
ordinal
=
7
)
@JSONField
(
ordinal
=
7
)
private
List
<
Column
>
columns
;
private
List
<
Column
>
columns
;
...
@@ -502,22 +503,20 @@ public class POSchema {
...
@@ -502,22 +503,20 @@ public class POSchema {
@JSONField
(
serialize
=
false
)
@JSONField
(
serialize
=
false
)
public
boolean
isText
()
public
boolean
isText
()
{
{
String
type
=
this
.
getType
().
toUpperCase
();
return
"String"
.
equalsIgnoreCase
(
PropType
.
findByDBType
(
type
).
java
);
return
type
.
indexOf
(
"TEXT"
)>=
0
||
type
.
indexOf
(
"CHAR"
)>=
0
||
type
.
indexOf
(
"LOB"
)>=
0
;
}
}
@JsonIgnore
@JsonIgnore
@JSONField
(
serialize
=
false
)
@JSONField
(
serialize
=
false
)
public
boolean
isNumber
()
public
boolean
isNumber
()
{
{
String
type
=
this
.
getType
().
toUpperCase
();
return
"BigDecimal"
.
equalsIgnoreCase
(
PropType
.
findByDBType
(
type
).
java
);
return
type
.
indexOf
(
"NUM"
)>=
0
||
type
.
indexOf
(
"FLOAT"
)>=
0
||
type
.
indexOf
(
"DOUBLE"
)>=
0
||
type
.
indexOf
(
"DECIMAL"
)>=
0
;
}
}
@JsonIgnore
@JsonIgnore
@JSONField
(
serialize
=
false
)
@JSONField
(
serialize
=
false
)
public
boolean
isInt
()
public
boolean
isInt
()
{
{
String
type
=
this
.
getType
().
toUpperCase
(
);
PropType
propType
=
PropType
.
findByDBType
(
type
);
return
type
.
indexOf
(
"INT"
)==
0
;
return
"Long"
.
equalsIgnoreCase
(
propType
.
java
)||
"Integer"
.
equalsIgnoreCase
(
propType
.
java
)
;
}
}
@JsonIgnore
@JsonIgnore
...
@@ -525,7 +524,7 @@ public class POSchema {
...
@@ -525,7 +524,7 @@ public class POSchema {
public
boolean
isDateTime
()
public
boolean
isDateTime
()
{
{
String
type
=
this
.
getType
().
toUpperCase
();
String
type
=
this
.
getType
().
toUpperCase
();
return
type
.
indexOf
(
"DATE"
)>=
0
||
type
.
indexOf
(
"TIME"
)>=
0
;
return
"Timestamp"
.
equalsIgnoreCase
(
PropType
.
findByDBType
(
type
).
java
)
;
}
}
@JSONField
(
ordinal
=
12
)
@JSONField
(
ordinal
=
12
)
...
...
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/model/PropType.java
0 → 100644
浏览文件 @
224da2a8
package
cn
.
ibizlab
.
codegen
.
model
;
public
enum
PropType
{
UNKNOWN
(
0
,
"UNKNOWN"
,
"string"
,
"String"
),
BIGINT
(
1
,
"BIGINT"
,
"number"
,
"Long"
),
BINARY
(
2
,
"BINARY"
,
"string"
,
"String"
),
BIT
(
3
,
"BIT"
,
"boolean"
,
"Boolean"
),
CHAR
(
4
,
"CHAR"
,
"string"
,
"String"
),
DATETIME
(
5
,
"DATETIME"
,
"string"
,
"Timestamp"
),
DECIMAL
(
6
,
"DECIMAL"
,
"number"
,
"BigDecimal"
),
FLOAT
(
7
,
"FLOAT"
,
"number"
,
"BigDecimal"
),
IMAGE
(
8
,
"IMAGE"
,
"string"
,
"String"
),
INT
(
9
,
"INT"
,
"number"
,
"Integer"
),
MONEY
(
10
,
"MONEY"
,
"number"
,
"BigDecimal"
),
NCHAR
(
11
,
"NCHAR"
,
"string"
,
"String"
),
NTEXT
(
12
,
"NTEXT"
,
"string"
,
"String"
),
NVARCHAR
(
13
,
"NVARCHAR"
,
"string"
,
"String"
),
NUMERIC
(
14
,
"NUMERIC"
,
"number"
,
"BigDecimal"
),
REAL
(
15
,
"REAL"
,
"number"
,
"Float"
),
SMALLDATETIME
(
16
,
"SMALLDATETIME"
,
"string"
,
"Timestamp"
),
SMALLINT
(
17
,
"SMALLINT"
,
"number"
,
"Integer"
),
SMALLMONEY
(
18
,
"SMALLMONEY"
,
"number"
,
"BigDecimal"
),
SQL_VARIANT
(
19
,
"SQL_VARIANT"
,
"string"
,
"String"
),
SYSNAME
(
20
,
"SYSNAME"
,
"string"
,
"String"
),
TEXT
(
21
,
"TEXT"
,
"string"
,
"String"
),
TIMESTAMP
(
22
,
"TIMESTAMP"
,
"string"
,
"Timestamp"
),
TINYINT
(
23
,
"TINYINT"
,
"number"
,
"Integer"
),
VARBINARY
(
24
,
"VARBINARY"
,
"string"
,
"String"
),
VARCHAR
(
25
,
"VARCHAR"
,
"string"
,
"String"
),
UNIQUEIDENTIFIER
(
26
,
"UNIQUEIDENTIFIER"
,
"string"
,
"String"
),
DATE
(
27
,
"DATE"
,
"string"
,
"Timestamp"
),
TIME
(
28
,
"TIME"
,
"string"
,
"Timestamp"
);
public
final
int
code
;
public
final
String
name
;
public
final
String
json
;
public
final
String
java
;
private
PropType
(
int
code
,
String
name
,
String
json
,
String
java
)
{
this
.
code
=
code
;
this
.
name
=
name
;
this
.
json
=
json
;
this
.
java
=
java
;
}
public
int
getCode
()
{
return
code
;
}
public
String
getName
()
{
return
name
;
}
public
String
getJson
()
{
return
json
;
}
public
String
getJava
()
{
return
java
;
}
public
static
PropType
findType
(
Integer
type
)
{
for
(
PropType
userTypeEnum
:
values
())
{
if
(
userTypeEnum
.
getCode
()==
type
)
{
return
userTypeEnum
;
}
}
return
PropType
.
VARCHAR
;
}
public
static
PropType
findByDBType
(
String
type
)
{
for
(
PropType
userTypeEnum
:
values
())
{
if
(
userTypeEnum
.
getName
()==
type
)
{
return
userTypeEnum
;
}
}
return
VARCHAR
;
}
}
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/model/RelationshipModel.java
浏览文件 @
224da2a8
...
@@ -14,8 +14,7 @@ import java.util.List;
...
@@ -14,8 +14,7 @@ import java.util.List;
@Setter
@Setter
@NoArgsConstructor
@NoArgsConstructor
@Accessors
(
chain
=
true
)
@Accessors
(
chain
=
true
)
@JsonIgnoreProperties
(
value
=
"handler"
)
public
class
RelationshipModel
extends
BaseModel
{
public
class
RelationshipModel
{
private
String
name
;
private
String
name
;
...
@@ -33,7 +32,11 @@ public class RelationshipModel {
...
@@ -33,7 +32,11 @@ public class RelationshipModel {
private
String
relationType
;
private
String
relationType
;
private
IPSDERBase
relation
;
public
IPSDERBase
getRelation
()
{
return
(
IPSDERBase
)
opt
;
}
private
List
<
FieldModel
>
fields
;
private
List
<
FieldModel
>
fields
;
...
...
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/model/SystemModel.java
0 → 100644
浏览文件 @
224da2a8
package
cn
.
ibizlab
.
codegen
.
model
;
public
class
SystemModel
{
}
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/model/TransUtils.java
浏览文件 @
224da2a8
...
@@ -124,7 +124,7 @@ public class TransUtils {
...
@@ -124,7 +124,7 @@ public class TransUtils {
Map
<
String
,
FieldModel
>
keyMap
=
new
LinkedHashMap
<>();
Map
<
String
,
FieldModel
>
keyMap
=
new
LinkedHashMap
<>();
Map
<
String
,
RelationshipModel
>
relationshipModelMap
=
new
LinkedHashMap
<>();
Map
<
String
,
RelationshipModel
>
relationshipModelMap
=
new
LinkedHashMap
<>();
if
(
entityModel
.
getKeyFields
()!=
null
)
entityModel
.
getKeyFields
().
forEach
(
model
->
keyMap
.
put
(
model
.
get
Column
Name
(),
model
));
if
(
entityModel
.
getKeyFields
()!=
null
)
entityModel
.
getKeyFields
().
forEach
(
model
->
keyMap
.
put
(
model
.
get
Field
Name
(),
model
));
int
order
=
1
;
int
order
=
1
;
for
(
FieldModel
fieldModel
:
entityModel
.
getFields
())
{
for
(
FieldModel
fieldModel
:
entityModel
.
getFields
())
{
...
@@ -188,7 +188,7 @@ public class TransUtils {
...
@@ -188,7 +188,7 @@ public class TransUtils {
}
}
}
}
if
(!
fieldModel
.
isPh
ysical
Field
())
if
(!
fieldModel
.
isPh
isicalDE
Field
())
poSchema
.
addTransient
(
column
.
setComputed
(
true
));
poSchema
.
addTransient
(
column
.
setComputed
(
true
));
else
else
poSchema
.
addColumn
(
column
);
poSchema
.
addColumn
(
column
);
...
...
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/templating/MustacheCollector.java
0 → 100644
浏览文件 @
224da2a8
//
// JMustache - A Java implementation of the Mustache templating language
// http://github.com/samskivert/jmustache/blob/master/LICENSE
package
cn
.
ibizlab
.
codegen
.
templating
;
import
cn.ibizlab.codegen.model.BaseModel
;
import
com.samskivert.mustache.BasicCollector
;
import
com.samskivert.mustache.Mustache
;
import
java.lang.reflect.Array
;
import
java.lang.reflect.Field
;
import
java.lang.reflect.Method
;
import
java.util.AbstractList
;
import
java.util.Iterator
;
import
java.util.LinkedHashSet
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.concurrent.ConcurrentHashMap
;
/**
* The default collector used by JMustache.
*/
public
class
MustacheCollector
extends
BasicCollector
{
@Override
public
Mustache
.
VariableFetcher
createFetcher
(
Object
ctx
,
String
name
)
{
Mustache
.
VariableFetcher
fetcher
=
super
.
createFetcher
(
ctx
,
name
);
if
(
fetcher
!=
null
)
return
fetcher
;
// first check for a getter which provides the value
Class
<?>
cclass
=
ctx
.
getClass
();
final
Method
m
=
getMethod
(
cclass
,
name
);
if
(
m
!=
null
)
{
return
new
Mustache
.
VariableFetcher
()
{
public
Object
get
(
Object
ctx
,
String
name
)
throws
Exception
{
return
m
.
invoke
(
ctx
);
}
};
}
// next check for a getter which provides the value
final
Field
f
=
getField
(
cclass
,
name
);
if
(
f
!=
null
)
{
return
new
Mustache
.
VariableFetcher
()
{
public
Object
get
(
Object
ctx
,
String
name
)
throws
Exception
{
return
f
.
get
(
ctx
);
}
};
}
// finally check for a default interface method which provides the value (this is left to
// last because it's much more expensive and hopefully something already matched above)
final
Method
im
=
getIfaceMethod
(
cclass
,
name
);
if
(
im
!=
null
)
{
return
new
Mustache
.
VariableFetcher
()
{
public
Object
get
(
Object
ctx
,
String
name
)
throws
Exception
{
return
im
.
invoke
(
ctx
);
}
};
}
if
(
ctx
instanceof
BaseModel
)
{
if
(((
BaseModel
)
ctx
).
getOpt
()!=
null
)
{
Class
<?>
cclass2
=
((
BaseModel
)
ctx
).
getOpt
().
getClass
();
final
Method
opt
=
getMethod
(
cclass2
,
name
);
if
(
opt
!=
null
)
{
return
new
Mustache
.
VariableFetcher
()
{
public
Object
get
(
Object
ctx
,
String
name
)
throws
Exception
{
return
opt
.
invoke
(((
BaseModel
)
ctx
).
getOpt
());
}
};
}
}
Object
val
=((
BaseModel
)
ctx
).
get
(
name
);
if
(
val
!=
null
)
{
return
new
Mustache
.
VariableFetcher
()
{
public
Object
get
(
Object
ctx
,
String
name
)
throws
Exception
{
return
val
;
}
};
}
}
return
null
;
}
@Override
public
<
K
,
V
>
Map
<
K
,
V
>
createFetcherCache
()
{
return
new
ConcurrentHashMap
<
K
,
V
>();
}
protected
Method
getMethod
(
Class
<?>
clazz
,
String
name
)
{
// first check up the superclass chain
for
(
Class
<?>
cc
=
clazz
;
cc
!=
null
&&
cc
!=
Object
.
class
;
cc
=
cc
.
getSuperclass
())
{
Method
m
=
getMethodOn
(
cc
,
name
);
if
(
m
!=
null
)
return
m
;
}
return
null
;
}
protected
Method
getIfaceMethod
(
Class
<?>
clazz
,
String
name
)
{
// enumerate the transitive closure of all interfaces implemented by clazz
Set
<
Class
<?>>
ifaces
=
new
LinkedHashSet
<
Class
<?>>();
for
(
Class
<?>
cc
=
clazz
;
cc
!=
null
&&
cc
!=
Object
.
class
;
cc
=
cc
.
getSuperclass
())
{
addIfaces
(
ifaces
,
cc
,
false
);
}
// now search those in the order that we found them
for
(
Class
<?>
iface
:
ifaces
)
{
Method
m
=
getMethodOn
(
iface
,
name
);
if
(
m
!=
null
)
return
m
;
}
return
null
;
}
private
void
addIfaces
(
Set
<
Class
<?>>
ifaces
,
Class
<?>
clazz
,
boolean
isIface
)
{
if
(
isIface
)
ifaces
.
add
(
clazz
);
for
(
Class
<?>
iface
:
clazz
.
getInterfaces
())
addIfaces
(
ifaces
,
iface
,
true
);
}
protected
Method
getMethodOn
(
Class
<?>
clazz
,
String
name
)
{
Method
m
;
try
{
m
=
clazz
.
getDeclaredMethod
(
name
);
if
(!
m
.
getReturnType
().
equals
(
void
.
class
))
return
makeAccessible
(
m
);
}
catch
(
Exception
e
)
{
// fall through
}
String
upperName
=
Character
.
toUpperCase
(
name
.
charAt
(
0
))
+
name
.
substring
(
1
);
try
{
m
=
clazz
.
getDeclaredMethod
(
"get"
+
upperName
);
if
(!
m
.
getReturnType
().
equals
(
void
.
class
))
return
makeAccessible
(
m
);
}
catch
(
Exception
e
)
{
// fall through
}
try
{
m
=
clazz
.
getDeclaredMethod
(
"is"
+
upperName
);
if
(
m
.
getReturnType
().
equals
(
boolean
.
class
)
||
m
.
getReturnType
().
equals
(
Boolean
.
class
))
return
makeAccessible
(
m
);
}
catch
(
Exception
e
)
{
// fall through
}
return
null
;
}
private
Method
makeAccessible
(
Method
m
)
{
if
(!
m
.
isAccessible
())
m
.
setAccessible
(
true
);
return
m
;
}
protected
Field
getField
(
Class
<?>
clazz
,
String
name
)
{
Field
f
;
try
{
f
=
clazz
.
getDeclaredField
(
name
);
if
(!
f
.
isAccessible
())
{
f
.
setAccessible
(
true
);
}
return
f
;
}
catch
(
Exception
e
)
{
// fall through
}
Class
<?>
sclass
=
clazz
.
getSuperclass
();
if
(
sclass
!=
Object
.
class
&&
sclass
!=
null
)
{
return
getField
(
clazz
.
getSuperclass
(),
name
);
}
return
null
;
}
}
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/templating/MustacheEngineAdapter.java
浏览文件 @
224da2a8
...
@@ -41,7 +41,7 @@ public class MustacheEngineAdapter implements TemplatingEngineAdapter {
...
@@ -41,7 +41,7 @@ public class MustacheEngineAdapter implements TemplatingEngineAdapter {
return
"mustache"
;
return
"mustache"
;
}
}
Mustache
.
Compiler
compiler
=
Mustache
.
compiler
();
Mustache
.
Compiler
compiler
=
Mustache
.
compiler
()
.
withCollector
(
new
MustacheCollector
())
;
/**
/**
* Compiles a template into a string
* Compiles a template into a string
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/pom.xml
浏览文件 @
224da2a8
...
@@ -10,6 +10,7 @@
...
@@ -10,6 +10,7 @@
<description></description>
<description></description>
<packaging>
pom
</packaging>
<packaging>
pom
</packaging>
{{>../{{projectName}}-util/pom.xml}}
<parent>
<parent>
<groupId>
{{packageName}}
</groupId>
<groupId>
{{packageName}}
</groupId>
<artifactId>
{{projectName}}-dependencies
</artifactId>
<artifactId>
{{projectName}}-dependencies
</artifactId>
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/{{projectName}}-core/src/main/java/{{packageName}}/{{modules}}/domain/{{entities}}.java
浏览文件 @
224da2a8
package
{{
packageName
}}.{{
module
}}.
domain
;
package
{{
packageName
}}.{{
module
}}.
domain
;
//{{entity.dsTypes}} {{entity.ds_types}} {{entity.dataAccCtrlArch}}
public
class
{{
entity
.
codeName
}}
public
class
{{
entity
.
codeName
}}
{
{
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录