package com.x.cms.core.entity.element; import java.util.Date; import java.util.List; import javax.persistence.Basic; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.Id; import javax.persistence.Inheritance; import javax.persistence.InheritanceType; import javax.persistence.Lob; import javax.persistence.OrderColumn; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; import javax.persistence.UniqueConstraint; import org.apache.openjpa.persistence.PersistentCollection; import org.apache.openjpa.persistence.jdbc.ContainerTable; import org.apache.openjpa.persistence.jdbc.ElementColumn; import org.apache.openjpa.persistence.jdbc.ElementIndex; import org.apache.openjpa.persistence.jdbc.Index; import com.x.base.core.entity.AbstractPersistenceProperties; import com.x.base.core.entity.JpaObject; import com.x.base.core.entity.SliceJpaObject; import com.x.base.core.entity.annotation.CheckPersist; import com.x.base.core.entity.annotation.ContainerEntity; import com.x.base.core.entity.annotation.Flag; import com.x.base.core.project.annotation.FieldDescribe; import com.x.cms.core.entity.PersistenceProperties; @Entity @ContainerEntity(dumpSize = 200, type = ContainerEntity.Type.content, reference = ContainerEntity.Reference.strong) @Table(name = PersistenceProperties.Element.QueryView.table, uniqueConstraints = { @UniqueConstraint(name = PersistenceProperties.Element.QueryView.table + JpaObject.IndexNameMiddle + JpaObject.DefaultUniqueConstraintSuffix, columnNames = { JpaObject.IDCOLUMN, JpaObject.CREATETIMECOLUMN, JpaObject.UPDATETIMECOLUMN, JpaObject.SEQUENCECOLUMN }) }) @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) public class QueryView extends SliceJpaObject { private static final long serialVersionUID = -7520516033901189347L; private static final String TABLE = PersistenceProperties.Element.QueryView.table; 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(); /* 以上为 JpaObject 默认字段 */ public void onPersist() throws Exception { } /* 更新运行方法 */ // public static String[] FLA GS = new String[] { "name", "id" }; /* flag标志位 */ /* Entity 默认字段结束 */ public static final String name_FIELDNAME = "name"; @Flag @FieldDescribe("名称.") @Column(length = AbstractPersistenceProperties.processPlatform_name_length, name = ColumnNamePrefix + name_FIELDNAME) @Index(name = TABLE + IndexNameMiddle + name_FIELDNAME) @CheckPersist(allowEmpty = false) private String name; public static final String alias_FIELDNAME = "alias"; @FieldDescribe("别名.") @Column(length = AbstractPersistenceProperties.processPlatform_name_length, name = ColumnNamePrefix + alias_FIELDNAME) @CheckPersist(allowEmpty = true) private String alias; public static final String description_FIELDNAME = "description"; @FieldDescribe("描述.") @Column(length = JpaObject.length_255B, name = ColumnNamePrefix + description_FIELDNAME) @CheckPersist(allowEmpty = true) private String description; public static final String appId_FIELDNAME = "appId"; @FieldDescribe("所属应用.") @Column(length = JpaObject.length_id, name = ColumnNamePrefix + appId_FIELDNAME) @Index(name = TABLE + IndexNameMiddle + appId_FIELDNAME) @CheckPersist(allowEmpty = false) private String appId; public static final String appName_FIELDNAME = "appName"; @FieldDescribe("所属应用.") @Column(length = JpaObject.length_id, name = ColumnNamePrefix + appName_FIELDNAME) @Index(name = TABLE + IndexNameMiddle + appName_FIELDNAME) @CheckPersist(allowEmpty = false) private String appName; public static final String timingEnable_FIELDNAME = "timingEnable"; @FieldDescribe("是否是定时任务.") @CheckPersist(allowEmpty = true) @Column(name = ColumnNamePrefix + timingEnable_FIELDNAME) private Boolean timingEnable; public static final String timingTouch_FIELDNAME = "timingTouch"; @FieldDescribe("上次运行后触发器触发过的次数,用于判断是否要运行,如果需要运行那么重置为0,避免由于时间往后调导致的不运行.") @CheckPersist(allowEmpty = true) @Column(name = ColumnNamePrefix + timingTouch_FIELDNAME) @Index(name = TABLE + IndexNameMiddle + timingTouch_FIELDNAME) private Integer timingTouch; public static final String timingInterval_FIELDNAME = "timingInterval"; @FieldDescribe("运行间隔,分钟.") @CheckPersist(allowEmpty = true) @Column(name = ColumnNamePrefix + timingInterval_FIELDNAME) @Index(name = TABLE + IndexNameMiddle + timingInterval_FIELDNAME) private Integer timingInterval; public static final String icon_FIELDNAME = "icon"; @FieldDescribe("icon Base64编码后的文本.") @Lob @Basic(fetch = FetchType.EAGER) @Column(length = JpaObject.length_1M, name = ColumnNamePrefix + icon_FIELDNAME) @CheckPersist(allowEmpty = true) private String icon; public static final String creatorPerson_FIELDNAME = "creatorPerson"; @FieldDescribe("应用的创建者。") @CheckPersist(allowEmpty = false) @Column(length = AbstractPersistenceProperties.organization_name_length, name = ColumnNamePrefix + creatorPerson_FIELDNAME) @Index(name = TABLE + IndexNameMiddle + creatorPerson_FIELDNAME) private String creatorPerson; public static final String lastUpdateTime_FIELDNAME = "lastUpdateTime"; @FieldDescribe("应用的最后修改时间。") @Temporal(TemporalType.TIMESTAMP) @CheckPersist(allowEmpty = false) @Column(name = ColumnNamePrefix + lastUpdateTime_FIELDNAME) @Index(name = TABLE + IndexNameMiddle + lastUpdateTime_FIELDNAME) private Date lastUpdateTime; public static final String lastUpdatePerson_FIELDNAME = "lastUpdatePerson"; @FieldDescribe("应用的最后修改者") @CheckPersist(allowEmpty = false) @Column(length = AbstractPersistenceProperties.organization_name_length, name = ColumnNamePrefix + lastUpdatePerson_FIELDNAME) @Index(name = TABLE + IndexNameMiddle + lastUpdatePerson_FIELDNAME) private String lastUpdatePerson; public static final String layout_FIELDNAME = "layout"; @FieldDescribe("显示布局.") @Lob @Basic(fetch = FetchType.EAGER) @Column(length = JpaObject.length_10M, name = ColumnNamePrefix + layout_FIELDNAME) @CheckPersist(allowEmpty = true) private String layout; public static final String data_FIELDNAME = "data"; @FieldDescribe("方案文本.") @Lob @Basic(fetch = FetchType.EAGER) @Column(length = JpaObject.length_10M, name = ColumnNamePrefix + data_FIELDNAME) @CheckPersist(allowEmpty = true) private String data; public static final String afterGridScriptText_FIELDNAME = "afterGridScriptText"; @FieldDescribe("gird生成后运行脚本.") @Lob @Basic(fetch = FetchType.EAGER) @Column(length = JpaObject.length_1M, name = ColumnNamePrefix + afterGridScriptText_FIELDNAME) @CheckPersist(allowEmpty = true) private String afterGridScriptText; public static final String afterGroupGridScriptText_FIELDNAME = "afterGroupGridScriptText"; @FieldDescribe("gropuGird生成后运行脚本.") @Lob @Basic(fetch = FetchType.EAGER) @Column(length = JpaObject.length_1M, name = ColumnNamePrefix + afterGroupGridScriptText_FIELDNAME) @CheckPersist(allowEmpty = true) private String afterGroupGridScriptText; public static final String afterCalculateGridScriptText_FIELDNAME = "afterCalculateGridScriptText"; @FieldDescribe("calculateGrid生成后运行脚本.") @Lob @Basic(fetch = FetchType.EAGER) @Column(length = JpaObject.length_1M, name = ColumnNamePrefix + afterCalculateGridScriptText_FIELDNAME) @CheckPersist(allowEmpty = true) private String afterCalculateGridScriptText; public static final String display_FIELDNAME = "display"; @FieldDescribe("是否前端可见.") @Column(name = ColumnNamePrefix + display_FIELDNAME) private Boolean display; public static final String code_FIELDNAME = "code"; @FieldDescribe("前台运行脚本.") @Lob @Basic(fetch = FetchType.EAGER) @Column(length = JpaObject.length_1M, name = ColumnNamePrefix + code_FIELDNAME) @CheckPersist(allowEmpty = true) private String code; public static final String availablePersonList_FIELDNAME = "availablePersonList"; @FieldDescribe("可使用的人.") @PersistentCollection(fetch = FetchType.EAGER) @OrderColumn(name = ORDERCOLUMNCOLUMN) @ContainerTable(name = TABLE + ContainerTableNameMiddle + availablePersonList_FIELDNAME, joinIndex = @Index(name = TABLE + IndexNameMiddle + availablePersonList_FIELDNAME + JoinIndexNameSuffix)) @ElementColumn(length = AbstractPersistenceProperties.organization_name_length, name = ColumnNamePrefix + availablePersonList_FIELDNAME) @ElementIndex(name = TABLE + IndexNameMiddle + availablePersonList_FIELDNAME + ElementIndexNameSuffix) @CheckPersist(allowEmpty = true) private List availablePersonList; public static final String availableIdentityList_FIELDNAME = "availableIdentityList"; @FieldDescribe("可使用的身份.") @PersistentCollection(fetch = FetchType.EAGER) @OrderColumn(name = ORDERCOLUMNCOLUMN) @ContainerTable(name = TABLE + ContainerTableNameMiddle + availableIdentityList_FIELDNAME, joinIndex = @Index(name = TABLE + IndexNameMiddle + availableIdentityList_FIELDNAME + JoinIndexNameSuffix)) @ElementColumn(length = AbstractPersistenceProperties.organization_name_length, name = ColumnNamePrefix + availableIdentityList_FIELDNAME) @ElementIndex(name = TABLE + IndexNameMiddle + availableIdentityList_FIELDNAME + ElementIndexNameSuffix) @CheckPersist(allowEmpty = true) private List availableIdentityList; public static final String availableUnitList_FIELDNAME = "availableUnitList"; @FieldDescribe("允许访问的组织列表.") @PersistentCollection(fetch = FetchType.EAGER) @OrderColumn(name = ORDERCOLUMNCOLUMN) @ContainerTable(name = TABLE + ContainerTableNameMiddle + availableUnitList_FIELDNAME, joinIndex = @Index(name = TABLE + IndexNameMiddle + availableUnitList_FIELDNAME + JoinIndexNameSuffix)) @ElementColumn(length = AbstractPersistenceProperties.organization_name_length, name = ColumnNamePrefix + availableUnitList_FIELDNAME) @ElementIndex(name = TABLE + IndexNameMiddle + availableUnitList_FIELDNAME + ElementIndexNameSuffix) @CheckPersist(allowEmpty = true) private List availableUnitList; public static final String controllerList_FIELDNAME = "controllerList"; @FieldDescribe("栏目管理者。") @PersistentCollection(fetch = FetchType.EAGER) @OrderColumn(name = ORDERCOLUMNCOLUMN) @ContainerTable(name = TABLE + ContainerTableNameMiddle + controllerList_FIELDNAME, joinIndex = @Index(name = TABLE + IndexNameMiddle + controllerList_FIELDNAME + JoinIndexNameSuffix)) @ElementColumn(length = AbstractPersistenceProperties.organization_name_length, name = ColumnNamePrefix + controllerList_FIELDNAME) @ElementIndex(name = TABLE + IndexNameMiddle + controllerList_FIELDNAME + ElementIndexNameSuffix) @CheckPersist(allowEmpty = true) private List controllerList; public String getName() { return name; } public void setName(String name) { this.name = name; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public String getAlias() { return alias; } public void setAlias(String alias) { this.alias = alias; } public String getIcon() { return icon; } public void setIcon(String icon) { this.icon = icon; } public List getControllerList() { return controllerList; } public void setControllerList(List controllerList) { this.controllerList = controllerList; } public String getCreatorPerson() { return creatorPerson; } public void setCreatorPerson(String creatorPerson) { this.creatorPerson = creatorPerson; } public Date getLastUpdateTime() { return lastUpdateTime; } public void setLastUpdateTime(Date lastUpdateTime) { this.lastUpdateTime = lastUpdateTime; } public String getLastUpdatePerson() { return lastUpdatePerson; } public void setLastUpdatePerson(String lastUpdatePerson) { this.lastUpdatePerson = lastUpdatePerson; } public String getLayout() { return layout; } public void setLayout(String layout) { this.layout = layout; } public String getAfterGridScriptText() { return afterGridScriptText; } public void setAfterGridScriptText(String afterGridScriptText) { this.afterGridScriptText = afterGridScriptText; } public String getAfterGroupGridScriptText() { return afterGroupGridScriptText; } public void setAfterGroupGridScriptText(String afterGroupGridScriptText) { this.afterGroupGridScriptText = afterGroupGridScriptText; } public String getAfterCalculateGridScriptText() { return afterCalculateGridScriptText; } public void setAfterCalculateGridScriptText(String afterCalculateGridScriptText) { this.afterCalculateGridScriptText = afterCalculateGridScriptText; } public String getAppId() { return appId; } public void setAppId(String appId) { this.appId = appId; } public Boolean getTimingEnable() { return timingEnable; } public void setTimingEnable(Boolean timingEnable) { this.timingEnable = timingEnable; } public Integer getTimingTouch() { return timingTouch; } public void setTimingTouch(Integer timingTouch) { this.timingTouch = timingTouch; } public Integer getTimingInterval() { return timingInterval; } public void setTimingInterval(Integer timingInterval) { this.timingInterval = timingInterval; } public List getAvailableIdentityList() { return availableIdentityList; } public void setAvailableIdentityList(List availableIdentityList) { this.availableIdentityList = availableIdentityList; } public List getAvailablePersonList() { return availablePersonList; } public void setAvailablePersonList(List availablePersonList) { this.availablePersonList = availablePersonList; } public String getData() { return data; } public void setData(String data) { this.data = data; } public Boolean getDisplay() { return display; } public void setDisplay(Boolean display) { this.display = display; } public String getAppName() { return appName; } public void setAppName(String appName) { this.appName = appName; } public List getAvailableUnitList() { return availableUnitList; } public void setAvailableUnitList(List availableUnitList) { this.availableUnitList = availableUnitList; } public String getCode() { return code; } public void setCode(String code) { this.code = code; } }