提交 0d889ccc 编写于 作者: O o2null

Merge branch '内容管理查看记录排除cipher用户,对review表建联合索引' into 'wrdp'

[内容管理]文档阅读记录排除cipher用户,对review表建联合索引

See merge request o2oa/o2oa!4472
...@@ -80,7 +80,7 @@ public class ActionQueryViewDocument extends BaseAction { ...@@ -80,7 +80,7 @@ public class ActionQueryViewDocument extends BaseAction {
if (check ) { if (check ) {
//只要不是管理员访问,则记录该文档的访问记录 //只要不是管理员访问,则记录该文档的访问记录
if ( !"xadmin".equalsIgnoreCase( personName) ) { if ( !"xadmin".equalsIgnoreCase( personName) && !"cipher".equalsIgnoreCase(personName)) {
try { try {
viewCount = documentViewRecordServiceAdv.addViewRecord( id, personName ); viewCount = documentViewRecordServiceAdv.addViewRecord( id, personName );
result.getData().document.setViewCount( viewCount ); result.getData().document.setViewCount( viewCount );
......
...@@ -12,6 +12,7 @@ import javax.persistence.Temporal; ...@@ -12,6 +12,7 @@ import javax.persistence.Temporal;
import javax.persistence.TemporalType; import javax.persistence.TemporalType;
import javax.persistence.UniqueConstraint; import javax.persistence.UniqueConstraint;
import com.x.query.core.entity.Item;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.openjpa.persistence.jdbc.Index; import org.apache.openjpa.persistence.jdbc.Index;
...@@ -27,13 +28,17 @@ import com.x.base.core.project.annotation.FieldDescribe; ...@@ -27,13 +28,17 @@ import com.x.base.core.project.annotation.FieldDescribe;
@Table(name = PersistenceProperties.Review.table, uniqueConstraints = { @Table(name = PersistenceProperties.Review.table, uniqueConstraints = {
@UniqueConstraint(name = PersistenceProperties.Review.table + JpaObject.IndexNameMiddle @UniqueConstraint(name = PersistenceProperties.Review.table + JpaObject.IndexNameMiddle
+ JpaObject.DefaultUniqueConstraintSuffix, columnNames = { JpaObject.IDCOLUMN, + JpaObject.DefaultUniqueConstraintSuffix, columnNames = { JpaObject.IDCOLUMN,
JpaObject.CREATETIMECOLUMN, JpaObject.UPDATETIMECOLUMN, JpaObject.SEQUENCECOLUMN }) }) JpaObject.CREATETIMECOLUMN, JpaObject.UPDATETIMECOLUMN, JpaObject.SEQUENCECOLUMN }) },
indexes = {
@javax.persistence.Index(name = Review.TABLE + Review.IndexNameMiddle + Review.docId_FIELDNAME,
columnList = Review.ColumnNamePrefix + Review.docId_FIELDNAME+","+
Review.ColumnNamePrefix + Review.permissionObj_FIELDNAME)})
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
public class Review extends SliceJpaObject { public class Review extends SliceJpaObject {
private static final long serialVersionUID = -570048661936488247L; private static final long serialVersionUID = -570048661936488247L;
private static final String TABLE = PersistenceProperties.Review.table; public static final String TABLE = PersistenceProperties.Review.table;
public String getId() { public String getId() {
return id; return id;
...@@ -108,7 +113,6 @@ public class Review extends SliceJpaObject { ...@@ -108,7 +113,6 @@ public class Review extends SliceJpaObject {
public static final String docId_FIELDNAME = "docId"; public static final String docId_FIELDNAME = "docId";
@FieldDescribe("文档ID.") @FieldDescribe("文档ID.")
@Column(length = JpaObject.length_id, name = ColumnNamePrefix + docId_FIELDNAME) @Column(length = JpaObject.length_id, name = ColumnNamePrefix + docId_FIELDNAME)
@Index(name = TABLE + IndexNameMiddle + docId_FIELDNAME)
@CheckPersist(allowEmpty = true) @CheckPersist(allowEmpty = true)
private String docId; private String docId;
...@@ -185,14 +189,12 @@ public class Review extends SliceJpaObject { ...@@ -185,14 +189,12 @@ public class Review extends SliceJpaObject {
public static final String isTop_FIELDNAME = "isTop"; public static final String isTop_FIELDNAME = "isTop";
@FieldDescribe("是否置顶") @FieldDescribe("是否置顶")
@Column(name = ColumnNamePrefix + isTop_FIELDNAME) @Column(name = ColumnNamePrefix + isTop_FIELDNAME)
@Index(name = TABLE + IndexNameMiddle + isTop_FIELDNAME)
@CheckPersist(allowEmpty = true) @CheckPersist(allowEmpty = true)
private Boolean isTop = false; private Boolean isTop = false;
public static final String hasIndexPic_FIELDNAME = "hasIndexPic"; public static final String hasIndexPic_FIELDNAME = "hasIndexPic";
@FieldDescribe("是否含有首页图片") @FieldDescribe("是否含有首页图片")
@Column(name = ColumnNamePrefix + hasIndexPic_FIELDNAME) @Column(name = ColumnNamePrefix + hasIndexPic_FIELDNAME)
@Index(name = TABLE + IndexNameMiddle + hasIndexPic_FIELDNAME)
@CheckPersist(allowEmpty = true) @CheckPersist(allowEmpty = true)
private Boolean hasIndexPic = false; private Boolean hasIndexPic = false;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册