Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
ghsby
o2oa
提交
6f3ef609
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,发现更多精彩内容 >>
提交
6f3ef609
编写于
5月 06, 2020
作者:
Z
Zhou Rui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
初级版本实现ContainerEntity
上级
00cb4dbd
变更
20
隐藏空白更改
内联
并排
Showing
20 changed file
with
138 addition
and
86 deletion
+138
-86
o2server/configSample/dumpRestoreData.json
o2server/configSample/dumpRestoreData.json
+3
-1
o2server/start_linux_debug.sh
o2server/start_linux_debug.sh
+1
-1
o2server/x_base_core_project/src/main/java/com/x/base/core/entity/annotation/ContainerEntity.java
...va/com/x/base/core/entity/annotation/ContainerEntity.java
+4
-4
o2server/x_base_core_project/src/main/java/com/x/base/core/entity/dynamic/DynamicEntityBuilder.java
.../com/x/base/core/entity/dynamic/DynamicEntityBuilder.java
+55
-41
o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/DumpRestoreData.java
.../java/com/x/base/core/project/config/DumpRestoreData.java
+17
-0
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/timertask/Timertask_BatchOperationTask.java
...emble/control/timertask/Timertask_BatchOperationTask.java
+1
-1
o2server/x_console/src/main/java/com/x/server/console/action/DumpData.java
...e/src/main/java/com/x/server/console/action/DumpData.java
+48
-19
o2server/x_console/src/main/java/com/x/server/console/action/EraseContentBbs.java
...ain/java/com/x/server/console/action/EraseContentBbs.java
+0
-3
o2server/x_console/src/main/java/com/x/server/console/action/ThreadDump.java
...src/main/java/com/x/server/console/action/ThreadDump.java
+0
-2
o2server/x_general_core_entity/src/main/java/com/x/general/core/entity/area/District.java
...rc/main/java/com/x/general/core/entity/area/District.java
+1
-1
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/element/FormVersion.java
...om/x/processplatform/core/entity/element/FormVersion.java
+1
-1
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/element/ProcessVersion.java
...x/processplatform/core/entity/element/ProcessVersion.java
+1
-1
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/element/ScriptVersion.java
.../x/processplatform/core/entity/element/ScriptVersion.java
+1
-1
o2server/x_program_center_core_entity/src/main/java/com/x/program/center/core/entity/PromptErrorLog.java
...java/com/x/program/center/core/entity/PromptErrorLog.java
+1
-1
o2server/x_program_center_core_entity/src/main/java/com/x/program/center/core/entity/ScheduleLog.java
...in/java/com/x/program/center/core/entity/ScheduleLog.java
+1
-1
o2server/x_program_center_core_entity/src/main/java/com/x/program/center/core/entity/UnexpectedErrorLog.java
.../com/x/program/center/core/entity/UnexpectedErrorLog.java
+1
-1
o2server/x_program_center_core_entity/src/main/java/com/x/program/center/core/entity/WarnLog.java
...c/main/java/com/x/program/center/core/entity/WarnLog.java
+1
-1
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/jaxrs/table/ActionDelete.java
...m/x/query/assemble/designer/jaxrs/table/ActionDelete.java
+0
-2
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
+0
-3
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/timertask/Timertask_BatchOperationTask.java
...emble/control/timertask/Timertask_BatchOperationTask.java
+1
-1
未找到文件。
o2server/configSample/dumpRestoreData.json
浏览文件 @
6f3ef609
...
...
@@ -3,8 +3,10 @@
"includes"
:
[],
"excludes"
:
[],
"batchSize"
:
1000.0
,
"mode"
:
"lite"
,
"###enable"
:
"是否启用.###"
,
"###includes"
:
"导出导入包含对象,可以使用通配符*.###"
,
"###excludes"
:
"导出导入排除对象,可以使用通配符*.###"
,
"###batchSize"
:
"批量对象数量.###"
"###batchSize"
:
"批量对象数量.###"
,
"###mode"
:
"导出数据模式,lite|full,默认使用lite###"
}
\ No newline at end of file
o2server/start_linux_debug.sh
浏览文件 @
6f3ef609
...
...
@@ -146,4 +146,4 @@ if [ -d ${current_dir}/local/update ]; then
rm
-Rf
${
current_dir
}
/local/update
fi
fi
setsid
${
current_dir
}
/jvm/linux/bin/java
-Xdebug
-Xrunjdwp
:transport
=
dt_socket,server
=
y,suspend
=
n,address
=
20000
-Djava
.awt.headless
=
true
-Xms2g
-Xmx8g
-XX
:+UseG1GC
-XX
:+HeapDumpOnOutOfMemoryError
-jar
${
current_dir
}
/console.jar
\ No newline at end of file
setsid
${
current_dir
}
/jvm/linux/bin/java
-Dcom
.sun.management.jmxremote
-Dcom
.sun.management.jmxremote.ssl
=
false
-Dcom
.sun.management.jmxremote.port
=
1099
-Dcom
.sun.management.jmxremote.authenticate
=
false
-Xdebug
-Xrunjdwp
:transport
=
dt_socket,server
=
y,suspend
=
n,address
=
20000
-Djava
.awt.headless
=
true
-Xms2g
-Xmx8g
-XX
:+UseG1GC
-XX
:+HeapDumpOnOutOfMemoryError
-jar
${
current_dir
}
/console.jar
\ No newline at end of file
o2server/x_base_core_project/src/main/java/com/x/base/core/entity/annotation/ContainerEntity.java
浏览文件 @
6f3ef609
...
...
@@ -22,21 +22,21 @@ public @interface ContainerEntity {
/**
* 执行dump时分组数量
*/
public
int
dumpSize
();
public
int
dumpSize
()
default
1000
;
/**
* 类型
*/
public
Type
type
();
public
Type
type
()
default
Type
.
content
;
/**
* 引用,强数据,软数据(软数据不会影响系统运行)
*/
public
Reference
reference
();
public
Reference
reference
()
default
Reference
.
strong
;
public
enum
Type
{
element
,
content
,
log
;
element
,
content
,
log
,
custom
;
}
public
enum
Reference
{
...
...
o2server/x_base_core_project/src/main/java/com/x/base/core/entity/dynamic/DynamicEntityBuilder.java
浏览文件 @
6f3ef609
...
...
@@ -61,7 +61,10 @@ public class DynamicEntityBuilder {
public
JavaFile
build
()
throws
Exception
{
AnnotationSpec
annotationSpec_entity
=
AnnotationSpec
.
builder
(
Entity
.
class
).
build
();
AnnotationSpec
annotationSpec_containerEntity
=
AnnotationSpec
.
builder
(
ContainerEntity
.
class
).
build
();
AnnotationSpec
annotationSpec_containerEntity
=
AnnotationSpec
.
builder
(
ContainerEntity
.
class
)
.
addMember
(
"dumpSize"
,
"500"
)
.
addMember
(
"type"
,
"com.x.base.core.entity.annotation.ContainerEntity.Type.custom"
)
.
addMember
(
"reference"
,
"com.x.base.core.entity.annotation.ContainerEntity.Reference.strong"
).
build
();
AnnotationSpec
annotationSpec_table
=
AnnotationSpec
.
builder
(
Table
.
class
)
.
addMember
(
"name"
,
"\""
+
dynamicEntity
.
tableName
()
+
"\""
)
.
addMember
(
"uniqueConstraints"
,
"{@javax.persistence.UniqueConstraint(name = \""
...
...
@@ -119,16 +122,16 @@ public class DynamicEntityBuilder {
}
private
void
createIdField
(
Builder
builder
)
{
//
public String getId() {
//
return id;
//
}
//
public void setId(String id) {
//
this.id = id;
//
}
//
@FieldDescribe("数据库主键,自动生成.")
//
@Id
//
@Column(length = length_id, name = ColumnNamePrefix + id_FIELDNAME)
//
private String id = createId();
//
public String getId() {
//
return id;
//
}
//
public void setId(String id) {
//
this.id = id;
//
}
//
@FieldDescribe("数据库主键,自动生成.")
//
@Id
//
@Column(length = length_id, name = ColumnNamePrefix + id_FIELDNAME)
//
private String id = createId();
AnnotationSpec
fieldDescribe
=
AnnotationSpec
.
builder
(
FieldDescribe
.
class
).
addMember
(
"value"
,
"\"数据库主键,自动生成.\""
)
.
build
();
AnnotationSpec
id
=
AnnotationSpec
.
builder
(
Id
.
class
).
build
();
...
...
@@ -174,12 +177,13 @@ public class DynamicEntityBuilder {
}
private
void
createField
(
Builder
builder
,
Field
field
,
Class
<?>
typeClass
)
{
// public static final String stringValue_FIELDNAME = "stringValue";
// @FieldDescribe("文本字段.")
// @Column(length = JpaObject.length_255B, name = ColumnNamePrefix + stringValue_FIELDNAME)
// @Index(name = TABLE + IndexNameMiddle + stringValue_FIELDNAME)
// @CheckPersist(allowEmpty = true)
// private String stringValue;
// public static final String stringValue_FIELDNAME = "stringValue";
// @FieldDescribe("文本字段.")
// @Column(length = JpaObject.length_255B, name = ColumnNamePrefix +
// stringValue_FIELDNAME)
// @Index(name = TABLE + IndexNameMiddle + stringValue_FIELDNAME)
// @CheckPersist(allowEmpty = true)
// private String stringValue;
AnnotationSpec
column
=
null
;
if
(
typeClass
==
String
.
class
)
{
column
=
AnnotationSpec
.
builder
(
Column
.
class
).
addMember
(
"length"
,
"length_255B"
)
...
...
@@ -314,16 +318,20 @@ public class DynamicEntityBuilder {
private
void
createListFields
(
Builder
builder
,
Field
field
,
Class
<?>
typeClass
)
{
// public static final String groupList_FIELDNAME = "groupList";
// @FieldDescribe("群组的群组成员.存放群组 ID.")
// @ContainerTable(name = TABLE + ContainerTableNameMiddle + groupList_FIELDNAME, joinIndex = @Index(name = TABLE
// + IndexNameMiddle + groupList_FIELDNAME + JoinIndexNameSuffix))
// @ElementIndex(name = TABLE + IndexNameMiddle + groupList_FIELDNAME + ElementIndexNameSuffix)
// @PersistentCollection(fetch = FetchType.EAGER)
// @OrderColumn(name = ORDERCOLUMNCOLUMN)
// @ElementColumn(length = JpaObject.length_id, name = ColumnNamePrefix + groupList_FIELDNAME)
// @CheckPersist(allowEmpty = true, citationExists = @CitationExist(type = Group.class))
// private List<String> groupList;
// public static final String groupList_FIELDNAME = "groupList";
// @FieldDescribe("群组的群组成员.存放群组 ID.")
// @ContainerTable(name = TABLE + ContainerTableNameMiddle +
// groupList_FIELDNAME, joinIndex = @Index(name = TABLE
// + IndexNameMiddle + groupList_FIELDNAME + JoinIndexNameSuffix))
// @ElementIndex(name = TABLE + IndexNameMiddle + groupList_FIELDNAME +
// ElementIndexNameSuffix)
// @PersistentCollection(fetch = FetchType.EAGER)
// @OrderColumn(name = ORDERCOLUMNCOLUMN)
// @ElementColumn(length = JpaObject.length_id, name = ColumnNamePrefix +
// groupList_FIELDNAME)
// @CheckPersist(allowEmpty = true, citationExists = @CitationExist(type =
// Group.class))
// private List<String> groupList;
AnnotationSpec
containerTable
=
AnnotationSpec
.
builder
(
ContainerTable
.
class
)
.
addMember
(
"name"
,
"TABLE + ContainerTableNameMiddle + "
+
field
.
fieldName
())
...
...
@@ -375,11 +383,12 @@ public class DynamicEntityBuilder {
private
void
createStringLobField
(
Builder
builder
,
Field
field
)
{
// public static final String stringLobValue_FIELDNAME = "stringLobValue";
// @FieldDescribe("长文本.")
// @Lob
// @Basic(fetch = FetchType.EAGER)
// @Column(length = JpaObject.length_10M, name = ColumnNamePrefix + stringLobValue_FIELDNAME)
// public static final String stringLobValue_FIELDNAME = "stringLobValue";
// @FieldDescribe("长文本.")
// @Lob
// @Basic(fetch = FetchType.EAGER)
// @Column(length = JpaObject.length_10M, name = ColumnNamePrefix +
// stringLobValue_FIELDNAME)
AnnotationSpec
lob
=
AnnotationSpec
.
builder
(
Lob
.
class
).
build
();
...
...
@@ -410,15 +419,20 @@ public class DynamicEntityBuilder {
private
void
createStringMapField
(
Builder
builder
,
Field
field
)
{
// @FieldDescribe("Map类型.")
// @CheckPersist(allowEmpty = true)
// @PersistentMap(fetch = FetchType.EAGER, elementType = String.class, keyType = String.class)
// @ContainerTable(name = TABLE + ContainerTableNameMiddle + mapValueMap_FIELDNAME, joinIndex = @Index(name = TABLE
// + IndexNameMiddle + mapValueMap_FIELDNAME + JoinIndexNameSuffix))
// @KeyColumn(name = ColumnNamePrefix + key_FIELDNAME)
// @ElementColumn(length = length_255B, name = ColumnNamePrefix + mapValueMap_FIELDNAME)
// @ElementIndex(name = TABLE + IndexNameMiddle + mapValueMap_FIELDNAME + ElementIndexNameSuffix)
// @KeyIndex(name = TABLE + IndexNameMiddle + mapValueMap_FIELDNAME + KeyIndexNameSuffix)
// @FieldDescribe("Map类型.")
// @CheckPersist(allowEmpty = true)
// @PersistentMap(fetch = FetchType.EAGER, elementType = String.class, keyType =
// String.class)
// @ContainerTable(name = TABLE + ContainerTableNameMiddle +
// mapValueMap_FIELDNAME, joinIndex = @Index(name = TABLE
// + IndexNameMiddle + mapValueMap_FIELDNAME + JoinIndexNameSuffix))
// @KeyColumn(name = ColumnNamePrefix + key_FIELDNAME)
// @ElementColumn(length = length_255B, name = ColumnNamePrefix +
// mapValueMap_FIELDNAME)
// @ElementIndex(name = TABLE + IndexNameMiddle + mapValueMap_FIELDNAME +
// ElementIndexNameSuffix)
// @KeyIndex(name = TABLE + IndexNameMiddle + mapValueMap_FIELDNAME +
// KeyIndexNameSuffix)
AnnotationSpec
persistentMap
=
AnnotationSpec
.
builder
(
PersistentMap
.
class
)
.
addMember
(
"fetch"
,
" javax.persistence.FetchType.EAGER"
).
addMember
(
"elementType"
,
"String.class"
)
...
...
o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/DumpRestoreData.java
浏览文件 @
6f3ef609
...
...
@@ -4,23 +4,29 @@ import java.util.ArrayList;
import
java.util.List
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
com.x.base.core.project.annotation.FieldDescribe
;
import
com.x.base.core.project.tools.ListTools
;
public
class
DumpRestoreData
extends
ConfigObject
{
public
static
String
TYPE_FULL
=
"full"
;
public
static
String
TYPE_LITE
=
"lite"
;
public
static
DumpRestoreData
defaultInstance
()
{
return
new
DumpRestoreData
();
}
public
static
final
int
default_batchSize
=
1000
;
public
static
final
String
default_type
=
TYPE_LITE
;
public
DumpRestoreData
()
{
this
.
enable
=
false
;
this
.
includes
=
new
ArrayList
<
String
>();
this
.
excludes
=
new
ArrayList
<
String
>();
this
.
batchSize
=
default_batchSize
;
this
.
mode
=
default_type
;
}
@FieldDescribe
(
"是否启用."
)
...
...
@@ -35,6 +41,13 @@ public class DumpRestoreData extends ConfigObject {
@FieldDescribe
(
"批量对象数量."
)
private
Integer
batchSize
;
@FieldDescribe
(
"导出数据模式,lite|full,默认使用lite"
)
private
String
mode
;
public
String
getMode
()
{
return
StringUtils
.
equals
(
TYPE_FULL
,
mode
)
?
TYPE_FULL
:
TYPE_LITE
;
}
public
Boolean
getEnable
()
{
return
BooleanUtils
.
isTrue
(
this
.
enable
);
}
...
...
@@ -78,4 +91,8 @@ public class DumpRestoreData extends ConfigObject {
this
.
enable
=
enable
;
}
public
void
setMode
(
String
mode
)
{
this
.
mode
=
mode
;
}
}
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/timertask/Timertask_BatchOperationTask.java
浏览文件 @
6f3ef609
...
...
@@ -51,7 +51,7 @@ public class Timertask_BatchOperationTask extends AbstractJob {
}
}
else
{
logger
.
info
(
"Timertask_BatchOperationTask -> not foun
t
any cms batch operation, try to check unreview document in database......"
);
"Timertask_BatchOperationTask -> not foun
d
any cms batch operation, try to check unreview document in database......"
);
// 如果队列里已经没有任务了,那么检查一下是否还有未revieiw的文档,添加到队列
DocumentInfoService
documentInfoService
=
new
DocumentInfoService
();
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
...
...
o2server/x_console/src/main/java/com/x/server/console/action/DumpData.java
浏览文件 @
6f3ef609
package
com.x.server.console.action
;
import
java.io.File
;
import
java.io.IOException
;
import
java.lang.reflect.InvocationTargetException
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Objects
;
import
javax.persistence.EntityManager
;
import
javax.persistence.EntityManagerFactory
;
...
...
@@ -20,7 +23,10 @@ import org.apache.openjpa.persistence.OpenJPAPersistence;
import
com.google.gson.Gson
;
import
com.x.base.core.container.factory.PersistenceXmlHelper
;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.entity.annotation.ContainerEntity
;
import
com.x.base.core.entity.annotation.ContainerEntity.Reference
;
import
com.x.base.core.project.config.Config
;
import
com.x.base.core.project.config.DumpRestoreData
;
import
com.x.base.core.project.gson.XGsonBuilder
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
...
...
@@ -40,6 +46,7 @@ public class DumpData {
private
Gson
pureGsonDateFormated
=
XGsonBuilder
.
instance
();
@SuppressWarnings
(
"unchecked"
)
public
boolean
execute
(
String
path
)
throws
Exception
{
if
(
StringUtils
.
isEmpty
(
path
))
{
this
.
dir
=
new
File
(
Config
.
base
(),
"local/dump/dumpData_"
+
DateTools
.
compact
(
this
.
start
));
...
...
@@ -56,8 +63,9 @@ public class DumpData {
/* 初始化完成 */
List
<
String
>
containerEntityNames
=
new
ArrayList
<>();
containerEntityNames
.
addAll
((
List
<
String
>)
Config
.
resource
(
Config
.
RESOURCE_CONTAINERENTITYNAMES
));
List
<
String
>
containerEntityNames
=
this
.
entities
();
/** 过滤include exclude 条件 */
List
<
String
>
classNames
=
ListTools
.
includesExcludesWildcard
(
containerEntityNames
,
Config
.
dumpRestoreData
().
getIncludes
(),
Config
.
dumpRestoreData
().
getExcludes
());
logger
.
print
(
"dump data find {} data to dump, start at {}."
,
classNames
.
size
(),
DateTools
.
format
(
start
));
...
...
@@ -65,18 +73,17 @@ public class DumpData {
PersistenceXmlHelper
.
write
(
persistence
.
getAbsolutePath
(),
classNames
);
for
(
int
i
=
0
;
i
<
classNames
.
size
();
i
++)
{
Class
<
JpaObject
>
cls
=
(
Class
<
JpaObject
>)
Class
.
forName
(
classNames
.
get
(
i
));
EntityManagerFactory
emf
=
OpenJPAPersistence
.
createEntityManagerFactory
(
cls
.
getName
(),
persistence
.
getName
(),
PersistenceXmlHelper
.
properties
(
cls
.
getName
(),
Config
.
slice
().
getEnable
()));
EntityManager
em
=
emf
.
createEntityManager
();
try
{
logger
.
print
(
"dump data({}/{}): {}, count: {}."
,
(
i
+
1
),
classNames
.
size
(),
cls
.
getName
(),
this
.
estimateCount
(
em
,
cls
));
this
.
dump
(
cls
,
em
);
}
finally
{
em
.
close
();
emf
.
close
();
}
EntityManagerFactory
emf
=
OpenJPAPersistence
.
createEntityManagerFactory
(
cls
.
getName
(),
persistence
.
getName
(),
PersistenceXmlHelper
.
properties
(
cls
.
getName
(),
Config
.
slice
().
getEnable
()));
EntityManager
em
=
emf
.
createEntityManager
();
try
{
logger
.
print
(
"dump data({}/{}): {}, count: {}."
,
(
i
+
1
),
classNames
.
size
(),
cls
.
getName
(),
this
.
estimateCount
(
em
,
cls
));
this
.
dump
(
cls
,
em
);
}
finally
{
em
.
close
();
emf
.
close
();
}
}
FileUtils
.
write
(
new
File
(
dir
,
"catalog.json"
),
pureGsonDateFormated
.
toJson
(
this
.
catalog
),
DefaultCharset
.
charset
);
...
...
@@ -97,17 +104,18 @@ public class DumpData {
return
this
.
catalog
.
values
().
stream
().
mapToInt
(
Integer:
:
intValue
).
sum
();
}
private
<
T
>
void
dump
(
Class
<
T
>
cls
,
EntityManager
em
)
throws
Exception
{
private
<
T
>
void
dump
(
Class
<
T
>
cls
,
EntityManager
em
)
throws
IOException
,
IllegalAccessException
,
InvocationTargetException
,
NoSuchMethodException
{
/** 创建最终存储文件的目录 */
File
directory
=
new
File
(
dir
,
cls
.
getName
());
FileUtils
.
forceMkdir
(
directory
);
FileUtils
.
cleanDirectory
(
directory
);
int
count
=
0
;
int
size
=
Config
.
dumpRestoreData
().
getBatchSize
();
ContainerEntity
containerEntity
=
cls
.
getAnnotation
(
ContainerEntity
.
class
);
String
id
=
""
;
List
<
T
>
list
=
null
;
int
count
=
0
;
do
{
list
=
this
.
list
(
em
,
cls
,
id
,
size
);
list
=
this
.
list
(
em
,
cls
,
id
,
containerEntity
.
dumpSize
()
);
if
(
ListTools
.
isNotEmpty
(
list
))
{
count
=
count
+
list
.
size
();
id
=
BeanUtils
.
getProperty
(
list
.
get
(
list
.
size
()
-
1
),
JpaObject
.
id_FIELDNAME
);
...
...
@@ -115,7 +123,6 @@ public class DumpData {
FileUtils
.
write
(
file
,
pureGsonDateFormated
.
toJson
(
list
),
DefaultCharset
.
charset
);
}
em
.
clear
();
Runtime
.
getRuntime
().
gc
();
}
while
(
ListTools
.
isNotEmpty
(
list
));
this
.
catalog
.
put
(
cls
.
getName
(),
count
);
}
...
...
@@ -132,4 +139,26 @@ public class DumpData {
return
em
.
createQuery
(
cq
).
setMaxResults
(
size
).
getResultList
();
}
/**
* 根据设置的模式不同输出需要dump的entity className
*
* @return
* @throws Exception
*/
@SuppressWarnings
(
"unchecked"
)
private
List
<
String
>
entities
()
throws
Exception
{
List
<
String
>
list
=
new
ArrayList
<>();
if
(
StringUtils
.
equals
(
Config
.
dumpRestoreData
().
getMode
(),
DumpRestoreData
.
TYPE_FULL
))
{
list
.
addAll
((
List
<
String
>)
Config
.
resource
(
Config
.
RESOURCE_CONTAINERENTITYNAMES
));
return
list
;
}
for
(
String
str
:
(
List
<
String
>)
Config
.
resource
(
Config
.
RESOURCE_CONTAINERENTITYNAMES
))
{
Class
<?>
cls
=
Class
.
forName
(
str
);
ContainerEntity
containerEntity
=
cls
.
getAnnotation
(
ContainerEntity
.
class
);
if
(
Objects
.
equals
(
containerEntity
.
reference
(),
Reference
.
strong
))
{
list
.
add
(
str
);
}
}
return
list
;
}
}
\ No newline at end of file
o2server/x_console/src/main/java/com/x/server/console/action/EraseContentBbs.java
浏览文件 @
6f3ef609
package
com.x.server.console.action
;
import
org.apache.commons.lang3.StringUtils
;
import
com.x.base.core.entity.dataitem.ItemCategory
;
import
com.x.base.core.project.config.Config
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.bbs.entity.BBSOperationRecord
;
...
...
o2server/x_console/src/main/java/com/x/server/console/action/ThreadDump.java
浏览文件 @
6f3ef609
...
...
@@ -8,9 +8,7 @@ import java.util.HashMap;
import
java.util.Map
;
import
java.util.Map.Entry
;
import
com.google.gson.Gson
;
import
com.x.base.core.project.config.Config
;
import
com.x.base.core.project.gson.XGsonBuilder
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.tools.DateTools
;
...
...
o2server/x_general_core_entity/src/main/java/com/x/general/core/entity/area/District.java
浏览文件 @
6f3ef609
...
...
@@ -17,7 +17,7 @@ import com.x.base.core.entity.annotation.ContainerEntity;
import
com.x.base.core.project.annotation.FieldDescribe
;
import
com.x.general.core.entity.PersistenceProperties
;
@ContainerEntity
(
dumpSize
=
1000
,
type
=
ContainerEntity
.
Type
.
content
,
reference
=
ContainerEntity
.
Reference
.
strong
)
@ContainerEntity
(
dumpSize
=
1000
,
type
=
ContainerEntity
.
Type
.
element
,
reference
=
ContainerEntity
.
Reference
.
soft
)
@Entity
@Table
(
name
=
PersistenceProperties
.
Area
.
District
.
table
,
uniqueConstraints
=
{
@UniqueConstraint
(
name
=
PersistenceProperties
.
Area
.
District
.
table
+
JpaObject
.
IndexNameMiddle
...
...
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/element/FormVersion.java
浏览文件 @
6f3ef609
...
...
@@ -23,7 +23,7 @@ import com.x.base.core.project.gson.XGsonBuilder;
import
com.x.processplatform.core.entity.PersistenceProperties
;
@Entity
@ContainerEntity
(
dumpSize
=
5
,
type
=
ContainerEntity
.
Type
.
element
,
reference
=
ContainerEntity
.
Reference
.
soft
)
@ContainerEntity
(
dumpSize
=
5
,
type
=
ContainerEntity
.
Type
.
log
,
reference
=
ContainerEntity
.
Reference
.
soft
)
@Table
(
name
=
PersistenceProperties
.
Element
.
FormVersion
.
table
,
uniqueConstraints
=
{
@UniqueConstraint
(
name
=
PersistenceProperties
.
Element
.
FormVersion
.
table
+
JpaObject
.
IndexNameMiddle
+
JpaObject
.
DefaultUniqueConstraintSuffix
,
columnNames
=
{
JpaObject
.
IDCOLUMN
,
...
...
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/element/ProcessVersion.java
浏览文件 @
6f3ef609
...
...
@@ -23,7 +23,7 @@ import com.x.base.core.project.gson.XGsonBuilder;
import
com.x.processplatform.core.entity.PersistenceProperties
;
@Entity
@ContainerEntity
(
dumpSize
=
5
,
type
=
ContainerEntity
.
Type
.
element
,
reference
=
ContainerEntity
.
Reference
.
strong
)
@ContainerEntity
(
dumpSize
=
5
,
type
=
ContainerEntity
.
Type
.
log
,
reference
=
ContainerEntity
.
Reference
.
soft
)
@Table
(
name
=
PersistenceProperties
.
Element
.
ProcessVersion
.
table
,
uniqueConstraints
=
{
@UniqueConstraint
(
name
=
PersistenceProperties
.
Element
.
ProcessVersion
.
table
+
JpaObject
.
IndexNameMiddle
+
JpaObject
.
DefaultUniqueConstraintSuffix
,
columnNames
=
{
JpaObject
.
IDCOLUMN
,
...
...
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/element/ScriptVersion.java
浏览文件 @
6f3ef609
...
...
@@ -23,7 +23,7 @@ import com.x.base.core.project.gson.XGsonBuilder;
import
com.x.processplatform.core.entity.PersistenceProperties
;
@Entity
@ContainerEntity
(
dumpSize
=
5
,
type
=
ContainerEntity
.
Type
.
element
,
reference
=
ContainerEntity
.
Reference
.
strong
)
@ContainerEntity
(
dumpSize
=
5
,
type
=
ContainerEntity
.
Type
.
log
,
reference
=
ContainerEntity
.
Reference
.
soft
)
@Table
(
name
=
PersistenceProperties
.
Element
.
ScriptVersion
.
table
,
uniqueConstraints
=
{
@UniqueConstraint
(
name
=
PersistenceProperties
.
Element
.
ScriptVersion
.
table
+
JpaObject
.
IndexNameMiddle
+
JpaObject
.
DefaultUniqueConstraintSuffix
,
columnNames
=
{
JpaObject
.
IDCOLUMN
,
...
...
o2server/x_program_center_core_entity/src/main/java/com/x/program/center/core/entity/PromptErrorLog.java
浏览文件 @
6f3ef609
...
...
@@ -23,7 +23,7 @@ import com.x.base.core.project.annotation.FieldDescribe;
import
com.x.base.core.project.tools.StringTools
;
@Entity
@ContainerEntity
(
dumpSize
=
1000
,
type
=
ContainerEntity
.
Type
.
content
,
reference
=
ContainerEntity
.
Reference
.
strong
)
@ContainerEntity
(
dumpSize
=
1000
,
type
=
ContainerEntity
.
Type
.
log
,
reference
=
ContainerEntity
.
Reference
.
soft
)
@Table
(
name
=
PersistenceProperties
.
PromptErrorLog
.
table
,
uniqueConstraints
=
{
@UniqueConstraint
(
name
=
PersistenceProperties
.
PromptErrorLog
.
table
+
JpaObject
.
IndexNameMiddle
+
JpaObject
.
DefaultUniqueConstraintSuffix
,
columnNames
=
{
JpaObject
.
IDCOLUMN
,
...
...
o2server/x_program_center_core_entity/src/main/java/com/x/program/center/core/entity/ScheduleLog.java
浏览文件 @
6f3ef609
...
...
@@ -22,7 +22,7 @@ import com.x.base.core.entity.annotation.ContainerEntity;
import
com.x.base.core.project.annotation.FieldDescribe
;
@Entity
@ContainerEntity
(
dumpSize
=
1000
,
type
=
ContainerEntity
.
Type
.
content
,
reference
=
ContainerEntity
.
Reference
.
strong
)
@ContainerEntity
(
dumpSize
=
1000
,
type
=
ContainerEntity
.
Type
.
log
,
reference
=
ContainerEntity
.
Reference
.
soft
)
@Table
(
name
=
PersistenceProperties
.
ScheduleLog
.
table
,
uniqueConstraints
=
{
@UniqueConstraint
(
name
=
PersistenceProperties
.
ScheduleLog
.
table
+
JpaObject
.
IndexNameMiddle
+
JpaObject
.
DefaultUniqueConstraintSuffix
,
columnNames
=
{
JpaObject
.
IDCOLUMN
,
...
...
o2server/x_program_center_core_entity/src/main/java/com/x/program/center/core/entity/UnexpectedErrorLog.java
浏览文件 @
6f3ef609
...
...
@@ -23,7 +23,7 @@ import com.x.base.core.project.annotation.FieldDescribe;
import
com.x.base.core.project.tools.StringTools
;
@Entity
@ContainerEntity
(
dumpSize
=
1000
,
type
=
ContainerEntity
.
Type
.
content
,
reference
=
ContainerEntity
.
Reference
.
strong
)
@ContainerEntity
(
dumpSize
=
1000
,
type
=
ContainerEntity
.
Type
.
log
,
reference
=
ContainerEntity
.
Reference
.
soft
)
@Table
(
name
=
PersistenceProperties
.
UnexpectedErrorLog
.
table
,
uniqueConstraints
=
{
@UniqueConstraint
(
name
=
PersistenceProperties
.
UnexpectedErrorLog
.
table
+
JpaObject
.
IndexNameMiddle
+
JpaObject
.
DefaultUniqueConstraintSuffix
,
columnNames
=
{
JpaObject
.
IDCOLUMN
,
...
...
o2server/x_program_center_core_entity/src/main/java/com/x/program/center/core/entity/WarnLog.java
浏览文件 @
6f3ef609
...
...
@@ -23,7 +23,7 @@ import com.x.base.core.project.annotation.FieldDescribe;
import
com.x.base.core.project.tools.StringTools
;
@Entity
@ContainerEntity
(
dumpSize
=
1000
,
type
=
ContainerEntity
.
Type
.
content
,
reference
=
ContainerEntity
.
Reference
.
strong
)
@ContainerEntity
(
dumpSize
=
1000
,
type
=
ContainerEntity
.
Type
.
log
,
reference
=
ContainerEntity
.
Reference
.
soft
)
@Table
(
name
=
PersistenceProperties
.
WarnLog
.
table
,
uniqueConstraints
=
{
@UniqueConstraint
(
name
=
PersistenceProperties
.
WarnLog
.
table
+
JpaObject
.
IndexNameMiddle
+
JpaObject
.
DefaultUniqueConstraintSuffix
,
columnNames
=
{
JpaObject
.
IDCOLUMN
,
...
...
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/jaxrs/table/ActionDelete.java
浏览文件 @
6f3ef609
...
...
@@ -6,13 +6,11 @@ import com.x.base.core.container.EntityManagerContainer;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.entity.annotation.CheckRemoveType
;
import
com.x.base.core.project.cache.ApplicationCache
;
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.WoId
;
import
com.x.query.assemble.designer.Business
;
import
com.x.query.core.entity.Query
;
import
com.x.query.core.entity.schema.Statement
;
import
com.x.query.core.entity.schema.Table
;
...
...
o2server/x_query_core_express/src/main/java/com/x/query/core/express/plan/Plan.java
浏览文件 @
6f3ef609
...
...
@@ -541,9 +541,6 @@ public abstract class Plan extends GsonPropertyObject {
/* 有两个地方用到了 */
private
ScriptEngine
getScriptEngine
()
throws
ScriptException
,
Exception
{
// ScriptEngineManager manager = new ScriptEngineManager();
// ScriptEngine scriptEngine = manager.getEngineByName("JavaScript");
// return scriptEngine;
if
(
null
==
this
.
scriptEngine
)
{
scriptEngine
=
ScriptFactory
.
newScriptEngine
();
scriptEngine
.
eval
(
Config
.
mooToolsScriptText
());
...
...
o2server/x_teamwork_assemble_control/src/main/java/com/x/teamwork/assemble/control/timertask/Timertask_BatchOperationTask.java
浏览文件 @
6f3ef609
...
...
@@ -49,7 +49,7 @@ public class Timertask_BatchOperationTask extends AbstractJob {
}
}
}
else
{
logger
.
info
(
"Timertask_BatchOperationTask -> not foun
t
any task batch operation, try to check unreview task in database......"
);
logger
.
info
(
"Timertask_BatchOperationTask -> not foun
d
any task batch operation, try to check unreview task in database......"
);
//如果队列里已经没有任务了,那么检查一下是否还有未revieiw的工作任务,添加到队列刷新工作作息的Review
BatchOperationPersistService
batchOperationPersistService
=
new
BatchOperationPersistService
();
TaskQueryService
taskQueryService
=
new
TaskQueryService
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录