QueryView.java 14.5 KB
Newer Older
R
roo00 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
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;
R
roo00 已提交
16 17
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
R
roo00 已提交
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
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
Z
zhourui 已提交
36
@ContainerEntity(dumpSize = 200, type = ContainerEntity.Type.content, reference = ContainerEntity.Reference.strong)
R
roo00 已提交
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
@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("名称.")
R
update  
roo00 已提交
76 77
	@Column(length = AbstractPersistenceProperties.processPlatform_name_length, name = ColumnNamePrefix
			+ name_FIELDNAME)
R
roo00 已提交
78 79 80 81 82 83
	@Index(name = TABLE + IndexNameMiddle + name_FIELDNAME)
	@CheckPersist(allowEmpty = false)
	private String name;

	public static final String alias_FIELDNAME = "alias";
	@FieldDescribe("别名.")
R
update  
roo00 已提交
84 85
	@Column(length = AbstractPersistenceProperties.processPlatform_name_length, name = ColumnNamePrefix
			+ alias_FIELDNAME)
R
roo00 已提交
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
	@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)
R
update  
roo00 已提交
112
	@Column(name = ColumnNamePrefix + timingEnable_FIELDNAME)
R
roo00 已提交
113 114 115 116 117
	private Boolean timingEnable;

	public static final String timingTouch_FIELDNAME = "timingTouch";
	@FieldDescribe("上次运行后触发器触发过的次数,用于判断是否要运行,如果需要运行那么重置为0,避免由于时间往后调导致的不运行.")
	@CheckPersist(allowEmpty = true)
R
update  
roo00 已提交
118
	@Column(name = ColumnNamePrefix + timingTouch_FIELDNAME)
R
roo00 已提交
119 120 121 122 123 124
	@Index(name = TABLE + IndexNameMiddle + timingTouch_FIELDNAME)
	private Integer timingTouch;

	public static final String timingInterval_FIELDNAME = "timingInterval";
	@FieldDescribe("运行间隔,分钟.")
	@CheckPersist(allowEmpty = true)
R
update  
roo00 已提交
125
	@Column(name = ColumnNamePrefix + timingInterval_FIELDNAME)
R
roo00 已提交
126 127 128 129 130 131 132
	@Index(name = TABLE + IndexNameMiddle + timingInterval_FIELDNAME)
	private Integer timingInterval;

	public static final String icon_FIELDNAME = "icon";
	@FieldDescribe("icon Base64编码后的文本.")
	@Lob
	@Basic(fetch = FetchType.EAGER)
R
update  
roo00 已提交
133
	@Column(length = JpaObject.length_1M, name = ColumnNamePrefix + icon_FIELDNAME)
R
roo00 已提交
134 135
	@CheckPersist(allowEmpty = true)
	private String icon;
R
update  
roo00 已提交
136

R
roo00 已提交
137 138 139
	public static final String creatorPerson_FIELDNAME = "creatorPerson";
	@FieldDescribe("应用的创建者。")
	@CheckPersist(allowEmpty = false)
R
update  
roo00 已提交
140 141
	@Column(length = AbstractPersistenceProperties.organization_name_length, name = ColumnNamePrefix
			+ creatorPerson_FIELDNAME)
R
roo00 已提交
142 143 144 145 146
	@Index(name = TABLE + IndexNameMiddle + creatorPerson_FIELDNAME)
	private String creatorPerson;

	public static final String lastUpdateTime_FIELDNAME = "lastUpdateTime";
	@FieldDescribe("应用的最后修改时间。")
R
roo00 已提交
147
	@Temporal(TemporalType.TIMESTAMP)
R
roo00 已提交
148
	@CheckPersist(allowEmpty = false)
R
update  
roo00 已提交
149
	@Column(name = ColumnNamePrefix + lastUpdateTime_FIELDNAME)
R
roo00 已提交
150 151 152 153 154 155
	@Index(name = TABLE + IndexNameMiddle + lastUpdateTime_FIELDNAME)
	private Date lastUpdateTime;

	public static final String lastUpdatePerson_FIELDNAME = "lastUpdatePerson";
	@FieldDescribe("应用的最后修改者")
	@CheckPersist(allowEmpty = false)
R
update  
roo00 已提交
156 157
	@Column(length = AbstractPersistenceProperties.organization_name_length, name = ColumnNamePrefix
			+ lastUpdatePerson_FIELDNAME)
R
roo00 已提交
158 159 160 161 162 163 164
	@Index(name = TABLE + IndexNameMiddle + lastUpdatePerson_FIELDNAME)
	private String lastUpdatePerson;

	public static final String layout_FIELDNAME = "layout";
	@FieldDescribe("显示布局.")
	@Lob
	@Basic(fetch = FetchType.EAGER)
R
update  
roo00 已提交
165
	@Column(length = JpaObject.length_10M, name = ColumnNamePrefix + layout_FIELDNAME)
R
roo00 已提交
166 167 168 169 170 171 172
	@CheckPersist(allowEmpty = true)
	private String layout;

	public static final String data_FIELDNAME = "data";
	@FieldDescribe("方案文本.")
	@Lob
	@Basic(fetch = FetchType.EAGER)
R
update  
roo00 已提交
173
	@Column(length = JpaObject.length_10M, name = ColumnNamePrefix + data_FIELDNAME)
R
roo00 已提交
174 175 176 177 178 179 180
	@CheckPersist(allowEmpty = true)
	private String data;

	public static final String afterGridScriptText_FIELDNAME = "afterGridScriptText";
	@FieldDescribe("gird生成后运行脚本.")
	@Lob
	@Basic(fetch = FetchType.EAGER)
