Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
ghsby
o2oa
提交
5c495f82
o2oa
项目概览
ghsby
/
o2oa
落后 Fork 源项目 2880 个版本
Fork自
浙江兰德纵横网络技术股份有限公司 / o2oa
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
o2oa
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5c495f82
编写于
2月 18, 2019
作者:
R
roo00
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加动态表
上级
9ad6cc4d
变更
33
显示空白变更内容
内联
并排
Showing
33 changed file
with
740 addition
and
331 deletion
+740
-331
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/Business.java
...src/main/java/com/x/query/assemble/designer/Business.java
+19
-12
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/DynamicEntity.java
...ain/java/com/x/query/assemble/designer/DynamicEntity.java
+105
-125
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/DynamicEntityBuilder.java
...a/com/x/query/assemble/designer/DynamicEntityBuilder.java
+30
-27
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/jaxrs/statement/ActionExecute.java
...uery/assemble/designer/jaxrs/statement/ActionExecute.java
+17
-15
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/jaxrs/table/ActionBuildAll.java
...x/query/assemble/designer/jaxrs/table/ActionBuildAll.java
+6
-3
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/jaxrs/table/ActionCreate.java
...m/x/query/assemble/designer/jaxrs/table/ActionCreate.java
+3
-1
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/jaxrs/table/ActionEdit.java
...com/x/query/assemble/designer/jaxrs/table/ActionEdit.java
+3
-1
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/jaxrs/table/ActionListRowNext.java
...uery/assemble/designer/jaxrs/table/ActionListRowNext.java
+19
-7
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/jaxrs/table/ActionListRowPrev.java
...uery/assemble/designer/jaxrs/table/ActionListRowPrev.java
+37
-14
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/jaxrs/table/ActionListRowSelectWhere.java
...semble/designer/jaxrs/table/ActionListRowSelectWhere.java
+5
-5
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/jaxrs/table/ActionRowCountWhere.java
...ry/assemble/designer/jaxrs/table/ActionRowCountWhere.java
+4
-3
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/jaxrs/table/ActionRowDelete.java
.../query/assemble/designer/jaxrs/table/ActionRowDelete.java
+4
-3
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/jaxrs/table/ActionRowDeleteAll.java
...ery/assemble/designer/jaxrs/table/ActionRowDeleteAll.java
+77
-0
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/jaxrs/table/ActionRowDeleteBatch.java
...y/assemble/designer/jaxrs/table/ActionRowDeleteBatch.java
+76
-0
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/jaxrs/table/ActionRowGet.java
...m/x/query/assemble/designer/jaxrs/table/ActionRowGet.java
+3
-2
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/jaxrs/table/ActionRowInsert.java
.../query/assemble/designer/jaxrs/table/ActionRowInsert.java
+26
-8
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/jaxrs/table/ActionRowUpdate.java
.../query/assemble/designer/jaxrs/table/ActionRowUpdate.java
+5
-4
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/jaxrs/table/TableAction.java
...om/x/query/assemble/designer/jaxrs/table/TableAction.java
+32
-14
o2server/x_query_assemble_designer/src/test/java/com/x/query/assemble/designer/test/TestClient.java
...t/java/com/x/query/assemble/designer/test/TestClient.java
+48
-10
o2server/x_query_assemble_designer/src/test/resources/calculate数据格式.json
...y_assemble_designer/src/test/resources/calculate数据格式.json
+0
-0
o2server/x_query_assemble_designer/src/test/resources/runtime数据格式.json
...ery_assemble_designer/src/test/resources/runtime数据格式.json
+0
-0
o2server/x_query_assemble_designer/src/test/resources/table.json
...r/x_query_assemble_designer/src/test/resources/table.json
+182
-0
o2server/x_query_assemble_designer/src/test/resources/view数据格式_CMS.json
...ry_assemble_designer/src/test/resources/view数据格式_CMS.json
+0
-0
o2server/x_query_assemble_designer/src/test/resources/view数据格式_Platform.json
...semble_designer/src/test/resources/view数据格式_Platform.json
+0
-0
o2server/x_query_core_entity/src/main/java/com/x/query/core/entity/Query.java
...e_entity/src/main/java/com/x/query/core/entity/Query.java
+3
-3
o2server/x_query_core_entity/src/main/java/com/x/query/core/entity/Reveal.java
..._entity/src/main/java/com/x/query/core/entity/Reveal.java
+2
-2
o2server/x_query_core_entity/src/main/java/com/x/query/core/entity/Stat.java
...re_entity/src/main/java/com/x/query/core/entity/Stat.java
+2
-2
o2server/x_query_core_entity/src/main/java/com/x/query/core/entity/View.java
...re_entity/src/main/java/com/x/query/core/entity/View.java
+2
-2
o2server/x_query_core_entity/src/main/java/com/x/query/core/entity/neural/Entry.java
...y/src/main/java/com/x/query/core/entity/neural/Entry.java
+2
-2
o2server/x_query_core_entity/src/main/java/com/x/query/core/entity/neural/Model.java
...y/src/main/java/com/x/query/core/entity/neural/Model.java
+2
-2
o2server/x_query_core_entity/src/main/java/com/x/query/core/entity/schema/Statement.java
...c/main/java/com/x/query/core/entity/schema/Statement.java
+2
-2
o2server/x_query_core_entity/src/main/java/com/x/query/core/entity/schema/Table.java
...y/src/main/java/com/x/query/core/entity/schema/Table.java
+6
-15
o2server/x_query_core_express/src/main/java/com/x/query/core/express/plan/Plan.java
...ess/src/main/java/com/x/query/core/express/plan/Plan.java
+18
-47
未找到文件。
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/Business.java
浏览文件 @
5c495f82
...
...
@@ -93,8 +93,8 @@ public class Business {
public
boolean
editable
(
EffectivePerson
effectivePerson
,
Query
o
)
throws
Exception
{
boolean
result
=
false
;
if
(
effectivePerson
.
isManager
()
||
(
this
.
organization
().
person
().
hasRole
(
effectivePerson
,
OrganizationDefinition
.
QueryManager
)))
{
if
(
effectivePerson
.
isManager
()
||
(
this
.
organization
().
person
().
hasRole
(
effectivePerson
,
OrganizationDefinition
.
Manager
,
OrganizationDefinition
.
QueryManager
)))
{
result
=
true
;
}
if
(!
result
&&
(
null
!=
o
))
{
...
...
@@ -113,7 +113,7 @@ public class Business {
}
if
(!
result
)
{
if
(
effectivePerson
.
isManager
()
||
(
this
.
organization
().
person
().
hasRole
(
effectivePerson
,
OrganizationDefinition
.
QueryManager
)))
{
OrganizationDefinition
.
Manager
,
OrganizationDefinition
.
QueryManager
)))
{
result
=
true
;
}
if
(!
result
)
{
...
...
@@ -138,21 +138,27 @@ public class Business {
public
boolean
editable
(
EffectivePerson
effectivePerson
,
Table
o
)
throws
Exception
{
boolean
result
=
false
;
if
(
effectivePerson
.
isManager
()
||
(
this
.
organization
().
person
().
hasRole
(
effectivePerson
,
OrganizationDefinition
.
QueryManager
)))
{
if
(
effectivePerson
.
isManager
()
||
(
this
.
organization
().
person
().
hasRole
(
effectivePerson
,
OrganizationDefinition
.
Manager
,
OrganizationDefinition
.
QueryManager
)))
{
result
=
true
;
}
if
(!
result
&&
(
null
!=
o
))
{
if
(
ListTools
.
isEmpty
(
o
.
getEditPersonList
())
&&
ListTools
.
isEmpty
(
o
.
getEditUnitList
()))
{
result
=
true
;
if
(!
result
)
{
if
(
effectivePerson
.
isUser
(
o
.
getEditPersonList
()))
{
result
=
true
;
}
if
(!
result
&&
ListTools
.
isNotEmpty
(
o
.
getEditUnitList
()))
{
List
<
String
>
units
=
this
.
organization
().
unit
().
listWithPerson
(
effectivePerson
.
getDistinguishedName
());
List
<
String
>
units
=
this
.
organization
().
unit
()
.
listWithPerson
(
effectivePerson
.
getDistinguishedName
());
if
(
ListTools
.
containsAny
(
units
,
o
.
getEditUnitList
()))
{
result
=
true
;
}
}
}
}
}
return
result
;
}
...
...
@@ -164,7 +170,8 @@ public class Business {
}
if
(!
result
)
{
if
(
effectivePerson
.
isManager
()
||
(
this
.
organization
().
person
().
hasRole
(
effectivePerson
,
OrganizationDefinition
.
QueryManager
))
||
(
this
.
organization
().
person
().
hasRole
(
effectivePerson
,
OrganizationDefinition
.
Manager
,
OrganizationDefinition
.
QueryManager
))
||
effectivePerson
.
isUser
(
o
.
getExecutePersonList
()))
{
result
=
true
;
}
...
...
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/DynamicEntity.java
浏览文件 @
5c495f82
...
...
@@ -17,32 +17,30 @@ public class DynamicEntity extends GsonPropertyObject {
private
String
name
;
private
List
<
StringField
>
stringFields
;
private
List
<
IntegerField
>
integerFields
;
private
List
<
LongField
>
longFields
;
private
List
<
DoubleField
>
doubleFields
;
private
List
<
BooleanField
>
booleanFields
;
private
List
<
DateField
>
dateFields
;
private
List
<
TimeField
>
timeFields
;
private
List
<
DateTimeField
>
dateTimeFields
;
private
List
<
StringField
>
listStringFields
;
private
List
<
IntegerField
>
listIntegerFields
;
private
List
<
LongField
>
listLongFields
;
private
List
<
DoubleField
>
listDoubleFields
;
private
List
<
BooleanField
>
listBooleanFields
;
private
List
<
DateField
>
listDateFields
;
private
List
<
TimeField
>
listTimeFields
;
private
List
<
DateTimeField
>
listDateTimeFields
;
private
List
<
StringLobField
>
stringLobFields
;
private
List
<
StringMapField
>
stringMapFields
;
private
List
<
StringField
>
stringFieldList
;
private
List
<
IntegerField
>
integerFieldList
;
private
List
<
LongField
>
longFieldList
;
private
List
<
DoubleField
>
doubleFieldList
;
private
List
<
BooleanField
>
booleanFieldList
;
private
List
<
DateField
>
dateFieldList
;
private
List
<
TimeField
>
timeFieldList
;
private
List
<
DateTimeField
>
dateTimeFieldList
;
private
List
<
StringField
>
listStringFieldList
;
private
List
<
IntegerField
>
listIntegerFieldList
;
private
List
<
LongField
>
listLongFieldList
;
private
List
<
DoubleField
>
listDoubleFieldList
;
private
List
<
BooleanField
>
listBooleanFieldList
;
private
List
<
DateTimeField
>
listDateTimeFieldList
;
private
List
<
StringLobField
>
stringLobFieldList
;
private
List
<
StringMapField
>
stringMapFieldList
;
public
void
addStringField
(
String
name
,
String
description
)
{
StringField
field
=
new
StringField
();
field
.
setName
(
name
);
field
.
setDescription
(
description
);
this
.
stringField
s
.
add
(
field
);
this
.
stringField
List
.
add
(
field
);
}
public
String
tableName
()
throws
Exception
{
...
...
@@ -71,26 +69,24 @@ public class DynamicEntity extends GsonPropertyObject {
}
public
DynamicEntity
()
{
this
.
stringFields
=
new
ArrayList
<>();
this
.
integerFields
=
new
ArrayList
<>();
this
.
longFields
=
new
ArrayList
<>();
this
.
doubleFields
=
new
ArrayList
<>();
this
.
booleanFields
=
new
ArrayList
<>();
this
.
dateFields
=
new
ArrayList
<>();
this
.
timeFields
=
new
ArrayList
<>();
this
.
dateTimeFields
=
new
ArrayList
<>();
this
.
listStringFields
=
new
ArrayList
<>();
this
.
listIntegerFields
=
new
ArrayList
<>();
this
.
listLongFields
=
new
ArrayList
<>();
this
.
listDoubleFields
=
new
ArrayList
<>();
this
.
listBooleanFields
=
new
ArrayList
<>();
this
.
listDateFields
=
new
ArrayList
<>();
this
.
listTimeFields
=
new
ArrayList
<>();
this
.
listDateTimeFields
=
new
ArrayList
<>();
this
.
stringLobFields
=
new
ArrayList
<>();
this
.
stringMapFields
=
new
ArrayList
<>();
this
.
stringFieldList
=
new
ArrayList
<>();
this
.
integerFieldList
=
new
ArrayList
<>();
this
.
longFieldList
=
new
ArrayList
<>();
this
.
doubleFieldList
=
new
ArrayList
<>();
this
.
booleanFieldList
=
new
ArrayList
<>();
this
.
dateFieldList
=
new
ArrayList
<>();
this
.
timeFieldList
=
new
ArrayList
<>();
this
.
dateTimeFieldList
=
new
ArrayList
<>();
this
.
listStringFieldList
=
new
ArrayList
<>();
this
.
listIntegerFieldList
=
new
ArrayList
<>();
this
.
listLongFieldList
=
new
ArrayList
<>();
this
.
listDoubleFieldList
=
new
ArrayList
<>();
this
.
listBooleanFieldList
=
new
ArrayList
<>();
this
.
listDateTimeFieldList
=
new
ArrayList
<>();
this
.
stringLobFieldList
=
new
ArrayList
<>();
this
.
stringMapFieldList
=
new
ArrayList
<>();
}
public
DynamicEntity
(
String
name
)
{
...
...
@@ -153,156 +149,140 @@ public class DynamicEntity extends GsonPropertyObject {
public
static
class
StringMapField
extends
Field
{
}
public
List
<
StringField
>
getStringFields
()
{
return
stringFields
;
}
public
void
setStringFields
(
List
<
StringField
>
stringFields
)
{
this
.
stringFields
=
stringFields
;
}
public
List
<
IntegerField
>
getIntegerFields
()
{
return
integerFields
;
}
public
void
setIntegerFields
(
List
<
IntegerField
>
integerFields
)
{
this
.
integerFields
=
integerFields
;
}
public
List
<
LongField
>
getLongFields
()
{
return
longFields
;
public
String
getName
()
{
return
name
;
}
public
void
set
LongFields
(
List
<
LongField
>
longFields
)
{
this
.
longFields
=
longFields
;
public
void
set
Name
(
String
name
)
{
this
.
name
=
name
;
}
public
List
<
DoubleField
>
getDoubleFields
()
{
return
doubleFields
;
public
List
<
StringField
>
getStringFieldList
()
{
return
stringFieldList
;
}
public
void
set
DoubleFields
(
List
<
DoubleField
>
doubleFields
)
{
this
.
doubleFields
=
doubleFields
;
public
void
set
StringFieldList
(
List
<
StringField
>
stringFieldList
)
{
this
.
stringFieldList
=
stringFieldList
;
}
public
List
<
BooleanField
>
getBooleanFields
()
{
return
booleanFields
;
public
List
<
IntegerField
>
getIntegerFieldList
()
{
return
integerFieldList
;
}
public
void
set
BooleanFields
(
List
<
BooleanField
>
booleanFields
)
{
this
.
booleanFields
=
booleanFields
;
public
void
set
IntegerFieldList
(
List
<
IntegerField
>
integerFieldList
)
{
this
.
integerFieldList
=
integerFieldList
;
}
public
List
<
DateField
>
getDateFields
()
{
return
dateFields
;
public
List
<
LongField
>
getLongFieldList
()
{
return
longFieldList
;
}
public
void
set
DateFields
(
List
<
DateField
>
dateFields
)
{
this
.
dateFields
=
dateFields
;
public
void
set
LongFieldList
(
List
<
LongField
>
longFieldList
)
{
this
.
longFieldList
=
longFieldList
;
}
public
List
<
TimeField
>
getTimeFields
()
{
return
timeFields
;
public
List
<
DoubleField
>
getDoubleFieldList
()
{
return
doubleFieldList
;
}
public
void
set
TimeFields
(
List
<
TimeField
>
timeFields
)
{
this
.
timeFields
=
timeFields
;
public
void
set
DoubleFieldList
(
List
<
DoubleField
>
doubleFieldList
)
{
this
.
doubleFieldList
=
doubleFieldList
;
}
public
List
<
DateTimeField
>
getDateTimeFields
()
{
return
dateTimeFields
;
public
List
<
BooleanField
>
getBooleanFieldList
()
{
return
booleanFieldList
;
}
public
void
set
DateTimeFields
(
List
<
DateTimeField
>
dateTimeFields
)
{
this
.
dateTimeFields
=
dateTimeFields
;
public
void
set
BooleanFieldList
(
List
<
BooleanField
>
booleanFieldList
)
{
this
.
booleanFieldList
=
booleanFieldList
;
}
public
List
<
StringField
>
getListStringFields
()
{
return
listStringFields
;
public
List
<
DateField
>
getDateFieldList
()
{
return
dateFieldList
;
}
public
void
set
ListStringFields
(
List
<
StringField
>
listStringFields
)
{
this
.
listStringFields
=
listStringFields
;
public
void
set
DateFieldList
(
List
<
DateField
>
dateFieldList
)
{
this
.
dateFieldList
=
dateFieldList
;
}
public
List
<
IntegerField
>
getListIntegerFields
()
{
return
listIntegerFields
;
public
List
<
TimeField
>
getTimeFieldList
()
{
return
timeFieldList
;
}
public
void
set
ListIntegerFields
(
List
<
IntegerField
>
listIntegerFields
)
{
this
.
listIntegerFields
=
listIntegerFields
;
public
void
set
TimeFieldList
(
List
<
TimeField
>
timeFieldList
)
{
this
.
timeFieldList
=
timeFieldList
;
}
public
List
<
LongField
>
getListLongFields
()
{
return
listLongFields
;
public
List
<
DateTimeField
>
getDateTimeFieldList
()
{
return
dateTimeFieldList
;
}
public
void
set
ListLongFields
(
List
<
LongField
>
listLongFields
)
{
this
.
listLongFields
=
listLongFields
;
public
void
set
DateTimeFieldList
(
List
<
DateTimeField
>
dateTimeFieldList
)
{
this
.
dateTimeFieldList
=
dateTimeFieldList
;
}
public
List
<
DoubleField
>
getListDoubleFields
()
{
return
list
DoubleFields
;
public
List
<
StringField
>
getListStringFieldList
()
{
return
list
StringFieldList
;
}
public
void
setList
DoubleFields
(
List
<
DoubleField
>
listDoubleFields
)
{
this
.
list
DoubleFields
=
listDoubleFields
;
public
void
setList
StringFieldList
(
List
<
StringField
>
listStringFieldList
)
{
this
.
list
StringFieldList
=
listStringFieldList
;
}
public
List
<
BooleanField
>
getListBooleanFields
()
{
return
list
BooleanFields
;
public
List
<
IntegerField
>
getListIntegerFieldList
()
{
return
list
IntegerFieldList
;
}
public
void
setList
BooleanFields
(
List
<
BooleanField
>
listBooleanFields
)
{
this
.
list
BooleanFields
=
listBooleanFields
;
public
void
setList
IntegerFieldList
(
List
<
IntegerField
>
listIntegerFieldList
)
{
this
.
list
IntegerFieldList
=
listIntegerFieldList
;
}
public
List
<
DateField
>
getListDateFields
()
{
return
list
DateFields
;
public
List
<
LongField
>
getListLongFieldList
()
{
return
list
LongFieldList
;
}
public
void
setList
DateFields
(
List
<
DateField
>
listDateFields
)
{
this
.
list
DateFields
=
listDateFields
;
public
void
setList
LongFieldList
(
List
<
LongField
>
listLongFieldList
)
{
this
.
list
LongFieldList
=
listLongFieldList
;
}
public
List
<
TimeField
>
getListTimeFields
()
{
return
list
TimeFields
;
public
List
<
DoubleField
>
getListDoubleFieldList
()
{
return
list
DoubleFieldList
;
}
public
void
setList
TimeFields
(
List
<
TimeField
>
listTimeFields
)
{
this
.
list
TimeFields
=
listTimeFields
;
public
void
setList
DoubleFieldList
(
List
<
DoubleField
>
listDoubleFieldList
)
{
this
.
list
DoubleFieldList
=
listDoubleFieldList
;
}
public
List
<
DateTimeField
>
getListDateTimeFields
()
{
return
list
DateTimeFields
;
public
List
<
BooleanField
>
getListBooleanFieldList
()
{
return
list
BooleanFieldList
;
}
public
void
setList
DateTimeFields
(
List
<
DateTimeField
>
listDateTimeFields
)
{
this
.
list
DateTimeFields
=
listDateTimeFields
;
public
void
setList
BooleanFieldList
(
List
<
BooleanField
>
listBooleanFieldList
)
{
this
.
list
BooleanFieldList
=
listBooleanFieldList
;
}
public
List
<
StringLobField
>
getStringLobFields
()
{
return
stringLobFields
;
public
List
<
DateTimeField
>
getListDateTimeFieldList
()
{
return
listDateTimeFieldList
;
}
public
void
set
StringLobFields
(
List
<
StringLobField
>
stringLobFields
)
{
this
.
stringLobFields
=
stringLobFields
;
public
void
set
ListDateTimeFieldList
(
List
<
DateTimeField
>
listDateTimeFieldList
)
{
this
.
listDateTimeFieldList
=
listDateTimeFieldList
;
}
public
List
<
String
MapField
>
getStringMapFields
()
{
return
string
MapFields
;
public
List
<
String
LobField
>
getStringLobFieldList
()
{
return
string
LobFieldList
;
}
public
void
setString
MapFields
(
List
<
StringMapField
>
stringMapFields
)
{
this
.
string
MapFields
=
stringMapFields
;
public
void
setString
LobFieldList
(
List
<
StringLobField
>
stringLobFieldList
)
{
this
.
string
LobFieldList
=
stringLobFieldList
;
}
public
String
getName
()
{
return
name
;
public
List
<
StringMapField
>
getStringMapFieldList
()
{
return
stringMapFieldList
;
}
public
void
set
Name
(
String
name
)
{
this
.
name
=
name
;
public
void
set
StringMapFieldList
(
List
<
StringMapField
>
stringMapFieldList
)
{
this
.
stringMapFieldList
=
stringMapFieldList
;
}
}
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/DynamicEntityBuilder.java
浏览文件 @
5c495f82
...
...
@@ -2,6 +2,7 @@ package com.x.query.assemble.designer;
import
java.io.File
;
import
java.util.Date
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
javax.lang.model.element.Modifier
;
...
...
@@ -153,31 +154,31 @@ public class DynamicEntityBuilder {
}
private
void
createStringFields
(
Builder
builder
)
{
for
(
StringField
field
:
ListTools
.
trim
(
dynamicEntity
.
getStringField
s
(),
true
,
true
))
{
for
(
StringField
field
:
ListTools
.
trim
(
dynamicEntity
.
getStringField
List
(),
true
,
true
))
{
this
.
createField
(
builder
,
field
,
String
.
class
);
}
}
private
void
createIntegerFields
(
Builder
builder
)
{
for
(
IntegerField
field
:
ListTools
.
trim
(
dynamicEntity
.
getIntegerField
s
(),
true
,
true
))
{
for
(
IntegerField
field
:
ListTools
.
trim
(
dynamicEntity
.
getIntegerField
List
(),
true
,
true
))
{
this
.
createField
(
builder
,
field
,
Integer
.
class
);
}
}
private
void
createLongFields
(
Builder
builder
)
{
for
(
LongField
field
:
ListTools
.
trim
(
dynamicEntity
.
getLongField
s
(),
true
,
true
))
{
for
(
LongField
field
:
ListTools
.
trim
(
dynamicEntity
.
getLongField
List
(),
true
,
true
))
{
this
.
createField
(
builder
,
field
,
Long
.
class
);
}
}
private
void
createDoubleFields
(
Builder
builder
)
{
for
(
DoubleField
field
:
ListTools
.
trim
(
dynamicEntity
.
getDoubleField
s
(),
true
,
true
))
{
for
(
DoubleField
field
:
ListTools
.
trim
(
dynamicEntity
.
getDoubleField
List
(),
true
,
true
))
{
this
.
createField
(
builder
,
field
,
Double
.
class
);
}
}
private
void
createBooleanFields
(
Builder
builder
)
{
for
(
BooleanField
field
:
ListTools
.
trim
(
dynamicEntity
.
getBooleanField
s
(),
true
,
true
))
{
for
(
BooleanField
field
:
ListTools
.
trim
(
dynamicEntity
.
getBooleanField
List
(),
true
,
true
))
{
this
.
createField
(
builder
,
field
,
Boolean
.
class
);
}
}
...
...
@@ -212,7 +213,7 @@ public class DynamicEntityBuilder {
}
private
void
createDateFields
(
Builder
builder
)
{
for
(
DateField
field
:
ListTools
.
trim
(
dynamicEntity
.
getDateField
s
(),
true
,
true
))
{
for
(
DateField
field
:
ListTools
.
trim
(
dynamicEntity
.
getDateField
List
(),
true
,
true
))
{
this
.
createDateField
(
builder
,
field
);
}
}
...
...
@@ -223,8 +224,7 @@ public class DynamicEntityBuilder {
.
addMember
(
"name"
,
"ColumnNamePrefix + "
+
field
.
fieldName
()).
build
();
AnnotationSpec
temporal
=
AnnotationSpec
.
builder
(
Temporal
.
class
)
.
addMember
(
"value"
,
"javax.persistence.Temporal.DATE"
).
build
();
.
addMember
(
"value"
,
"javax.persistence.TemporalType.DATE"
).
build
();
FieldSpec
fieldSpec
=
FieldSpec
.
builder
(
Date
.
class
,
field
.
getName
(),
Modifier
.
PRIVATE
)
.
addAnnotation
(
this
.
fieldDescribe
(
field
)).
addAnnotation
(
this
.
index
(
field
))
.
addAnnotation
(
this
.
checkPersist
(
field
)).
addAnnotation
(
column
).
addAnnotation
(
temporal
).
build
();
...
...
@@ -239,7 +239,7 @@ public class DynamicEntityBuilder {
}
private
void
createTimeFields
(
Builder
builder
)
{
for
(
TimeField
field
:
ListTools
.
trim
(
dynamicEntity
.
getTimeField
s
(),
true
,
true
))
{
for
(
TimeField
field
:
ListTools
.
trim
(
dynamicEntity
.
getTimeField
List
(),
true
,
true
))
{
this
.
createTimeField
(
builder
,
field
);
}
}
...
...
@@ -250,7 +250,7 @@ public class DynamicEntityBuilder {
.
addMember
(
"name"
,
"ColumnNamePrefix + "
+
field
.
fieldName
()).
build
();
AnnotationSpec
temporal
=
AnnotationSpec
.
builder
(
Temporal
.
class
)
.
addMember
(
"value"
,
"javax.persistence.Temporal.TIME"
).
build
();
.
addMember
(
"value"
,
"javax.persistence.Temporal
Type
.TIME"
).
build
();
FieldSpec
fieldSpec
=
FieldSpec
.
builder
(
Date
.
class
,
field
.
getName
(),
Modifier
.
PRIVATE
)
.
addAnnotation
(
this
.
fieldDescribe
(
field
)).
addAnnotation
(
this
.
index
(
field
))
...
...
@@ -266,7 +266,7 @@ public class DynamicEntityBuilder {
}
private
void
createDateTimeFields
(
Builder
builder
)
{
for
(
DateTimeField
field
:
ListTools
.
trim
(
dynamicEntity
.
getDateTimeField
s
(),
true
,
true
))
{
for
(
DateTimeField
field
:
ListTools
.
trim
(
dynamicEntity
.
getDateTimeField
List
(),
true
,
true
))
{
this
.
createDateTimeField
(
builder
,
field
);
}
}
...
...
@@ -277,7 +277,7 @@ public class DynamicEntityBuilder {
.
addMember
(
"name"
,
"ColumnNamePrefix + "
+
field
.
fieldName
()).
build
();
AnnotationSpec
temporal
=
AnnotationSpec
.
builder
(
Temporal
.
class
)
.
addMember
(
"value"
,
"javax.persistence.Temporal.TIMESTAMP"
).
build
();
.
addMember
(
"value"
,
"javax.persistence.Temporal
Type
.TIMESTAMP"
).
build
();
FieldSpec
fieldSpec
=
FieldSpec
.
builder
(
Date
.
class
,
field
.
getName
(),
Modifier
.
PRIVATE
)
.
addAnnotation
(
this
.
fieldDescribe
(
field
)).
addAnnotation
(
this
.
index
(
field
))
...
...
@@ -293,37 +293,37 @@ public class DynamicEntityBuilder {
}
private
void
createListStringFields
(
Builder
builder
)
{
for
(
StringField
field
:
ListTools
.
trim
(
dynamicEntity
.
getListStringField
s
(),
true
,
true
))
{
for
(
StringField
field
:
ListTools
.
trim
(
dynamicEntity
.
getListStringField
List
(),
true
,
true
))
{
this
.
createListFields
(
builder
,
field
,
String
.
class
);
}
}
private
void
createListIntegerFields
(
Builder
builder
)
{
for
(
IntegerField
field
:
ListTools
.
trim
(
dynamicEntity
.
getListIntegerField
s
(),
true
,
true
))
{
for
(
IntegerField
field
:
ListTools
.
trim
(
dynamicEntity
.
getListIntegerField
List
(),
true
,
true
))
{
this
.
createListFields
(
builder
,
field
,
Integer
.
class
);
}
}
private
void
createListLongFields
(
Builder
builder
)
{
for
(
LongField
field
:
ListTools
.
trim
(
dynamicEntity
.
getListLongField
s
(),
true
,
true
))
{
for
(
LongField
field
:
ListTools
.
trim
(
dynamicEntity
.
getListLongField
List
(),
true
,
true
))
{
this
.
createListFields
(
builder
,
field
,
Long
.
class
);
}
}
private
void
createListDoubleFields
(
Builder
builder
)
{
for
(
DoubleField
field
:
ListTools
.
trim
(
dynamicEntity
.
getListDoubleField
s
(),
true
,
true
))
{
for
(
DoubleField
field
:
ListTools
.
trim
(
dynamicEntity
.
getListDoubleField
List
(),
true
,
true
))
{
this
.
createListFields
(
builder
,
field
,
Double
.
class
);
}
}
private
void
createListBooleanFields
(
Builder
builder
)
{
for
(
BooleanField
field
:
ListTools
.
trim
(
dynamicEntity
.
getListBooleanField
s
(),
true
,
true
))
{
for
(
BooleanField
field
:
ListTools
.
trim
(
dynamicEntity
.
getListBooleanField
List
(),
true
,
true
))
{
this
.
createListFields
(
builder
,
field
,
Boolean
.
class
);
}
}
private
void
createListDateTimeFields
(
Builder
builder
)
{
for
(
BooleanField
field
:
ListTools
.
trim
(
dynamicEntity
.
getListBooleanFields
(),
true
,
true
))
{
for
(
DateTimeField
field
:
ListTools
.
trim
(
dynamicEntity
.
getListDateTimeFieldList
(),
true
,
true
))
{
this
.
createListFields
(
builder
,
field
,
Date
.
class
);
}
}
...
...
@@ -336,7 +336,7 @@ public class DynamicEntityBuilder {
// + IndexNameMiddle + groupList_FIELDNAME + JoinIndexNameSuffix))
// @ElementIndex(name = TABLE + IndexNameMiddle + groupList_FIELDNAME + ElementIndexNameSuffix)
// @PersistentCollection(fetch = FetchType.EAGER)
// @OrderColumn(name =
PersistenceProperties.orderColumn
)
// @OrderColumn(name =
ORDERCOLUMNCOLUMN
)
// @ElementColumn(length = JpaObject.length_id, name = ColumnNamePrefix + groupList_FIELDNAME)
// @CheckPersist(allowEmpty = true, citationExists = @CitationExist(type = Group.class))
// private List<String> groupList;
...
...
@@ -354,8 +354,8 @@ public class DynamicEntityBuilder {
AnnotationSpec
persistentCollection
=
AnnotationSpec
.
builder
(
PersistentCollection
.
class
)
.
addMember
(
"fetch"
,
"javax.persistence.FetchType.EAGER"
).
build
();
AnnotationSpec
orderColumn
=
AnnotationSpec
.
builder
(
OrderColumn
.
class
)
.
addMember
(
"name"
,
"com.x.organization.core.entity.AbstractPersistenceProperties.orderColumn"
).
build
();
AnnotationSpec
orderColumn
=
AnnotationSpec
.
builder
(
OrderColumn
.
class
)
.
addMember
(
"name"
,
"ORDERCOLUMNCOLUMN"
)
.
build
();
AnnotationSpec
elementColumn
=
AnnotationSpec
.
builder
(
ElementColumn
.
class
).
addMember
(
"length"
,
"length_255B"
)
.
addMember
(
"name"
,
"ColumnNamePrefix + "
+
field
.
fieldName
()).
build
();
...
...
@@ -378,7 +378,7 @@ public class DynamicEntityBuilder {
}
private
void
createStringLobFields
(
Builder
builder
)
{
for
(
StringLobField
field
:
ListTools
.
trim
(
dynamicEntity
.
getStringLobField
s
(),
true
,
true
))
{
for
(
StringLobField
field
:
ListTools
.
trim
(
dynamicEntity
.
getStringLobField
List
(),
true
,
true
))
{
this
.
createStringLobField
(
builder
,
field
);
}
}
...
...
@@ -413,7 +413,7 @@ public class DynamicEntityBuilder {
}
private
void
createStringMapFields
(
Builder
builder
)
{
for
(
StringMapField
field
:
ListTools
.
trim
(
dynamicEntity
.
getStringMapField
s
(),
true
,
true
))
{
for
(
StringMapField
field
:
ListTools
.
trim
(
dynamicEntity
.
getStringMapField
List
(),
true
,
true
))
{
this
.
createStringMapField
(
builder
,
field
);
}
}
...
...
@@ -454,16 +454,19 @@ public class DynamicEntityBuilder {
AnnotationSpec
keyIndex
=
AnnotationSpec
.
builder
(
KeyIndex
.
class
)
.
addMember
(
"name"
,
"TABLE + IndexNameMiddle + "
+
field
.
fieldName
()
+
" + KeyIndexNameSuffix"
).
build
();
FieldSpec
fieldSpec
=
FieldSpec
.
builder
(
String
.
class
,
field
.
getName
(),
Modifier
.
PRIVATE
)
ClassName
type
=
ClassName
.
get
(
String
.
class
);
ClassName
map
=
ClassName
.
get
(
LinkedHashMap
.
class
);
TypeName
map_type
=
ParameterizedTypeName
.
get
(
map
,
type
,
type
);
FieldSpec
fieldSpec
=
FieldSpec
.
builder
(
map_type
,
field
.
getName
(),
Modifier
.
PRIVATE
)
.
addAnnotation
(
this
.
fieldDescribe
(
field
)).
addAnnotation
(
persistentMap
).
addAnnotation
(
containerTable
)
.
addAnnotation
(
keyColumn
).
addAnnotation
(
elementColumn
).
addAnnotation
(
elementIndex
)
.
addAnnotation
(
keyIndex
).
build
();
MethodSpec
get
=
MethodSpec
.
methodBuilder
(
"get"
+
StringUtils
.
capitalize
(
field
.
getName
()))
.
addModifiers
(
Modifier
.
PUBLIC
).
returns
(
String
.
class
).
addStatement
(
"return this."
+
field
.
getName
())
.
build
();
.
addModifiers
(
Modifier
.
PUBLIC
).
returns
(
map_type
).
addStatement
(
"return this."
+
field
.
getName
()).
build
();
MethodSpec
set
=
MethodSpec
.
methodBuilder
(
"set"
+
StringUtils
.
capitalize
(
field
.
getName
()))
.
addModifiers
(
Modifier
.
PUBLIC
).
returns
(
void
.
class
).
addParameter
(
String
.
class
,
field
.
getName
())
.
addModifiers
(
Modifier
.
PUBLIC
).
returns
(
void
.
class
).
addParameter
(
map_type
,
field
.
getName
())
.
addStatement
(
"this."
+
field
.
getName
()
+
" = "
+
field
.
getName
()).
build
();
builder
.
addField
(
this
.
fieldName
(
field
)).
addField
(
fieldSpec
).
addMethod
(
get
).
addMethod
(
set
);
...
...
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/jaxrs/statement/ActionExecute.java
浏览文件 @
5c495f82
package
com.x.query.assemble.designer.jaxrs.statement
;
import
java.util.Map
;
import
java.util.Map.Entry
;
import
javax.persistence.EntityManager
;
...
...
@@ -8,14 +9,15 @@ import javax.persistence.Query;
import
org.apache.commons.lang3.StringUtils
;
import
com.google.gson.JsonElement
;
import
com.google.gson.reflect.TypeToken
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.project.exception.ExceptionAccessDenied
;
import
com.x.base.core.project.exception.ExceptionEntityNotExist
;
import
com.x.base.core.project.gson.XGsonBuilder
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.scripting.AbstractRuntime
;
import
com.x.base.core.project.scripting.ScriptingEngine
;
import
com.x.query.assemble.designer.Business
;
import
com.x.query.assemble.designer.DynamicEntity
;
...
...
@@ -44,43 +46,43 @@ class ActionExecute extends BaseAction {
throw
new
ExceptionEntityNotExist
(
statement
.
getTable
(),
Table
.
class
);
}
Wi
wi
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
Map
<
String
,
Object
>
parameter
=
XGsonBuilder
.
instance
().
fromJson
(
jsonElement
,
new
TypeToken
<
Map
<
String
,
Object
>>()
{
}.
getType
());
this
.
beforeScript
(
business
,
statement
,
wi
);
this
.
beforeScript
(
business
,
effectivePerson
,
statement
,
parameter
);
DynamicEntity
dynamicEntity
=
new
DynamicEntity
(
table
.
getName
());
EntityManager
em
=
emc
.
get
((
Class
<
JpaObject
>)
Class
.
forName
(
dynamicEntity
.
className
()));
Query
query
=
em
.
createQuery
(
statement
.
getData
());
for
(
Entry
<
String
,
Object
>
en
:
wi
.
getParameter
()
.
entrySet
())
{
for
(
Entry
<
String
,
Object
>
en
:
parameter
.
entrySet
())
{
query
.
setParameter
(
en
.
getKey
(),
en
.
getValue
());
}
Object
data
=
query
.
getResultList
();
if
(
StringUtils
.
isNotBlank
(
statement
.
getAfterScriptText
()))
{
this
.
initScriptingEngine
(
business
);
this
.
initScriptingEngine
(
business
,
effectivePerson
);
scriptingEngine
.
bindingData
(
data
);
data
=
scriptingEngine
.
eval
(
statement
.
get
Before
ScriptText
());
data
=
scriptingEngine
.
eval
(
statement
.
get
After
ScriptText
());
}
result
.
setData
(
data
);
return
result
;
}
}
private
void
beforeScript
(
Business
business
,
Statement
statement
,
Wi
wi
)
throws
Exception
{
private
void
beforeScript
(
Business
business
,
EffectivePerson
effectivePerson
,
Statement
statement
,
Map
<
String
,
Object
>
parameter
)
throws
Exception
{
if
(
StringUtils
.
isNotBlank
(
statement
.
getBeforeScriptText
()))
{
this
.
initScriptingEngine
(
business
);
scriptingEngine
.
bindingParameter
(
wi
);
this
.
initScriptingEngine
(
business
,
effectivePerson
);
scriptingEngine
.
bindingParameter
(
parameter
);
scriptingEngine
.
eval
(
statement
.
getBeforeScriptText
());
}
}
private
void
initScriptingEngine
(
Business
business
)
{
private
void
initScriptingEngine
(
Business
business
,
EffectivePerson
effectivePerson
)
{
if
(
null
==
this
.
scriptingEngine
)
{
this
.
scriptingEngine
=
business
.
createScriptEngine
();
}
}
public
static
class
Wi
extends
AbstractRuntime
{
this
.
scriptingEngine
=
business
.
createScriptEngine
().
bindingEffectivePerson
(
effectivePerson
);
}
}
}
\ No newline at end of file
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/jaxrs/table/ActionBuild.java
→
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/jaxrs/table/ActionBuild
All
.java
浏览文件 @
5c495f82
...
...
@@ -36,11 +36,11 @@ import com.x.query.assemble.designer.DynamicEntityBuilder;
import
com.x.query.core.entity.schema.Enhance
;
import
com.x.query.core.entity.schema.Table
;
class
ActionBuild
extends
BaseAction
{
class
ActionBuild
All
extends
BaseAction
{
private
static
final
String
DOT_JAR
=
".jar"
;
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
ActionBuild
.
class
);
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
ActionBuild
All
.
class
);
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
...
...
@@ -104,6 +104,7 @@ class ActionBuild extends BaseAction {
}
private
void
enhance
()
throws
Exception
{
File
commandJavaFile
=
null
;
if
(
SystemUtils
.
IS_OS_AIX
)
{
commandJavaFile
=
new
File
(
Config
.
dir_jvm_aix
(),
"bin/java"
);
...
...
@@ -126,7 +127,9 @@ class ActionBuild extends BaseAction {
logger
.
debug
(
"enhance command:{}."
,
command
);
Runtime
.
getRuntime
().
exec
(
command
);
Process
process
=
Runtime
.
getRuntime
().
exec
(
command
);
process
.
waitFor
();
}
public
static
class
Wo
extends
WrapBoolean
{
...
...
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/jaxrs/table/ActionCreate.java
浏览文件 @
5c495f82
...
...
@@ -19,6 +19,7 @@ import com.x.base.core.project.gson.XGsonBuilder;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.jaxrs.WoId
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.query.assemble.designer.Business
;
import
com.x.query.assemble.designer.DynamicEntity
;
import
com.x.query.core.entity.schema.Table
;
...
...
@@ -64,7 +65,8 @@ class ActionCreate extends BaseAction {
private
static
final
long
serialVersionUID
=
-
5237741099036357033L
;
static
WrapCopier
<
Wi
,
Table
>
copier
=
WrapCopierFactory
.
wi
(
Wi
.
class
,
Table
.
class
,
null
,
JpaObject
.
FieldsUnmodify
);
ListTools
.
toList
(
JpaObject
.
FieldsUnmodify
,
Table
.
creatorPerson_FIELDNAME
,
Table
.
lastUpdatePerson_FIELDNAME
,
Table
.
lastUpdateTime_FIELDNAME
));
}
}
\ No newline at end of file
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/jaxrs/table/ActionEdit.java
浏览文件 @
5c495f82
...
...
@@ -20,6 +20,7 @@ import com.x.base.core.project.gson.XGsonBuilder;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.jaxrs.WoId
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.query.assemble.designer.Business
;
import
com.x.query.assemble.designer.DynamicEntity
;
import
com.x.query.core.entity.schema.Statement
;
...
...
@@ -69,6 +70,7 @@ class ActionEdit extends BaseAction {
private
static
final
long
serialVersionUID
=
-
5237741099036357033L
;
static
WrapCopier
<
Wi
,
Table
>
copier
=
WrapCopierFactory
.
wi
(
Wi
.
class
,
Table
.
class
,
null
,
JpaObject
.
FieldsUnmodify
);
ListTools
.
toList
(
JpaObject
.
FieldsUnmodify
,
Table
.
creatorPerson_FIELDNAME
,
Table
.
lastUpdatePerson_FIELDNAME
,
Table
.
lastUpdateTime_FIELDNAME
));
}
}
\ No newline at end of file
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/jaxrs/table/ActionListRowNext.java
浏览文件 @
5c495f82
...
...
@@ -4,6 +4,7 @@ import java.util.ArrayList;
import
java.util.List
;
import
javax.persistence.EntityManager
;
import
javax.persistence.Query
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -30,6 +31,7 @@ class ActionListRowNext extends BaseAction {
ActionResult
<
List
<
JsonObject
>>
execute
(
EffectivePerson
effectivePerson
,
String
tableFlag
,
String
id
,
Integer
count
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
ActionResult
<
List
<
JsonObject
>>
result
=
new
ActionResult
<>();
logger
.
debug
(
effectivePerson
,
"table:{}, id:{}, count:{}."
,
tableFlag
,
id
,
count
);
Business
business
=
new
Business
(
emc
);
...
...
@@ -50,19 +52,29 @@ class ActionListRowNext extends BaseAction {
sequence
=
o
.
getSequence
();
}
}
String
sql
=
"select o from "
+
cls
.
getName
()
+
" o"
;
List
<
String
>
fields
=
JpaObject
.
singularAttributeField
(
cls
,
true
,
true
);
fields
.
add
(
JpaObject
.
sequence_FIELDNAME
);
List
<
String
>
selects
=
new
ArrayList
<>();
for
(
String
str
:
fields
)
{
selects
.
add
(
"o."
+
str
);
}
String
sql
=
"select "
+
StringUtils
.
join
(
selects
,
", "
)
+
" from "
+
cls
.
getName
()
+
" o"
;
Long
rank
=
0L
;
if
(
null
!=
sequence
)
{
sql
+=
" where o.
sequence > '"
+
sequence
+
"'
"
;
rank
=
emc
.
count
LessThanOrEqualToDesc
(
cls
,
JpaObject
.
sequence_FIELDNAME
,
sequence
);
sql
+=
" where o.
"
+
JpaObject
.
sequence_FIELDNAME
+
" < ?1
"
;
rank
=
emc
.
count
GreaterThanOrEqualTo
(
cls
,
JpaObject
.
sequence_FIELDNAME
,
sequence
);
}
sql
+=
" order by o."
+
JpaObject
.
sequence_FIELDNAME
+
" DESC"
;
List
<?
extends
JpaObject
>
list
=
em
.
createQuery
(
sql
,
cls
)
.
setMaxResults
(
Math
.
max
(
Math
.
min
(
count
,
list_max
),
list_min
)).
getResultList
();
Query
query
=
em
.
createQuery
(
sql
,
Object
[].
class
);
if
(
null
!=
sequence
)
{
query
.
setParameter
(
1
,
sequence
);
}
List
<
Object
[]>
list
=
query
.
setMaxResults
(
Math
.
max
(
Math
.
min
(
count
,
list_max
),
list_min
)).
getResultList
();
List
<
JsonObject
>
wos
=
new
ArrayList
<>();
result
.
setCount
(
emc
.
count
(
cls
));
for
(
JpaObject
jpa
:
list
)
{
JsonObject
jsonObject
=
XGsonBuilder
.
instance
().
toJsonTree
(
jpa
).
getAsJsonObject
();
for
(
Object
[]
os
:
list
)
{
JsonObject
jsonObject
=
XGsonBuilder
.
instance
().
toJsonTree
(
JpaObject
.
cast
(
cls
,
fields
,
os
))
.
getAsJsonObject
();
jsonObject
.
getAsJsonObject
().
addProperty
(
"rank"
,
++
rank
);
wos
.
add
(
jsonObject
);
}
...
...
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/jaxrs/table/ActionListRowPrev.java
浏览文件 @
5c495f82
...
...
@@ -5,6 +5,7 @@ import java.util.Collections;
import
java.util.List
;
import
javax.persistence.EntityManager
;
import
javax.persistence.Query
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -31,6 +32,7 @@ class ActionListRowPrev extends BaseAction {
ActionResult
<
List
<
JsonObject
>>
execute
(
EffectivePerson
effectivePerson
,
String
tableFlag
,
String
id
,
Integer
count
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
ActionResult
<
List
<
JsonObject
>>
result
=
new
ActionResult
<>();
logger
.
debug
(
effectivePerson
,
"table:{}, id:{}, count:{}."
,
tableFlag
,
id
,
count
);
Business
business
=
new
Business
(
emc
);
...
...
@@ -51,22 +53,43 @@ class ActionListRowPrev extends BaseAction {
sequence
=
o
.
getSequence
();
}
}
String
sql
=
"select o from "
+
cls
.
getName
()
+
" o"
;
List
<
String
>
fields
=
JpaObject
.
singularAttributeField
(
cls
,
true
,
true
);
fields
.
add
(
JpaObject
.
sequence_FIELDNAME
);
List
<
String
>
selects
=
new
ArrayList
<>();
for
(
String
str
:
fields
)
{
selects
.
add
(
"o."
+
str
);
}
result
.
setCount
(
emc
.
count
(
cls
));
String
sql
=
"select "
+
StringUtils
.
join
(
selects
,
", "
)
+
" from "
+
cls
.
getName
()
+
" o"
;
Long
rank
=
0L
;
List
<
JsonObject
>
wos
=
new
ArrayList
<>();
if
(
null
!=
sequence
)
{
sql
+=
" where o.sequence < '"
+
sequence
+
"'"
;
rank
=
emc
.
countLessThanDesc
(
cls
,
JpaObject
.
sequence_FIELDNAME
,
sequence
);
sql
+=
" where o."
+
JpaObject
.
sequence_FIELDNAME
+
" > ?1 order by o."
+
JpaObject
.
sequence_FIELDNAME
+
" ASC"
;
rank
=
emc
.
countGreaterThan
(
cls
,
JpaObject
.
sequence_FIELDNAME
,
sequence
);
Query
query
=
em
.
createQuery
(
sql
,
Object
[].
class
);
query
.
setParameter
(
1
,
sequence
);
List
<
Object
[]>
list
=
query
.
setMaxResults
(
Math
.
max
(
Math
.
min
(
count
,
list_max
),
list_min
))
.
getResultList
();
for
(
Object
[]
os
:
list
)
{
JsonObject
jsonObject
=
XGsonBuilder
.
instance
().
toJsonTree
(
JpaObject
.
cast
(
cls
,
fields
,
os
))
.
getAsJsonObject
();
jsonObject
.
getAsJsonObject
().
addProperty
(
"rank"
,
rank
--);
wos
.
add
(
jsonObject
);
}
sql
+=
" order by o."
+
JpaObject
.
sequence_FIELDNAME
+
" DESC"
;
List
<?
extends
JpaObject
>
list
=
em
.
createQuery
(
sql
,
cls
)
.
setMaxResults
(
Math
.
max
(
Math
.
min
(
count
,
list_max
),
list_min
)).
getResultList
();
List
<
JsonObject
>
wos
=
new
ArrayList
<>();
result
.
setCount
(
emc
.
count
(
cls
));
for
(
JpaObject
jpa
:
list
)
{
JsonObject
jsonObject
=
XGsonBuilder
.
instance
().
toJsonTree
(
jpa
).
getAsJsonObject
();
}
else
{
sql
+=
" order by o."
+
JpaObject
.
sequence_FIELDNAME
+
" ASC"
;
rank
=
result
.
getCount
();
Query
query
=
em
.
createQuery
(
sql
,
Object
[].
class
);
List
<
Object
[]>
list
=
query
.
setMaxResults
(
Math
.
max
(
Math
.
min
(
count
,
list_max
),
list_min
))
.
getResultList
();
for
(
Object
[]
os
:
list
)
{
JsonObject
jsonObject
=
XGsonBuilder
.
instance
().
toJsonTree
(
JpaObject
.
cast
(
cls
,
fields
,
os
))
.
getAsJsonObject
();
jsonObject
.
getAsJsonObject
().
addProperty
(
"rank"
,
rank
--);
wos
.
add
(
jsonObject
);
}
}
Collections
.
reverse
(
wos
);
result
.
setData
(
wos
);
return
result
;
...
...
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/jaxrs/table/ActionListRowSelectWhere.java
浏览文件 @
5c495f82
...
...
@@ -19,10 +19,9 @@ import com.x.query.core.entity.schema.Table;
class
ActionListRowSelectWhere
extends
BaseAction
{
ActionResult
<
List
<
Object
>>
execute
(
EffectivePerson
effectivePerson
,
String
tableFlag
,
String
where
)
throws
Exception
{
ActionResult
<
List
<?>>
execute
(
EffectivePerson
effectivePerson
,
String
tableFlag
,
String
where
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
ActionResult
<
List
<
Object
>>
result
=
new
ActionResult
<>();
ActionResult
<
List
<
?
>>
result
=
new
ActionResult
<>();
Table
table
=
emc
.
flag
(
tableFlag
,
Table
.
class
);
Business
business
=
new
Business
(
emc
);
if
(
null
==
table
)
{
...
...
@@ -32,14 +31,15 @@ class ActionListRowSelectWhere extends BaseAction {
throw
new
ExceptionAccessDenied
(
effectivePerson
,
table
);
}
DynamicEntity
dynamicEntity
=
new
DynamicEntity
(
table
.
getName
());
@SuppressWarnings
(
"unchecked"
)
Class
<?
extends
JpaObject
>
clz
=
(
Class
<
JpaObject
>)
Class
.
forName
(
dynamicEntity
.
className
());
EntityManager
em
=
emc
.
get
(
clz
);
String
sql
=
"SELECT o FROM "
+
clz
.
getName
()
+
" o"
;
if
(
StringUtils
.
isNotBlank
(
where
)
&&
(!
StringUtils
.
equals
(
where
,
EMPTY_SYMBOL
)))
{
sql
+=
" where ("
+
where
+
")"
;
}
List
<?
extends
Object
>
list
=
em
.
createQuery
(
sql
).
getResultList
();
result
.
setData
(
(
List
<
Object
>)
list
);
List
<?>
list
=
em
.
createQuery
(
sql
).
getResultList
();
result
.
setData
(
list
);
return
result
;
}
}
...
...
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/jaxrs/table/ActionRowCountWhere.java
浏览文件 @
5c495f82
...
...
@@ -31,9 +31,10 @@ class ActionRowCountWhere extends BaseAction {
throw
new
ExceptionAccessDenied
(
effectivePerson
,
table
);
}
DynamicEntity
dynamicEntity
=
new
DynamicEntity
(
table
.
getName
());
Class
<?
extends
JpaObject
>
clz
=
(
Class
<
JpaObject
>)
Class
.
forName
(
dynamicEntity
.
className
());
EntityManager
em
=
emc
.
get
(
clz
);
String
sql
=
"SELECT count(o) FROM "
+
clz
.
getName
()
+
" o"
;
@SuppressWarnings
(
"unchecked"
)
Class
<?
extends
JpaObject
>
cls
=
(
Class
<
JpaObject
>)
Class
.
forName
(
dynamicEntity
.
className
());
EntityManager
em
=
emc
.
get
(
cls
);
String
sql
=
"SELECT count(o) FROM "
+
cls
.
getName
()
+
" o"
;
if
(
StringUtils
.
isNotBlank
(
where
)
&&
(!
StringUtils
.
equals
(
where
,
EMPTY_SYMBOL
)))
{
sql
+=
" where ("
+
where
+
")"
;
}
...
...
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/jaxrs/table/ActionRowDelete.java
浏览文件 @
5c495f82
...
...
@@ -25,12 +25,13 @@ class ActionRowDelete extends BaseAction {
throw
new
ExceptionAccessDenied
(
effectivePerson
,
table
);
}
DynamicEntity
dynamicEntity
=
new
DynamicEntity
(
table
.
getName
());
Class
<?
extends
JpaObject
>
clz
=
(
Class
<
JpaObject
>)
Class
.
forName
(
dynamicEntity
.
className
());
JpaObject
o
=
emc
.
find
(
id
,
clz
);
@SuppressWarnings
(
"unchecked"
)
Class
<?
extends
JpaObject
>
cls
=
(
Class
<
JpaObject
>)
Class
.
forName
(
dynamicEntity
.
className
());
JpaObject
o
=
emc
.
find
(
id
,
cls
);
Wo
wo
=
new
Wo
();
wo
.
setValue
(
false
);
if
(
null
!=
o
)
{
emc
.
beginTransaction
(
cl
z
);
emc
.
beginTransaction
(
cl
s
);
emc
.
remove
(
o
);
emc
.
commit
();
wo
.
setValue
(
true
);
...
...
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/jaxrs/table/ActionRowDeleteAll.java
0 → 100644
浏览文件 @
5c495f82
package
com.x.query.assemble.designer.jaxrs.table
;
import
java.util.List
;
import
javax.persistence.EntityManager
;
import
javax.persistence.Query
;
import
javax.persistence.criteria.CriteriaBuilder
;
import
javax.persistence.criteria.CriteriaQuery
;
import
javax.persistence.criteria.Root
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.project.exception.ExceptionAccessDenied
;
import
com.x.base.core.project.exception.ExceptionEntityNotExist
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.jaxrs.WrapLong
;
import
com.x.query.assemble.designer.Business
;
import
com.x.query.assemble.designer.DynamicEntity
;
import
com.x.query.core.entity.schema.Table
;
class
ActionRowDeleteAll
extends
BaseAction
{
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
String
tableFlag
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
Table
table
=
emc
.
flag
(
tableFlag
,
Table
.
class
);
Business
business
=
new
Business
(
emc
);
if
(
null
==
table
)
{
throw
new
ExceptionEntityNotExist
(
tableFlag
,
Table
.
class
);
}
if
(!
business
.
editable
(
effectivePerson
,
table
))
{
throw
new
ExceptionAccessDenied
(
effectivePerson
,
table
);
}
DynamicEntity
dynamicEntity
=
new
DynamicEntity
(
table
.
getName
());
@SuppressWarnings
(
"unchecked"
)
Class
<?
extends
JpaObject
>
cls
=
(
Class
<
JpaObject
>)
Class
.
forName
(
dynamicEntity
.
className
());
List
<
String
>
ids
=
null
;
Long
count
=
0L
;
do
{
ids
=
this
.
listIds
(
business
,
cls
);
if
(!
ids
.
isEmpty
())
{
emc
.
beginTransaction
(
cls
);
count
+=
this
.
delete
(
business
,
cls
,
ids
);
emc
.
commit
();
}
}
while
(!
ids
.
isEmpty
());
Wo
wo
=
new
Wo
();
wo
.
setValue
(
count
);
result
.
setData
(
wo
);
return
result
;
}
}
private
<
T
extends
JpaObject
>
List
<
String
>
listIds
(
Business
business
,
Class
<
T
>
cls
)
throws
Exception
{
EntityManager
em
=
business
.
entityManagerContainer
().
get
(
cls
);
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
Root
<
T
>
root
=
cq
.
from
(
cls
);
List
<
String
>
os
=
em
.
createQuery
(
cq
.
select
(
root
.
get
(
JpaObject
.
id_FIELDNAME
))).
setMaxResults
(
2000
)
.
getResultList
();
return
os
;
}
private
<
T
extends
JpaObject
>
Integer
delete
(
Business
business
,
Class
<
T
>
cls
,
List
<
String
>
ids
)
throws
Exception
{
EntityManager
em
=
business
.
entityManagerContainer
().
get
(
cls
);
Query
query
=
em
.
createQuery
(
"delete from "
+
cls
.
getName
()
+
" o where o.id in :ids"
);
query
.
setParameter
(
"ids"
,
ids
);
return
query
.
executeUpdate
();
}
public
static
class
Wo
extends
WrapLong
{
}
}
\ No newline at end of file
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/jaxrs/table/ActionRowDeleteBatch.java
0 → 100644
浏览文件 @
5c495f82
package
com.x.query.assemble.designer.jaxrs.table
;
import
java.util.List
;
import
javax.persistence.EntityManager
;
import
javax.persistence.criteria.CriteriaBuilder
;
import
javax.persistence.criteria.CriteriaDelete
;
import
javax.persistence.criteria.Predicate
;
import
javax.persistence.criteria.Root
;
import
com.google.gson.JsonElement
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.project.exception.ExceptionAccessDenied
;
import
com.x.base.core.project.exception.ExceptionEntityNotExist
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.jaxrs.WrapIdList
;
import
com.x.base.core.project.jaxrs.WrapLong
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.query.assemble.designer.Business
;
import
com.x.query.assemble.designer.DynamicEntity
;
import
com.x.query.core.entity.schema.Table
;
class
ActionRowDeleteBatch
extends
BaseAction
{
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
String
tableFlag
,
JsonElement
jsonElement
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
Table
table
=
emc
.
flag
(
tableFlag
,
Table
.
class
);
Business
business
=
new
Business
(
emc
);
if
(
null
==
table
)
{
throw
new
ExceptionEntityNotExist
(
tableFlag
,
Table
.
class
);
}
if
(!
business
.
editable
(
effectivePerson
,
table
))
{
throw
new
ExceptionAccessDenied
(
effectivePerson
,
table
);
}
DynamicEntity
dynamicEntity
=
new
DynamicEntity
(
table
.
getName
());
@SuppressWarnings
(
"unchecked"
)
Class
<?
extends
JpaObject
>
cls
=
(
Class
<
JpaObject
>)
Class
.
forName
(
dynamicEntity
.
className
());
Wi
wi
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
Long
count
=
0L
;
if
(
ListTools
.
isNotEmpty
(
wi
.
getIdList
()))
{
for
(
List
<
String
>
ids
:
ListTools
.
batch
(
wi
.
getIdList
(),
2000
))
{
emc
.
beginTransaction
(
cls
);
count
+=
this
.
delete
(
business
,
cls
,
ids
);
emc
.
commit
();
}
}
Wo
wo
=
new
Wo
();
wo
.
setValue
(
count
);
result
.
setData
(
wo
);
return
result
;
}
}
private
<
T
extends
JpaObject
>
Integer
delete
(
Business
business
,
Class
<
T
>
cls
,
List
<
String
>
ids
)
throws
Exception
{
EntityManager
em
=
business
.
entityManagerContainer
().
get
(
cls
);
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaDelete
<
T
>
cd
=
cb
.
createCriteriaDelete
(
cls
);
Root
<
T
>
root
=
cd
.
from
(
cls
);
Predicate
p
=
cb
.
isMember
(
root
.
get
(
JpaObject
.
id_FIELDNAME
),
cb
.
literal
(
ids
));
return
em
.
createQuery
(
cd
.
where
(
p
)).
executeUpdate
();
}
public
static
class
Wi
extends
WrapIdList
{
}
public
static
class
Wo
extends
WrapLong
{
}
}
\ No newline at end of file
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/jaxrs/table/ActionRowGet.java
浏览文件 @
5c495f82
...
...
@@ -24,8 +24,9 @@ class ActionRowGet extends BaseAction {
throw
new
ExceptionAccessDenied
(
effectivePerson
,
table
);
}
DynamicEntity
dynamicEntity
=
new
DynamicEntity
(
table
.
getName
());
Class
<?
extends
JpaObject
>
clz
=
(
Class
<
JpaObject
>)
Class
.
forName
(
dynamicEntity
.
className
());
JpaObject
o
=
emc
.
find
(
id
,
clz
);
@SuppressWarnings
(
"unchecked"
)
Class
<?
extends
JpaObject
>
cls
=
(
Class
<
JpaObject
>)
Class
.
forName
(
dynamicEntity
.
className
());
JpaObject
o
=
emc
.
find
(
id
,
cls
);
result
.
setData
(
o
);
return
result
;
}
...
...
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/jaxrs/table/ActionRowInsert.java
浏览文件 @
5c495f82
package
com.x.query.assemble.designer.jaxrs.table
;
import
java.util.ArrayList
;
import
java.util.List
;
import
com.google.gson.JsonElement
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.entity.annotation.CheckPersistType
;
import
com.x.base.core.project.exception.ExceptionAccessDenied
;
import
com.x.base.core.project.exception.ExceptionEntityNotExist
;
import
com.x.base.core.project.gson.XGsonBuilder
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.jaxrs.W
oId
;
import
com.x.base.core.project.jaxrs.W
rapBoolean
;
import
com.x.query.assemble.designer.Business
;
import
com.x.query.assemble.designer.DynamicEntity
;
import
com.x.query.core.entity.schema.Table
;
...
...
@@ -28,19 +31,34 @@ class ActionRowInsert extends BaseAction {
throw
new
ExceptionAccessDenied
(
effectivePerson
,
table
);
}
DynamicEntity
dynamicEntity
=
new
DynamicEntity
(
table
.
getName
());
Class
<?
extends
JpaObject
>
clz
=
(
Class
<
JpaObject
>)
Class
.
forName
(
dynamicEntity
.
className
());
JpaObject
o
=
XGsonBuilder
.
instance
().
fromJson
(
jsonElement
,
clz
);
emc
.
beginTransaction
(
clz
);
emc
.
persist
(
o
);
@SuppressWarnings
(
"unchecked"
)
Class
<?
extends
JpaObject
>
cls
=
(
Class
<
JpaObject
>)
Class
.
forName
(
dynamicEntity
.
className
());
List
<
Object
>
os
=
new
ArrayList
<>();
if
(
jsonElement
.
isJsonArray
())
{
jsonElement
.
getAsJsonArray
().
forEach
(
o
->
{
os
.
add
(
gson
.
fromJson
(
o
,
cls
));
});
}
else
if
(
jsonElement
.
isJsonObject
())
{
os
.
add
(
gson
.
fromJson
(
jsonElement
,
cls
));
}
emc
.
beginTransaction
(
cls
);
for
(
Object
o
:
os
)
{
emc
.
persist
((
JpaObject
)
o
,
CheckPersistType
.
all
);
}
emc
.
commit
();
Wo
wo
=
new
Wo
();
wo
.
setId
(
o
.
getId
());
if
(
os
.
isEmpty
())
{
wo
.
setValue
(
false
);
}
else
{
wo
.
setValue
(
true
);
}
result
.
setData
(
wo
);
return
result
;
}
}
public
static
class
Wo
extends
W
oId
{
public
static
class
Wo
extends
W
rapBoolean
{
}
...
...
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/jaxrs/table/ActionRowUpdate.java
浏览文件 @
5c495f82
...
...
@@ -29,14 +29,15 @@ class ActionRowUpdate extends BaseAction {
throw
new
ExceptionAccessDenied
(
effectivePerson
,
table
);
}
DynamicEntity
dynamicEntity
=
new
DynamicEntity
(
table
.
getName
());
Class
<?
extends
JpaObject
>
clz
=
(
Class
<
JpaObject
>)
Class
.
forName
(
dynamicEntity
.
className
());
JpaObject
o
=
emc
.
find
(
id
,
clz
);
@SuppressWarnings
(
"unchecked"
)
Class
<?
extends
JpaObject
>
cls
=
(
Class
<
JpaObject
>)
Class
.
forName
(
dynamicEntity
.
className
());
JpaObject
o
=
emc
.
find
(
id
,
cls
);
Wo
wo
=
new
Wo
();
wo
.
setValue
(
false
);
if
(
null
!=
o
)
{
JpaObject
n
=
XGsonBuilder
.
instance
().
fromJson
(
jsonElement
,
cl
z
);
JpaObject
n
=
XGsonBuilder
.
instance
().
fromJson
(
jsonElement
,
cl
s
);
n
.
copyTo
(
o
,
JpaObject
.
FieldsUnmodify
);
emc
.
beginTransaction
(
cl
z
);
emc
.
beginTransaction
(
cl
s
);
emc
.
check
(
o
,
CheckPersistType
.
all
);
emc
.
commit
();
wo
.
setValue
(
true
);
...
...
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/jaxrs/table/TableAction.java
浏览文件 @
5c495f82
...
...
@@ -35,16 +35,16 @@ public class TableAction extends StandardJaxrsAction {
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
TableAction
.
class
);
@JaxrsMethodDescribe
(
value
=
"编译表对象生成实体类进行数据库建表,执行后需要重新启动."
,
action
=
ActionBuild
.
class
)
@JaxrsMethodDescribe
(
value
=
"编译表对象生成实体类进行数据库建表,执行后需要重新启动."
,
action
=
ActionBuild
All
.
class
)
@GET
@Path
(
"build/
table
"
)
@Path
(
"build/
all
"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
build
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
)
{
ActionResult
<
ActionBuild
.
Wo
>
result
=
new
ActionResult
<>();
public
void
build
All
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
)
{
ActionResult
<
ActionBuild
All
.
Wo
>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
try
{
result
=
new
ActionBuild
().
execute
(
effectivePerson
);
result
=
new
ActionBuild
All
().
execute
(
effectivePerson
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
result
.
error
(
e
);
...
...
@@ -163,7 +163,7 @@ public class TableAction extends StandardJaxrsAction {
@JaxrsMethodDescribe
(
value
=
"获取表中某一行数据"
,
action
=
ActionRowGet
.
class
)
@GET
@Path
(
"
table/
{tableFlag}/row/{id}"
)
@Path
(
"{tableFlag}/row/{id}"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
rowGet
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
...
...
@@ -182,13 +182,13 @@ public class TableAction extends StandardJaxrsAction {
@JaxrsMethodDescribe
(
value
=
"通过where 获取表中的数据,格式为jpql语法,o.name='zhangsan'"
,
action
=
ActionListRowSelectWhere
.
class
)
@GET
@Path
(
"list/
table/
{tableFlag}/row/select/where/{where}"
)
@Path
(
"list/{tableFlag}/row/select/where/{where}"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
listRowSelectWhere
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
@JaxrsParameterDescribe
(
"表标识"
)
@PathParam
(
"tableFlag"
)
String
tableFlag
,
@JaxrsParameterDescribe
(
"where语句"
)
@PathParam
(
"where"
)
String
where
)
{
ActionResult
<
List
<
Object
>>
result
=
new
ActionResult
<>();
ActionResult
<
List
<
?
>>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
try
{
result
=
new
ActionListRowSelectWhere
().
execute
(
effectivePerson
,
tableFlag
,
where
);
...
...
@@ -201,7 +201,7 @@ public class TableAction extends StandardJaxrsAction {
@JaxrsMethodDescribe
(
value
=
"通过where 统计数量"
,
action
=
ActionRowCountWhere
.
class
)
@GET
@Path
(
"
table/
{tableFlag}/row/count/where/{where}"
)
@Path
(
"{tableFlag}/row/count/where/{where}"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
rowCountWhere
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
...
...
@@ -220,7 +220,7 @@ public class TableAction extends StandardJaxrsAction {
@JaxrsMethodDescribe
(
value
=
"指定表中插入数据."
,
action
=
ActionRowInsert
.
class
)
@POST
@Path
(
"
table/{tableFlag}
"
)
@Path
(
"
{tableFlag}/row
"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
rowInsert
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
...
...
@@ -238,7 +238,7 @@ public class TableAction extends StandardJaxrsAction {
@JaxrsMethodDescribe
(
value
=
"更新指定表中指定行数据."
,
action
=
ActionRowUpdate
.
class
)
@PUT
@Path
(
"
table/
{tableFlag}/row/{id}"
)
@Path
(
"{tableFlag}/row/{id}"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
rowUpdate
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
...
...
@@ -257,7 +257,7 @@ public class TableAction extends StandardJaxrsAction {
@JaxrsMethodDescribe
(
value
=
"更新指定表中指定行数据."
,
action
=
ActionRowDelete
.
class
)
@DELETE
@Path
(
"
table/
{tableFlag}/row/{id}"
)
@Path
(
"{tableFlag}/row/{id}"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
rowDelete
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
...
...
@@ -274,9 +274,27 @@ public class TableAction extends StandardJaxrsAction {
asyncResponse
.
resume
(
ResponseFactory
.
getDefaultActionResultResponse
(
result
));
}
@JaxrsMethodDescribe
(
value
=
"更新指定表中指定行数据."
,
action
=
ActionRowDeleteAll
.
class
)
@DELETE
@Path
(
"{tableFlag}/row/delete/all"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
rowDeleteAll
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
@JaxrsParameterDescribe
(
"表标识"
)
@PathParam
(
"tableFlag"
)
String
tableFlag
)
{
ActionResult
<
ActionRowDeleteAll
.
Wo
>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
try
{
result
=
new
ActionRowDeleteAll
().
execute
(
effectivePerson
,
tableFlag
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
result
.
error
(
e
);
}
asyncResponse
.
resume
(
ResponseFactory
.
getDefaultActionResultResponse
(
result
));
}
@JaxrsMethodDescribe
(
value
=
"列示表中的行对象,下一页."
,
action
=
ActionListRowNext
.
class
)
@GET
@Path
(
"list/
table/
{tableFlag}/row/{id}/next/{count}"
)
@Path
(
"list/{tableFlag}/row/{id}/next/{count}"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
listRowNext
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
...
...
@@ -296,7 +314,7 @@ public class TableAction extends StandardJaxrsAction {
@JaxrsMethodDescribe
(
value
=
"列示表中的行对象,上一页."
,
action
=
ActionListRowPrev
.
class
)
@GET
@Path
(
"list/
table/
{tableFlag}/row/{id}/prev/{count}"
)
@Path
(
"list/{tableFlag}/row/{id}/prev/{count}"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
listRowPrev
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
...
...
o2server/x_query_assemble_designer/src/test/java/com/x/query/assemble/designer/test/TestClient.java
浏览文件 @
5c495f82
package
com.x.query.assemble.designer.test
;
import
java.io.File
;
import
java.util.Collection
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Objects
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.commons.io.filefilter.DirectoryFileFilter
;
import
org.apache.commons.io.filefilter.FileFilterUtils
;
import
org.junit.Test
;
import
com.google.gson.JsonElement
;
import
com.x.base.core.project.connection.HttpConnection
;
import
com.x.base.core.project.gson.XGsonBuilder
;
public
class
TestClient
{
@Test
public
void
test
()
{
Collection
<
File
>
files
=
FileUtils
.
listFiles
(
new
File
(
"d:/aaa"
),
FileFilterUtils
.
suffixFileFilter
(
".java"
),
DirectoryFileFilter
.
INSTANCE
);
for
(
File
f
:
files
)
{
System
.
out
.
println
(
f
.
getAbsolutePath
());
public
void
insert
()
throws
Exception
{
String
address
=
"http://127.0.0.1:20020/x_query_assemble_designer/jaxrs/table/dd/row"
;
for
(
int
j
=
0
;
j
<
200
;
j
++)
{
List
<
JsonElement
>
list
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
200
;
i
++)
{
String
value
=
Objects
.
toString
(
j
*
100
+
i
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"sf1"
,
"sf1"
+
value
);
List
<
String
>
os
=
new
ArrayList
<>();
os
.
add
(
"lsf1"
+
value
);
map
.
put
(
"lsf1"
,
os
);
map
.
put
(
"slf1"
,
"slf1"
+
"你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好"
);
list
.
add
(
XGsonBuilder
.
instance
().
toJsonTree
(
map
));
}
JsonElement
jsonElement
=
HttpConnection
.
postAsObject
(
address
,
null
,
XGsonBuilder
.
toJson
(
list
),
JsonElement
.
class
);
System
.
out
.
println
(
jsonElement
);
}
}
@Test
public
void
insert1
()
throws
Exception
{
String
address
=
"http://127.0.0.1:20020/x_query_assemble_designer/jaxrs/table/dd/row"
;
for
(
int
i
=
0
;
i
<
200
;
i
++)
{
String
value
=
Objects
.
toString
(
i
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"sf1"
,
"sf1"
+
value
);
List
<
String
>
os
=
new
ArrayList
<>();
os
.
add
(
"lsf1"
+
value
);
map
.
put
(
"lsf1"
,
os
);
map
.
put
(
"slf1"
,
"slf1"
+
"你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好"
);
Thread
.
sleep
(
1000
);
JsonElement
jsonElement
=
HttpConnection
.
postAsObject
(
address
,
null
,
XGsonBuilder
.
toJson
(
map
),
JsonElement
.
class
);
}
}
}
o2server/x_query_assemble_designer/src/
main
/resources/calculate数据格式.json
→
o2server/x_query_assemble_designer/src/
test
/resources/calculate数据格式.json
浏览文件 @
5c495f82
文件已移动
o2server/x_query_assemble_designer/src/
main
/resources/runtime数据格式.json
→
o2server/x_query_assemble_designer/src/
test
/resources/runtime数据格式.json
浏览文件 @
5c495f82
文件已移动
o2server/x_query_assemble_designer/src/test/resources/table.json
0 → 100644
浏览文件 @
5c495f82
{
"stringFieldList"
:
[
{
"name"
:
"sf1"
,
"description"
:
"sf1"
},
{
"name"
:
"sf2"
,
"description"
:
"sf2"
}
],
"integerFieldList"
:
[
{
"name"
:
"if1"
,
"description"
:
"if1"
},
{
"name"
:
"if2"
,
"description"
:
"if2"
}
],
"longFieldList"
:
[
{
"name"
:
"lf1"
,
"description"
:
"lf1"
},
{
"name"
:
"lf2"
,
"description"
:
"lf2"
}
],
"doubleFieldList"
:
[
{
"name"
:
"df1"
,
"description"
:
"df1"
},
{
"name"
:
"df2"
,
"description"
:
"df2"
}
],
"booleanFieldList"
:
[
{
"name"
:
"bf1"
,
"description"
:
"bf1"
},
{
"name"
:
"bf2"
,
"description"
:
"bf2"
}
],
"dateFieldList"
:
[
{
"name"
:
"dtf1"
,
"description"
:
"dtf1"
},
{
"name"
:
"dtf2"
,
"description"
:
"dtf2"
}
],
"timeFieldList"
:
[
{
"name"
:
"tf1"
,
"description"
:
"tf1"
},
{
"name"
:
"tf2"
,
"description"
:
"tf2"
}
],
"dateTimeFieldList"
:
[
{
"name"
:
"dttf1"
,
"description"
:
"dttf1"
},
{
"name"
:
"dttf2"
,
"description"
:
"dttf2"
}
],
"listStringFieldList"
:
[
{
"name"
:
"lsf1"
,
"description"
:
"lsf1"
},
{
"name"
:
"lsf2"
,
"description"
:
"lf2"
}
],
"listIntegerFieldList"
:
[
{
"name"
:
"lif1"
,
"description"
:
"lif1"
},
{
"name"
:
"lif2"
,
"description"
:
"lif2"
}
],
"listLongFieldList"
:
[
{
"name"
:
"llf1"
,
"description"
:
"llf1"
},
{
"name"
:
"llf2"
,
"description"
:
"llf2"
}
],
"listDoubleFieldList"
:
[
{
"name"
:
"ldf1"
,
"description"
:
"ldf1"
},
{
"name"
:
"ldf2"
,
"description"
:
"ldf2"
}
],
"listBooleanFieldList"
:
[
{
"name"
:
"lbf1"
,
"description"
:
"lbf1"
},
{
"name"
:
"lbf2"
,
"description"
:
"lbf2"
}
],
"listDateFieldList"
:
[
{
"name"
:
"ldtf1"
,
"description"
:
"ldtf1"
},
{
"name"
:
"ldtf2"
,
"description"
:
"ldtf2"
}
],
"listTimeFieldList"
:
[
{
"name"
:
"ltf1"
,
"description"
:
"ltf1"
},
{
"name"
:
"ltf2"
,
"description"
:
"ltf2"
}
],
"listDateTimeFieldList"
:
[
{
"name"
:
"ldttf1"
,
"description"
:
"ldttf1"
},
{
"name"
:
"ldttf2"
,
"description"
:
"ldttf2"
}
],
"stringLobFieldList"
:
[
{
"name"
:
"slf1"
,
"description"
:
"slf1"
},
{
"name"
:
"slf2"
,
"description"
:
"slf2"
}
],
"stringMapFieldList"
:
[
{
"name"
:
"smf1"
,
"description"
:
"smf1"
},
{
"name"
:
"smf2"
,
"description"
:
"smf2"
}
]
}
o2server/x_query_assemble_designer/src/
main
/resources/view数据格式_CMS.json
→
o2server/x_query_assemble_designer/src/
test
/resources/view数据格式_CMS.json
浏览文件 @
5c495f82
文件已移动
o2server/x_query_assemble_designer/src/
main
/resources/view数据格式_Platform.json
→
o2server/x_query_assemble_designer/src/
test
/resources/view数据格式_Platform.json
浏览文件 @
5c495f82
文件已移动
o2server/x_query_core_entity/src/main/java/com/x/query/core/entity/Query.java
浏览文件 @
5c495f82
...
...
@@ -107,7 +107,7 @@ public class Query extends SliceJpaObject {
@ContainerTable
(
name
=
TABLE
+
ContainerTableNameMiddle
+
availableIdentityList_FIELDNAME
,
joinIndex
=
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
availableIdentityList_FIELDNAME
+
JoinIndexNameSuffix
))
@OrderColumn
(
name
=
AbstractPersistenceProperties
.
orderColumn
)
@OrderColumn
(
name
=
ORDERCOLUMNCOLUMN
)
@ElementColumn
(
length
=
length_255B
,
name
=
ColumnNamePrefix
+
availableIdentityList_FIELDNAME
)
@ElementIndex
(
name
=
TABLE
+
IndexNameMiddle
+
availableIdentityList_FIELDNAME
+
ElementIndexNameSuffix
)
@CheckPersist
(
allowEmpty
=
true
)
...
...
@@ -119,7 +119,7 @@ public class Query extends SliceJpaObject {
@ContainerTable
(
name
=
TABLE
+
ContainerTableNameMiddle
+
availableUnitList_FIELDNAME
,
joinIndex
=
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
availableUnitList_FIELDNAME
+
JoinIndexNameSuffix
))
@OrderColumn
(
name
=
AbstractPersistenceProperties
.
orderColumn
)
@OrderColumn
(
name
=
ORDERCOLUMNCOLUMN
)
@ElementColumn
(
length
=
length_255B
,
name
=
ColumnNamePrefix
+
availableUnitList_FIELDNAME
)
@ElementIndex
(
name
=
TABLE
+
IndexNameMiddle
+
availableUnitList_FIELDNAME
+
ElementIndexNameSuffix
)
@CheckPersist
(
allowEmpty
=
true
)
...
...
@@ -142,7 +142,7 @@ public class Query extends SliceJpaObject {
public
static
final
String
controllerList_FIELDNAME
=
"controllerList"
;
@FieldDescribe
(
"查询管理者"
)
@PersistentCollection
(
fetch
=
FetchType
.
EAGER
)
@OrderColumn
(
name
=
PersistenceProperties
.
orderColumn
)
@OrderColumn
(
name
=
ORDERCOLUMNCOLUMN
)
@ContainerTable
(
name
=
TABLE
+
ContainerTableNameMiddle
+
controllerList_FIELDNAME
,
joinIndex
=
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
controllerList_FIELDNAME
))
@ElementColumn
(
length
=
length_255B
,
name
=
ColumnNamePrefix
+
controllerList_FIELDNAME
)
...
...
o2server/x_query_core_entity/src/main/java/com/x/query/core/entity/Reveal.java
浏览文件 @
5c495f82
...
...
@@ -122,7 +122,7 @@ public class Reveal extends SliceJpaObject {
@ContainerTable
(
name
=
TABLE
+
ContainerTableNameMiddle
+
availableIdentityList_FIELDNAME
,
joinIndex
=
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
availableIdentityList_FIELDNAME
+
JoinIndexNameSuffix
))
@OrderColumn
(
name
=
AbstractPersistenceProperties
.
orderColumn
)
@OrderColumn
(
name
=
ORDERCOLUMNCOLUMN
)
@ElementColumn
(
length
=
length_255B
,
name
=
ColumnNamePrefix
+
availableIdentityList_FIELDNAME
)
@ElementIndex
(
name
=
TABLE
+
IndexNameMiddle
+
availableIdentityList_FIELDNAME
+
ElementIndexNameSuffix
)
@CheckPersist
(
allowEmpty
=
true
)
...
...
@@ -134,7 +134,7 @@ public class Reveal extends SliceJpaObject {
@ContainerTable
(
name
=
TABLE
+
ContainerTableNameMiddle
+
availableUnitList_FIELDNAME
,
joinIndex
=
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
availableUnitList_FIELDNAME
+
JoinIndexNameSuffix
))
@OrderColumn
(
name
=
AbstractPersistenceProperties
.
orderColumn
)
@OrderColumn
(
name
=
ORDERCOLUMNCOLUMN
)
@ElementColumn
(
length
=
length_255B
,
name
=
ColumnNamePrefix
+
availableUnitList_FIELDNAME
)
@ElementIndex
(
name
=
TABLE
+
IndexNameMiddle
+
availableUnitList_FIELDNAME
+
ElementIndexNameSuffix
)
@CheckPersist
(
allowEmpty
=
true
)
...
...
o2server/x_query_core_entity/src/main/java/com/x/query/core/entity/Stat.java
浏览文件 @
5c495f82
...
...
@@ -120,7 +120,7 @@ public class Stat extends SliceJpaObject {
@ContainerTable
(
name
=
TABLE
+
ContainerTableNameMiddle
+
availableIdentityList_FIELDNAME
,
joinIndex
=
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
availableIdentityList_FIELDNAME
+
JoinIndexNameSuffix
))
@OrderColumn
(
name
=
AbstractPersistenceProperties
.
orderColumn
)
@OrderColumn
(
name
=
ORDERCOLUMNCOLUMN
)
@ElementColumn
(
length
=
length_255B
,
name
=
ColumnNamePrefix
+
availableIdentityList_FIELDNAME
)
@ElementIndex
(
name
=
TABLE
+
IndexNameMiddle
+
availableIdentityList_FIELDNAME
+
ElementIndexNameSuffix
)
@CheckPersist
(
allowEmpty
=
true
)
...
...
@@ -132,7 +132,7 @@ public class Stat extends SliceJpaObject {
@ContainerTable
(
name
=
TABLE
+
ContainerTableNameMiddle
+
availableUnitList_FIELDNAME
,
joinIndex
=
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
availableUnitList_FIELDNAME
+
JoinIndexNameSuffix
))
@OrderColumn
(
name
=
AbstractPersistenceProperties
.
orderColumn
)
@OrderColumn
(
name
=
ORDERCOLUMNCOLUMN
)
@ElementColumn
(
length
=
length_255B
,
name
=
ColumnNamePrefix
+
availableUnitList_FIELDNAME
)
@ElementIndex
(
name
=
TABLE
+
IndexNameMiddle
+
availableUnitList_FIELDNAME
+
ElementIndexNameSuffix
)
@CheckPersist
(
allowEmpty
=
true
)
...
...
o2server/x_query_core_entity/src/main/java/com/x/query/core/entity/View.java
浏览文件 @
5c495f82
...
...
@@ -188,7 +188,7 @@ public class View extends SliceJpaObject {
@ContainerTable
(
name
=
TABLE
+
ContainerTableNameMiddle
+
availableIdentityList_FIELDNAME
,
joinIndex
=
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
availableIdentityList_FIELDNAME
+
JoinIndexNameSuffix
))
@OrderColumn
(
name
=
AbstractPersistenceProperties
.
orderColumn
)
@OrderColumn
(
name
=
ORDERCOLUMNCOLUMN
)
@ElementColumn
(
length
=
length_255B
,
name
=
ColumnNamePrefix
+
availableIdentityList_FIELDNAME
)
@ElementIndex
(
name
=
TABLE
+
IndexNameMiddle
+
availableIdentityList_FIELDNAME
+
ElementIndexNameSuffix
)
@CheckPersist
(
allowEmpty
=
true
)
...
...
@@ -200,7 +200,7 @@ public class View extends SliceJpaObject {
@ContainerTable
(
name
=
TABLE
+
ContainerTableNameMiddle
+
availableUnitList_FIELDNAME
,
joinIndex
=
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
availableUnitList_FIELDNAME
+
JoinIndexNameSuffix
))
@OrderColumn
(
name
=
AbstractPersistenceProperties
.
orderColumn
)
@OrderColumn
(
name
=
ORDERCOLUMNCOLUMN
)
@ElementColumn
(
length
=
length_255B
,
name
=
ColumnNamePrefix
+
availableUnitList_FIELDNAME
)
@ElementIndex
(
name
=
TABLE
+
IndexNameMiddle
+
availableUnitList_FIELDNAME
+
ElementIndexNameSuffix
)
@CheckPersist
(
allowEmpty
=
true
)
...
...
o2server/x_query_core_entity/src/main/java/com/x/query/core/entity/neural/Entry.java
浏览文件 @
5c495f82
...
...
@@ -93,7 +93,7 @@ public class Entry extends SliceJpaObject {
public
static
final
String
inValueLabelList_FIELDNAME
=
"inValueLabelList"
;
@FieldDescribe
(
"输入标签"
)
@PersistentCollection
(
fetch
=
FetchType
.
EAGER
)
@OrderColumn
(
name
=
AbstractPersistenceProperties
.
orderColumn
)
@OrderColumn
(
name
=
ORDERCOLUMNCOLUMN
)
@ContainerTable
(
name
=
TABLE
+
ContainerTableNameMiddle
+
inValueLabelList_FIELDNAME
,
joinIndex
=
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
inValueLabelList_FIELDNAME
+
JoinIndexNameSuffix
))
...
...
@@ -105,7 +105,7 @@ public class Entry extends SliceJpaObject {
public
static
final
String
outValueLabelList_FIELDNAME
=
"outValueLabelList"
;
@FieldDescribe
(
"结果标签"
)
@PersistentCollection
(
fetch
=
FetchType
.
EAGER
)
@OrderColumn
(
name
=
AbstractPersistenceProperties
.
orderColumn
)
@OrderColumn
(
name
=
ORDERCOLUMNCOLUMN
)
@ContainerTable
(
name
=
TABLE
+
ContainerTableNameMiddle
+
outValueLabelList_FIELDNAME
,
joinIndex
=
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
outValueLabelList_FIELDNAME
+
JoinIndexNameSuffix
))
...
...
o2server/x_query_core_entity/src/main/java/com/x/query/core/entity/neural/Model.java
浏览文件 @
5c495f82
...
...
@@ -260,7 +260,7 @@ public class Model extends SliceJpaObject {
@PersistentCollection
(
fetch
=
FetchType
.
EAGER
)
@ContainerTable
(
name
=
TABLE
+
ContainerTableNameMiddle
+
processList_FIELDNAME
,
joinIndex
=
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
processList_FIELDNAME
+
JoinIndexNameSuffix
))
@OrderColumn
(
name
=
AbstractPersistenceProperties
.
orderColumn
)
@OrderColumn
(
name
=
ORDERCOLUMNCOLUMN
)
@ElementColumn
(
length
=
length_255B
,
name
=
ColumnNamePrefix
+
processList_FIELDNAME
)
@ElementIndex
(
name
=
TABLE
+
IndexNameMiddle
+
processList_FIELDNAME
+
ElementIndexNameSuffix
)
@CheckPersist
(
allowEmpty
=
true
)
...
...
@@ -271,7 +271,7 @@ public class Model extends SliceJpaObject {
@PersistentCollection
(
fetch
=
FetchType
.
EAGER
)
@ContainerTable
(
name
=
TABLE
+
ContainerTableNameMiddle
+
applicationList_FIELDNAME
,
joinIndex
=
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
applicationList_FIELDNAME
+
JoinIndexNameSuffix
))
@OrderColumn
(
name
=
AbstractPersistenceProperties
.
orderColumn
)
@OrderColumn
(
name
=
ORDERCOLUMNCOLUMN
)
@ElementColumn
(
length
=
length_255B
,
name
=
ColumnNamePrefix
+
applicationList_FIELDNAME
)
@ElementIndex
(
name
=
TABLE
+
IndexNameMiddle
+
applicationList_FIELDNAME
+
ElementIndexNameSuffix
)
@CheckPersist
(
allowEmpty
=
true
)
...
...
o2server/x_query_core_entity/src/main/java/com/x/query/core/entity/schema/Statement.java
浏览文件 @
5c495f82
...
...
@@ -92,7 +92,7 @@ public class Statement extends SliceJpaObject {
@ContainerTable
(
name
=
TABLE
+
ContainerTableNameMiddle
+
executePersonList_FIELDNAME
,
joinIndex
=
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
executePersonList_FIELDNAME
+
JoinIndexNameSuffix
))
@OrderColumn
(
name
=
AbstractPersistenceProperties
.
orderColumn
)
@OrderColumn
(
name
=
ORDERCOLUMNCOLUMN
)
@ElementColumn
(
length
=
length_255B
,
name
=
ColumnNamePrefix
+
executePersonList_FIELDNAME
)
@ElementIndex
(
name
=
TABLE
+
IndexNameMiddle
+
executePersonList_FIELDNAME
+
ElementIndexNameSuffix
)
@CheckPersist
(
allowEmpty
=
true
)
...
...
@@ -103,7 +103,7 @@ public class Statement extends SliceJpaObject {
@PersistentCollection
(
fetch
=
FetchType
.
EAGER
)
@ContainerTable
(
name
=
TABLE
+
ContainerTableNameMiddle
+
executeUnitList_FIELDNAME
,
joinIndex
=
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
executeUnitList_FIELDNAME
+
JoinIndexNameSuffix
))
@OrderColumn
(
name
=
AbstractPersistenceProperties
.
orderColumn
)
@OrderColumn
(
name
=
ORDERCOLUMNCOLUMN
)
@ElementColumn
(
length
=
length_255B
,
name
=
ColumnNamePrefix
+
executeUnitList_FIELDNAME
)
@ElementIndex
(
name
=
TABLE
+
IndexNameMiddle
+
executeUnitList_FIELDNAME
+
ElementIndexNameSuffix
)
@CheckPersist
(
allowEmpty
=
true
)
...
...
o2server/x_query_core_entity/src/main/java/com/x/query/core/entity/schema/Table.java
浏览文件 @
5c495f82
...
...
@@ -12,6 +12,8 @@ import javax.persistence.Inheritance;
import
javax.persistence.InheritanceType
;
import
javax.persistence.Lob
;
import
javax.persistence.OrderColumn
;
import
javax.persistence.Temporal
;
import
javax.persistence.TemporalType
;
import
javax.persistence.UniqueConstraint
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -99,7 +101,7 @@ public class Table extends SliceJpaObject {
@PersistentCollection
(
fetch
=
FetchType
.
EAGER
)
@ContainerTable
(
name
=
TABLE
+
ContainerTableNameMiddle
+
readPersonList_FIELDNAME
,
joinIndex
=
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
readPersonList_FIELDNAME
+
JoinIndexNameSuffix
))
@OrderColumn
(
name
=
AbstractPersistenceProperties
.
orderColumn
)
@OrderColumn
(
name
=
ORDERCOLUMNCOLUMN
)
@ElementColumn
(
length
=
length_255B
,
name
=
ColumnNamePrefix
+
readPersonList_FIELDNAME
)
@ElementIndex
(
name
=
TABLE
+
IndexNameMiddle
+
readPersonList_FIELDNAME
+
ElementIndexNameSuffix
)
@CheckPersist
(
allowEmpty
=
true
)
...
...
@@ -110,7 +112,7 @@ public class Table extends SliceJpaObject {
@PersistentCollection
(
fetch
=
FetchType
.
EAGER
)
@ContainerTable
(
name
=
TABLE
+
ContainerTableNameMiddle
+
readUnitList_FIELDNAME
,
joinIndex
=
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
readUnitList_FIELDNAME
+
JoinIndexNameSuffix
))
@OrderColumn
(
name
=
AbstractPersistenceProperties
.
orderColumn
)
@OrderColumn
(
name
=
ORDERCOLUMNCOLUMN
)
@ElementColumn
(
length
=
length_255B
,
name
=
ColumnNamePrefix
+
readUnitList_FIELDNAME
)
@ElementIndex
(
name
=
TABLE
+
IndexNameMiddle
+
readUnitList_FIELDNAME
+
ElementIndexNameSuffix
)
@CheckPersist
(
allowEmpty
=
true
)
...
...
@@ -121,7 +123,7 @@ public class Table extends SliceJpaObject {
@PersistentCollection
(
fetch
=
FetchType
.
EAGER
)
@ContainerTable
(
name
=
TABLE
+
ContainerTableNameMiddle
+
editPersonList_FIELDNAME
,
joinIndex
=
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
editPersonList_FIELDNAME
+
JoinIndexNameSuffix
))
@OrderColumn
(
name
=
AbstractPersistenceProperties
.
orderColumn
)
@OrderColumn
(
name
=
ORDERCOLUMNCOLUMN
)
@ElementColumn
(
length
=
length_255B
,
name
=
ColumnNamePrefix
+
editPersonList_FIELDNAME
)
@ElementIndex
(
name
=
TABLE
+
IndexNameMiddle
+
editPersonList_FIELDNAME
+
ElementIndexNameSuffix
)
@CheckPersist
(
allowEmpty
=
true
)
...
...
@@ -132,7 +134,7 @@ public class Table extends SliceJpaObject {
@PersistentCollection
(
fetch
=
FetchType
.
EAGER
)
@ContainerTable
(
name
=
TABLE
+
ContainerTableNameMiddle
+
editUnitList_FIELDNAME
,
joinIndex
=
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
editUnitList_FIELDNAME
+
JoinIndexNameSuffix
))
@OrderColumn
(
name
=
AbstractPersistenceProperties
.
orderColumn
)
@OrderColumn
(
name
=
ORDERCOLUMNCOLUMN
)
@ElementColumn
(
length
=
length_255B
,
name
=
ColumnNamePrefix
+
editUnitList_FIELDNAME
)
@ElementIndex
(
name
=
TABLE
+
IndexNameMiddle
+
editUnitList_FIELDNAME
+
ElementIndexNameSuffix
)
@CheckPersist
(
allowEmpty
=
true
)
...
...
@@ -156,17 +158,6 @@ public class Table extends SliceJpaObject {
@Column
(
length
=
length_255B
,
name
=
ColumnNamePrefix
+
lastUpdatePerson_FIELDNAME
)
private
String
lastUpdatePerson
;
// public static final String controllerList_FIELDNAME = "controllerList";
// @FieldDescribe("表管理者")
// @PersistentCollection(fetch = FetchType.EAGER)
// @OrderColumn(name = PersistenceProperties.orderColumn)
// @ContainerTable(name = TABLE + ContainerTableNameMiddle
// + controllerList_FIELDNAME, joinIndex = @Index(name = TABLE + IndexNameMiddle + controllerList_FIELDNAME))
// @ElementColumn(length = length_255B, name = ColumnNamePrefix + controllerList_FIELDNAME)
// @ElementIndex(name = TABLE + IndexNameMiddle + controllerList_FIELDNAME + ElementIndexNameSuffix)
// @CheckPersist(allowEmpty = true)
// private List<String> controllerList;
public
static
final
String
data_FIELDNAME
=
"data"
;
@FieldDescribe
(
"表结构方案."
)
@Lob
...
...
o2server/x_query_core_express/src/main/java/com/x/query/core/express/plan/Plan.java
浏览文件 @
5c495f82
...
...
@@ -152,40 +152,6 @@ public abstract class Plan extends GsonPropertyObject {
return
calculateRow
;
}
// /*
// * 分类计算输出格式 [ { "group": "报销申请", "list": [ { "column":
// * "C7AC7F427FC0000141704670375F79F0", "displayName": "金额", "value": 1000 } ]
// },
// * { "group": "项目经理审批", "list": [ { "column":
// * "C7AC7F427FC0000141704670375F79F0", "displayName": "金额", "value": 1110 } ]
// }
// * ]
// */
// private CalculateGroupTable calculateGroup() throws Exception {
// CalculateGroupTable calculateGroupTable = new CalculateGroupTable();
// for (GroupRow groupRow : this.groupGrid) {
// List<CalculateCell> list = new TreeList<>();
// for (CalculateEntry entry : calculate.calculateList) {
// switch (entry.calculateType) {
// case CALCULATE_SUM:
// list.add(new CalculateCell(entry, entry.sum(groupRow.list)));
// break;
// case CALCULATE_AVERAGE:
// list.add(new CalculateCell(entry, entry.average(groupRow.list)));
// break;
// default:
// list.add(new CalculateCell(entry, entry.count(groupRow.list)));
// break;
// }
// }
// CalculateGroupRow calculateGroupRow = new CalculateGroupRow();
// calculateGroupRow.group = groupRow.group;
// calculateGroupRow.list = list;
// calculateGroupTable.add(calculateGroupRow);
// }
// return calculateGroupTable;
// }
@SuppressWarnings
({
"rawtypes"
,
"unchecked"
})
private
GroupTable
group
(
Table
table
)
throws
Exception
{
final
String
orderType
=
(
null
==
this
.
group
)
?
SelectEntry
.
ORDER_ORIGINAL
:
this
.
group
.
orderType
;
...
...
@@ -517,8 +483,9 @@ public abstract class Plan extends GsonPropertyObject {
p
=
cb
.
and
(
p
,
cb
.
or
(
cb
.
isNull
(
root
.
get
(
Item_
.
path7
)),
cb
.
equal
(
root
.
get
(
Item_
.
path7
),
""
)));
}
cq
.
multiselect
(
root
.
get
(
Item_
.
bundle
),
root
.
get
(
Item_
.
itemPrimitiveType
),
root
.
get
(
Item_
.
itemStringValueType
),
root
.
get
(
Item_
.
stringShortValue
),
root
.
get
(
Item_
.
dateValue
),
root
.
get
(
Item_
.
timeValue
),
root
.
get
(
Item_
.
dateTimeValue
),
root
.
get
(
Item_
.
booleanValue
),
root
.
get
(
Item_
.
numberValue
)).
where
(
p
);
root
.
get
(
Item_
.
stringShortValue
),
root
.
get
(
Item_
.
stringLongValue
),
root
.
get
(
Item_
.
dateValue
),
root
.
get
(
Item_
.
timeValue
),
root
.
get
(
Item_
.
dateTimeValue
),
root
.
get
(
Item_
.
booleanValue
),
root
.
get
(
Item_
.
numberValue
)).
where
(
p
);
List
<
Tuple
>
list
=
em
.
createQuery
(
cq
).
getResultList
();
Row
row
=
null
;
for
(
Tuple
o
:
list
)
{
...
...
@@ -528,36 +495,40 @@ public abstract class Plan extends GsonPropertyObject {
switch
(
ItemStringValueType
.
valueOf
(
Objects
.
toString
(
o
.
get
(
2
))))
{
case
s:
if
(
null
!=
o
.
get
(
3
))
{
if
(
StringUtils
.
isNotEmpty
(
Objects
.
toString
(
o
.
get
(
4
))))
{
row
.
put
(
selectEntry
.
getColumn
(),
Objects
.
toString
(
o
.
get
(
4
)));
}
else
{
row
.
put
(
selectEntry
.
getColumn
(),
Objects
.
toString
(
o
.
get
(
3
)));
}
break
;
case
d:
if
(
null
!=
o
.
get
(
4
))
{
row
.
put
(
selectEntry
.
getColumn
(),
JpaObjectTools
.
confirm
((
Date
)
o
.
get
(
4
)));
}
break
;
case
t
:
case
d
:
if
(
null
!=
o
.
get
(
5
))
{
row
.
put
(
selectEntry
.
getColumn
(),
JpaObjectTools
.
confirm
((
Date
)
o
.
get
(
5
)));
}
break
;
case
d
t:
case
t:
if
(
null
!=
o
.
get
(
6
))
{
row
.
put
(
selectEntry
.
getColumn
(),
JpaObjectTools
.
confirm
((
Date
)
o
.
get
(
6
)));
}
break
;
case
dt:
if
(
null
!=
o
.
get
(
7
))
{
row
.
put
(
selectEntry
.
getColumn
(),
JpaObjectTools
.
confirm
((
Date
)
o
.
get
(
7
)));
}
break
;
default
:
break
;
}
break
;
case
b:
if
(
null
!=
o
.
get
(
7
))
{
row
.
put
(
selectEntry
.
getColumn
(),
(
Boolean
)
o
.
get
(
7
));
if
(
null
!=
o
.
get
(
8
))
{
row
.
put
(
selectEntry
.
getColumn
(),
(
Boolean
)
o
.
get
(
8
));
}
break
;
case
n:
if
(
null
!=
o
.
get
(
8
))
{
row
.
put
(
selectEntry
.
getColumn
(),
(
Number
)
o
.
get
(
8
));
if
(
null
!=
o
.
get
(
9
))
{
row
.
put
(
selectEntry
.
getColumn
(),
(
Number
)
o
.
get
(
9
));
}
break
;
default
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录