提交 8426dd2d 编写于 作者: O o2sword

处理应用导入重复的的问题

上级 754ccea0
......@@ -36,10 +36,12 @@ public class AppInfo extends SliceJpaObject {
private static final long serialVersionUID = 3856138316794473794L;
private static final String TABLE = PersistenceProperties.AppInfo.table;
@Override
public String getId() {
return id;
}
@Override
public void setId(String id) {
this.id = id;
}
......@@ -50,32 +52,16 @@ public class AppInfo extends SliceJpaObject {
@Column(length = length_id, name = ColumnNamePrefix + id_FIELDNAME)
private String id = createId();
@Override
public void onPersist() throws Exception {
}
/*
* =========================================================================
* ========= 以上为 JpaObject 默认字段
* =========================================================================
* =========
*/
/*
* =========================================================================
* ========= 以下为具体不同的业务及数据表字段要求
* =========================================================================
* =========
*/
/* 更新运行方法 */
// public static String[] FLA GS = new String[] { "id", "appAlias", "appName" };
public static final String appName_FIELDNAME = "appName";
@Flag
@FieldDescribe("栏目名称")
@Column(length = JpaObject.length_96B, name = ColumnNamePrefix + appName_FIELDNAME)
@Index(name = TABLE + IndexNameMiddle + appName_FIELDNAME)
@Index(name = TABLE + IndexNameMiddle + appName_FIELDNAME, unique = true)
@CheckPersist(citationNotExists = {
/* 验证不可重名 */
@CitationNotExist(fields = "appName", type = AppInfo.class) }, allowEmpty = true)
@CitationNotExist(fields = "appName", type = AppInfo.class) }, allowEmpty = false)
private String appName;
public static final String appAlias_FIELDNAME = "appAlias";
......
......@@ -31,6 +31,10 @@ import com.x.base.core.entity.annotation.ContainerEntity;
import com.x.base.core.entity.annotation.Flag;
import com.x.base.core.project.annotation.FieldDescribe;
/**
* 门户平台应用
* @author sword
*/
@Entity
@ContainerEntity(dumpSize = 1000, type = ContainerEntity.Type.content, reference = ContainerEntity.Reference.strong)
@Table(name = PersistenceProperties.Portal.table, uniqueConstraints = {
......@@ -43,10 +47,12 @@ public class Portal extends SliceJpaObject {
private static final long serialVersionUID = -7520516033901189347L;
private static final String TABLE = PersistenceProperties.Portal.table;
@Override
public String getId() {
return id;
}
@Override
public void setId(String id) {
this.id = id;
}
......@@ -58,6 +64,7 @@ public class Portal extends SliceJpaObject {
/* 以上为 JpaObject 默认字段 */
@Override
public void onPersist() throws Exception {
this.portalCategory = StringUtils.trimToEmpty(this.portalCategory);
this.firstPage = StringUtils.trimToEmpty(this.firstPage);
......@@ -70,9 +77,8 @@ public class Portal extends SliceJpaObject {
@Flag
@FieldDescribe("名称.")
@Column(length = length_255B, name = ColumnNamePrefix + name_FIELDNAME)
@Index(name = TABLE + IndexNameMiddle + name_FIELDNAME)
@Index(name = TABLE + IndexNameMiddle + name_FIELDNAME, unique = true)
@CheckPersist(allowEmpty = false, simplyString = true, citationNotExists =
/* 检查不重名 */
@CitationNotExist(type = Portal.class, fields = { JpaObject.id_FIELDNAME, "name", "alias" }))
private String name;
......@@ -82,7 +88,6 @@ public class Portal extends SliceJpaObject {
@Column(length = length_255B, name = ColumnNamePrefix + alias_FIELDNAME)
@Index(name = TABLE + IndexNameMiddle + alias_FIELDNAME)
@CheckPersist(allowEmpty = true, simplyString = true, citationNotExists =
/* 检查不重名 */
@CitationNotExist(type = Portal.class, fields = { "id", "name", "alias" }))
private String alias;
......@@ -302,4 +307,4 @@ public class Portal extends SliceJpaObject {
this.mobileClient = mobileClient;
}
}
\ No newline at end of file
}
......@@ -32,6 +32,10 @@ import com.x.base.core.entity.annotation.Flag;
import com.x.base.core.project.annotation.FieldDescribe;
import com.x.processplatform.core.entity.PersistenceProperties;
/**
* 流程平台应用
* @author sword
*/
@Entity
@ContainerEntity(dumpSize = 5, type = ContainerEntity.Type.element, reference = ContainerEntity.Reference.strong)
@Table(name = PersistenceProperties.Element.Application.table, uniqueConstraints = {
......@@ -44,10 +48,12 @@ public class Application extends SliceJpaObject {
private static final long serialVersionUID = -7520516033901189347L;
private static final String TABLE = PersistenceProperties.Element.Application.table;
@Override
public String getId() {
return id;
}
@Override
public void setId(String id) {
this.id = id;
}
......@@ -59,6 +65,7 @@ public class Application extends SliceJpaObject {
/* 以上为 JpaObject 默认字段 */
@Override
public void onPersist() throws Exception {
this.applicationCategory = StringUtils.trimToEmpty(this.applicationCategory);
}
......@@ -72,8 +79,8 @@ public class Application extends SliceJpaObject {
@Flag
@FieldDescribe("名称.")
@Column(length = length_255B, name = ColumnNamePrefix + name_FIELDNAME)
@Index(name = TABLE + IndexNameMiddle + name_FIELDNAME, unique = true)
@CheckPersist(allowEmpty = false, simplyString = true, citationNotExists =
/* 检查不重名 */
@CitationNotExist(type = Application.class, fields = { "id", "name", "alias" }))
private String name;
......@@ -82,7 +89,6 @@ public class Application extends SliceJpaObject {
@FieldDescribe("应用别名,如果有必须唯一.")
@Column(length = length_255B, name = ColumnNamePrefix + alias_FIELDNAME)
@CheckPersist(allowEmpty = true, simplyString = true, citationNotExists =
/* 检查不重名 */
@CitationNotExist(type = Application.class, fields = { "id", "name", "alias" }))
private String alias;
......
......@@ -32,6 +32,10 @@ import com.x.base.core.entity.annotation.ContainerEntity;
import com.x.base.core.entity.annotation.Flag;
import com.x.base.core.project.annotation.FieldDescribe;
/**
* 数据中心应用
* @author sword
*/
@Entity
@ContainerEntity(dumpSize = 10, type = ContainerEntity.Type.content, reference = ContainerEntity.Reference.strong)
@Table(name = PersistenceProperties.Query.table, uniqueConstraints = {
......@@ -44,10 +48,12 @@ public class Query extends SliceJpaObject {
private static final long serialVersionUID = -7520516033901189347L;
private static final String TABLE = PersistenceProperties.Query.table;
@Override
public String getId() {
return id;
}
@Override
public void setId(String id) {
this.id = id;
}
......@@ -66,6 +72,7 @@ public class Query extends SliceJpaObject {
/* 以上为 JpaObject 默认字段 */
@Override
public void onPersist() throws Exception {
this.name = StringUtils.trimToEmpty(this.name);
this.alias = StringUtils.trimToEmpty(this.alias);
......@@ -81,9 +88,9 @@ public class Query extends SliceJpaObject {
@Flag
@FieldDescribe("名称.")
@Column(length = length_255B, name = ColumnNamePrefix + name_FIELDNAME)
@Index(name = TABLE + IndexNameMiddle + name_FIELDNAME, unique = true)
@CheckPersist(allowEmpty = false, simplyString = true, citationNotExists =
/* 检查不重名 */
@CitationNotExist(type = Query.class, fields = { "id", "name", "alias" }))
@CitationNotExist(type = Query.class, fields = { "name", "alias" }))
private String name;
public static final String alias_FIELDNAME = "alias";
......@@ -91,8 +98,7 @@ public class Query extends SliceJpaObject {
@FieldDescribe("应用别名,如果有必须唯一.")
@Column(length = length_255B, name = ColumnNamePrefix + alias_FIELDNAME)
@CheckPersist(allowEmpty = true, simplyString = true, citationNotExists =
/* 检查不重名 */
@CitationNotExist(type = Query.class, fields = { "id", "name", "alias" }))
@CitationNotExist(type = Query.class, fields = { "name", "alias" }))
private String alias;
public static final String description_FIELDNAME = "description";
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册