R
update  
roo00 已提交
181
	@Column(length = JpaObject.length_1M, name = ColumnNamePrefix + afterGridScriptText_FIELDNAME)
R
roo00 已提交
182 183 184 185 186 187 188
	@CheckPersist(allowEmpty = true)
	private String afterGridScriptText;

	public static final String afterGroupGridScriptText_FIELDNAME = "afterGroupGridScriptText";
	@FieldDescribe("gropuGird生成后运行脚本.")
	@Lob
	@Basic(fetch = FetchType.EAGER)
R
update  
roo00 已提交
189
	@Column(length = JpaObject.length_1M, name = ColumnNamePrefix + afterGroupGridScriptText_FIELDNAME)
R
roo00 已提交
190 191 192 193 194 195 196
	@CheckPersist(allowEmpty = true)
	private String afterGroupGridScriptText;

	public static final String afterCalculateGridScriptText_FIELDNAME = "afterCalculateGridScriptText";
	@FieldDescribe("calculateGrid生成后运行脚本.")
	@Lob
	@Basic(fetch = FetchType.EAGER)
R
update  
roo00 已提交
197
	@Column(length = JpaObject.length_1M, name = ColumnNamePrefix + afterCalculateGridScriptText_FIELDNAME)
R
roo00 已提交
198 199 200 201 202 203 204 205 206 207 208 209
	@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)
R
update  
roo00 已提交
210
	@Column(length = JpaObject.length_1M, name = ColumnNamePrefix + code_FIELDNAME)
R
roo00 已提交
211 212
	@CheckPersist(allowEmpty = true)
	private String code;
R
update  
roo00 已提交
213

R
roo00 已提交
214 215 216
	public static final String availablePersonList_FIELDNAME = "availablePersonList";
	@FieldDescribe("可使用的人.")
	@PersistentCollection(fetch = FetchType.EAGER)
R
update  
roo00 已提交
217 218 219 220 221 222
	@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)
R
roo00 已提交
223 224 225 226 227 228 229
	@ElementIndex(name = TABLE + IndexNameMiddle + availablePersonList_FIELDNAME + ElementIndexNameSuffix)
	@CheckPersist(allowEmpty = true)
	private List<String> availablePersonList;

	public static final String availableIdentityList_FIELDNAME = "availableIdentityList";
	@FieldDescribe("可使用的身份.")
	@PersistentCollection(fetch = FetchType.EAGER)
R
roo00 已提交
230
	@OrderColumn(name = ORDERCOLUMNCOLUMN)
R
update  
roo00 已提交
231 232 233 234 235
	@ContainerTable(name = TABLE + ContainerTableNameMiddle
			+ availableIdentityList_FIELDNAME, joinIndex = @Index(name = TABLE + IndexNameMiddle
					+ availableIdentityList_FIELDNAME + JoinIndexNameSuffix))
	@ElementColumn(length = AbstractPersistenceProperties.organization_name_length, name = ColumnNamePrefix
			+ availableIdentityList_FIELDNAME)
R
roo00 已提交
236 237 238 239 240 241 242
	@ElementIndex(name = TABLE + IndexNameMiddle + availableIdentityList_FIELDNAME + ElementIndexNameSuffix)
	@CheckPersist(allowEmpty = true)
	private List<String> availableIdentityList;

	public static final String availableUnitList_FIELDNAME = "availableUnitList";
	@FieldDescribe("允许访问的组织列表.")
	@PersistentCollection(fetch = FetchType.EAGER)
R
update  
roo00 已提交
243 244 245 246 247 248
	@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)
R
roo00 已提交
249 250 251 252 253 254 255
	@ElementIndex(name = TABLE + IndexNameMiddle + availableUnitList_FIELDNAME + ElementIndexNameSuffix)
	@CheckPersist(allowEmpty = true)
	private List<String> availableUnitList;

	public static final String controllerList_FIELDNAME = "controllerList";
	@FieldDescribe("栏目管理者。")
	@PersistentCollection(fetch = FetchType.EAGER)
R
update  
roo00 已提交
256
	@OrderColumn(name = ORDERCOLUMNCOLUMN)
R
roo00 已提交
257 258
	@ContainerTable(name = TABLE + ContainerTableNameMiddle + controllerList_FIELDNAME, joinIndex = @Index(name = TABLE
			+ IndexNameMiddle + controllerList_FIELDNAME + JoinIndexNameSuffix))
R
update  
roo00 已提交
259 260
	@ElementColumn(length = AbstractPersistenceProperties.organization_name_length, name = ColumnNamePrefix
			+ controllerList_FIELDNAME)
R
roo00 已提交
261 262
	@ElementIndex(name = TABLE + IndexNameMiddle + controllerList_FIELDNAME + ElementIndexNameSuffix)
	@CheckPersist(allowEmpty = true)
R
update  
roo00 已提交
263
	private List<String> controllerList;
R
roo00 已提交
264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449

	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<String> getControllerList() {
		return controllerList;
	}

	public void setControllerList(List<String> 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<String> getAvailableIdentityList() {
		return availableIdentityList;
	}

	public void setAvailableIdentityList(List<String> availableIdentityList) {
		this.availableIdentityList = availableIdentityList;
	}

	public List<String> getAvailablePersonList() {
		return availablePersonList;
	}

	public void setAvailablePersonList(List<String> 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<String> getAvailableUnitList() {
		return availableUnitList;
	}

	public void setAvailableUnitList(List<String> availableUnitList) {
		this.availableUnitList = availableUnitList;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

}