|
|
@ -33,13 +33,15 @@ import com.liferay.portal.kernel.util.StringPool; |
|
|
|
* The implementation of the audit event local service. |
|
|
|
* The implementation of the audit event local service. |
|
|
|
* |
|
|
|
* |
|
|
|
* <p> |
|
|
|
* <p> |
|
|
|
* All custom service methods should be put in this class. Whenever methods are added, rerun |
|
|
|
* All custom service methods should be put in this class. Whenever methods are |
|
|
|
* ServiceBuilder to copy their definitions into the |
|
|
|
* added, rerun ServiceBuilder to copy their definitions into the |
|
|
|
* {@link it.tref.liferay.portos.audit.service.AuditEventLocalService} interface. |
|
|
|
* {@link it.tref.liferay.portos.audit.service.AuditEventLocalService} |
|
|
|
|
|
|
|
* interface. |
|
|
|
* |
|
|
|
* |
|
|
|
* <p> |
|
|
|
* <p> |
|
|
|
* This is a local service. Methods of this service will not have security checks based on the |
|
|
|
* This is a local service. Methods of this service will not have security |
|
|
|
* propagated JAAS credentials because this service can only be accessed from within the same VM. |
|
|
|
* checks based on the propagated JAAS credentials because this service can only |
|
|
|
|
|
|
|
* be accessed from within the same VM. |
|
|
|
* </p> |
|
|
|
* </p> |
|
|
|
* |
|
|
|
* |
|
|
|
* @author ViVieb srl |
|
|
|
* @author ViVieb srl |
|
|
@ -48,233 +50,243 @@ import com.liferay.portal.kernel.util.StringPool; |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public class AuditEventLocalServiceImpl extends AuditEventLocalServiceBaseImpl { |
|
|
|
public class AuditEventLocalServiceImpl extends AuditEventLocalServiceBaseImpl { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public AuditEvent addAuditEvent(AuditMessage auditMessage) throws SystemException { |
|
|
|
public AuditEvent addAuditEvent(AuditMessage auditMessage) throws SystemException { |
|
|
|
|
|
|
|
|
|
|
|
AuditEvent auditEvent = auditEventPersistence.create(counterLocalService.increment(AuditEvent.class.getName())); |
|
|
|
AuditEvent auditEvent = auditEventPersistence.create(counterLocalService.increment(AuditEvent.class |
|
|
|
|
|
|
|
.getName())); |
|
|
|
auditEvent.setCompanyId(auditMessage.getCompanyId()); |
|
|
|
|
|
|
|
auditEvent.setUserId(auditMessage.getUserId()); |
|
|
|
auditEvent.setCompanyId(auditMessage.getCompanyId()); |
|
|
|
auditEvent.setUserName(auditMessage.getUserName()); |
|
|
|
auditEvent.setUserId(auditMessage.getUserId()); |
|
|
|
auditEvent.setCreateDate(auditMessage.getTimestamp()); |
|
|
|
auditEvent.setUserName(auditMessage.getUserName()); |
|
|
|
auditEvent.setEventType(auditMessage.getEventType()); |
|
|
|
auditEvent.setCreateDate(auditMessage.getTimestamp()); |
|
|
|
auditEvent.setClassName(auditMessage.getClassName()); |
|
|
|
auditEvent.setEventType(auditMessage.getEventType()); |
|
|
|
auditEvent.setClassPK(auditMessage.getClassPK()); |
|
|
|
auditEvent.setClassName(auditMessage.getClassName()); |
|
|
|
auditEvent.setMessage(auditMessage.getMessage()); |
|
|
|
auditEvent.setClassPK(auditMessage.getClassPK()); |
|
|
|
auditEvent.setClientHost(auditMessage.getClientHost()); |
|
|
|
auditEvent.setMessage(auditMessage.getMessage()); |
|
|
|
auditEvent.setClientIP(auditMessage.getClientIP()); |
|
|
|
auditEvent.setClientHost(auditMessage.getClientHost()); |
|
|
|
auditEvent.setServerName(auditMessage.getServerName()); |
|
|
|
auditEvent.setClientIP(auditMessage.getClientIP()); |
|
|
|
auditEvent.setServerPort(auditMessage.getServerPort()); |
|
|
|
auditEvent.setServerName(auditMessage.getServerName()); |
|
|
|
auditEvent.setSessionID(auditMessage.getSessionID()); |
|
|
|
auditEvent.setServerPort(auditMessage.getServerPort()); |
|
|
|
auditEvent.setServerPort(auditMessage.getServerPort()); |
|
|
|
auditEvent.setSessionID(auditMessage.getSessionID()); |
|
|
|
estreazioneAdditionalInfo(auditEvent, auditMessage); |
|
|
|
auditEvent.setServerPort(auditMessage.getServerPort()); |
|
|
|
|
|
|
|
estreazioneAdditionalInfo(auditEvent, auditMessage); |
|
|
|
|
|
|
|
|
|
|
|
return auditEventPersistence.update(auditEvent); |
|
|
|
return auditEventPersistence.update(auditEvent); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void estreazioneAdditionalInfo(AuditEvent auditEvent, AuditMessage auditMessage) { |
|
|
|
private void estreazioneAdditionalInfo(AuditEvent auditEvent, AuditMessage auditMessage) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
auditEvent.setAuditEventTable(auditMessage.getAdditionalInfo().getString( |
|
|
|
auditEvent.setAuditEventTable(auditMessage.getAdditionalInfo().getString(AuditKey.FIELD_AUDIT_EVENT_TABLE, |
|
|
|
AuditKey.FIELD_AUDIT_EVENT_TABLE, StringPool.BLANK)); |
|
|
|
StringPool.BLANK)); |
|
|
|
auditEvent.setEventCategory(auditMessage.getAdditionalInfo().getString(AuditKey.FIELD_EVENT_CATEGORY, |
|
|
|
auditEvent.setEventCategory(auditMessage.getAdditionalInfo().getString(AuditKey.FIELD_EVENT_CATEGORY, |
|
|
|
StringPool.BLANK)); |
|
|
|
StringPool.BLANK)); |
|
|
|
auditEvent.setEventAction(auditMessage.getAdditionalInfo().getString(AuditKey.FIELD_EVENT_ACTION, |
|
|
|
auditEvent |
|
|
|
StringPool.BLANK)); |
|
|
|
.setEventAction(auditMessage.getAdditionalInfo().getString(AuditKey.FIELD_EVENT_ACTION, StringPool.BLANK)); |
|
|
|
auditEvent.setEnteCodice(auditMessage.getAdditionalInfo().getString(AuditKey.FIELD_ENTE_CODICE, |
|
|
|
auditEvent.setEnteCodice(auditMessage.getAdditionalInfo().getString(AuditKey.FIELD_ENTE_CODICE, StringPool.BLANK)); |
|
|
|
StringPool.BLANK)); |
|
|
|
auditEvent.setEnteGroupId(auditMessage.getAdditionalInfo().getLong(AuditKey.FIELD_ENTE_GROUP_ID, 0l)); |
|
|
|
auditEvent.setEnteGroupId(auditMessage.getAdditionalInfo().getLong(AuditKey.FIELD_ENTE_GROUP_ID, 0l)); |
|
|
|
auditEvent.setDiff(auditMessage.getAdditionalInfo().getString(AuditKey.FIELD_DIFF, StringPool.BLANK)); |
|
|
|
auditEvent.setDiff(auditMessage.getAdditionalInfo().getString(AuditKey.FIELD_DIFF, StringPool.BLANK)); |
|
|
|
|
|
|
|
|
|
|
|
auditEvent.setParentClassPK(auditMessage.getAdditionalInfo().getString(AuditKey.FIELD_PARENT_CLASS_PK, "0l")); |
|
|
|
auditEvent.setParentClassPK(auditMessage.getAdditionalInfo().getString( |
|
|
|
auditEvent.setParentClassName(auditMessage.getAdditionalInfo().getString(AuditKey.FIELD_PARENT_CLASS_NAME, |
|
|
|
AuditKey.FIELD_PARENT_CLASS_PK, "0l")); |
|
|
|
StringPool.BLANK)); |
|
|
|
auditEvent.setParentClassName(auditMessage.getAdditionalInfo().getString( |
|
|
|
auditEvent.setRelatedClassPK(auditMessage.getAdditionalInfo().getString(AuditKey.FIELD_RELATED_CLASS_PK, "0l")); |
|
|
|
AuditKey.FIELD_PARENT_CLASS_NAME, StringPool.BLANK)); |
|
|
|
auditEvent.setRelatedClassName(auditMessage.getAdditionalInfo().getString(AuditKey.FIELD_RELATED_CLASS_NAME, |
|
|
|
auditEvent.setRelatedClassPK(auditMessage.getAdditionalInfo().getString( |
|
|
|
StringPool.BLANK)); |
|
|
|
AuditKey.FIELD_RELATED_CLASS_PK, "0l")); |
|
|
|
auditMessage.getAdditionalInfo().remove(AuditKey.FIELD_AUDIT_EVENT_TABLE); |
|
|
|
auditEvent.setRelatedClassName(auditMessage.getAdditionalInfo().getString( |
|
|
|
auditMessage.getAdditionalInfo().remove(AuditKey.FIELD_EVENT_CATEGORY); |
|
|
|
AuditKey.FIELD_RELATED_CLASS_NAME, StringPool.BLANK)); |
|
|
|
auditMessage.getAdditionalInfo().remove(AuditKey.FIELD_EVENT_ACTION); |
|
|
|
auditMessage.getAdditionalInfo().remove(AuditKey.FIELD_AUDIT_EVENT_TABLE); |
|
|
|
auditMessage.getAdditionalInfo().remove(AuditKey.FIELD_ENTE_CODICE); |
|
|
|
auditMessage.getAdditionalInfo().remove(AuditKey.FIELD_EVENT_CATEGORY); |
|
|
|
auditMessage.getAdditionalInfo().remove(AuditKey.FIELD_ENTE_GROUP_ID); |
|
|
|
auditMessage.getAdditionalInfo().remove(AuditKey.FIELD_EVENT_ACTION); |
|
|
|
auditMessage.getAdditionalInfo().remove(AuditKey.FIELD_DIFF); |
|
|
|
auditMessage.getAdditionalInfo().remove(AuditKey.FIELD_ENTE_CODICE); |
|
|
|
auditMessage.getAdditionalInfo().remove(AuditKey.FIELD_PARENT_CLASS_NAME); |
|
|
|
auditMessage.getAdditionalInfo().remove(AuditKey.FIELD_ENTE_GROUP_ID); |
|
|
|
auditMessage.getAdditionalInfo().remove(AuditKey.FIELD_PARENT_CLASS_PK); |
|
|
|
auditMessage.getAdditionalInfo().remove(AuditKey.FIELD_DIFF); |
|
|
|
auditMessage.getAdditionalInfo().remove(AuditKey.FIELD_RELATED_CLASS_NAME); |
|
|
|
auditMessage.getAdditionalInfo().remove(AuditKey.FIELD_PARENT_CLASS_NAME); |
|
|
|
auditMessage.getAdditionalInfo().remove(AuditKey.FIELD_RELATED_CLASS_PK); |
|
|
|
auditMessage.getAdditionalInfo().remove(AuditKey.FIELD_PARENT_CLASS_PK); |
|
|
|
auditEvent.setAdditionalInfo(String.valueOf(auditMessage.getAdditionalInfo())); |
|
|
|
auditMessage.getAdditionalInfo().remove(AuditKey.FIELD_RELATED_CLASS_NAME); |
|
|
|
} |
|
|
|
auditMessage.getAdditionalInfo().remove(AuditKey.FIELD_RELATED_CLASS_PK); |
|
|
|
|
|
|
|
auditEvent.setAdditionalInfo(String.valueOf(auditMessage.getAdditionalInfo())); |
|
|
|
@Override |
|
|
|
} |
|
|
|
public int countByCompanyId(long companyId) throws SystemException { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
return auditEventPersistence.countByCompanyId(companyId); |
|
|
|
public int countByCompanyId(long companyId) throws SystemException { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return auditEventPersistence.countByCompanyId(companyId); |
|
|
|
@Override |
|
|
|
} |
|
|
|
public List<AuditEvent> findByCompanyId(long companyId, int start, int end, OrderByComparator orderByComparator) |
|
|
|
|
|
|
|
throws SystemException { |
|
|
|
@Override |
|
|
|
|
|
|
|
public List<AuditEvent> findByCompanyId(long companyId, int start, int end, |
|
|
|
return auditEventPersistence.findByCompanyId(companyId, start, end, orderByComparator); |
|
|
|
OrderByComparator orderByComparator) throws SystemException { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return auditEventPersistence.findByCompanyId(companyId, start, end, orderByComparator); |
|
|
|
public List<AuditEvent> findByC_ClassNameId(long companyId, long classNameId, int start, int end) |
|
|
|
} |
|
|
|
throws SystemException { |
|
|
|
|
|
|
|
return auditEventPersistence.findByC_ClassNameId(companyId, classNameId, start, end); |
|
|
|
public List<AuditEvent> findByC_ClassNameId(long companyId, long classNameId, int start, int end) |
|
|
|
} |
|
|
|
throws SystemException { |
|
|
|
|
|
|
|
return auditEventPersistence.findByC_ClassNameId(companyId, classNameId, start, end); |
|
|
|
public int countByC_ClassNameId(long companyId, long classNameId) throws SystemException { |
|
|
|
} |
|
|
|
return auditEventPersistence.countByC_ClassNameId(companyId, classNameId); |
|
|
|
|
|
|
|
} |
|
|
|
public int countByC_ClassNameId(long companyId, long classNameId) throws SystemException { |
|
|
|
|
|
|
|
return auditEventPersistence.countByC_ClassNameId(companyId, classNameId); |
|
|
|
public List<AuditEvent> findByC_ClassNameId_ClassPK(long companyId, long classNameId, String classPK, int start, |
|
|
|
} |
|
|
|
int end) throws SystemException { |
|
|
|
|
|
|
|
return auditEventPersistence.findByC_ClassNameId_ClassPK(companyId, classNameId, classPK, start, end); |
|
|
|
public List<AuditEvent> findByC_ClassNameId_ClassPK(long companyId, long classNameId, String classPK, |
|
|
|
} |
|
|
|
int start, int end) throws SystemException { |
|
|
|
|
|
|
|
return auditEventPersistence.findByC_ClassNameId_ClassPK(companyId, classNameId, classPK, start, end); |
|
|
|
public List<AuditEvent> findByC_ClassNameId_ClassPK(long companyId, long classNameId, String classPK, int start, |
|
|
|
} |
|
|
|
int end, OrderByComparator orderByComparator) throws SystemException { |
|
|
|
|
|
|
|
return auditEventPersistence.findByC_ClassNameId_ClassPK(companyId, classNameId, classPK, start, end, |
|
|
|
public List<AuditEvent> findByC_ClassNameId_ClassPK(long companyId, long classNameId, String classPK, |
|
|
|
orderByComparator); |
|
|
|
int start, int end, OrderByComparator orderByComparator) throws SystemException { |
|
|
|
} |
|
|
|
return auditEventPersistence.findByC_ClassNameId_ClassPK(companyId, classNameId, classPK, start, end, |
|
|
|
|
|
|
|
orderByComparator); |
|
|
|
public int countByC_ClassNameId_ClassPK(long companyId, long classNameId, String classPK) throws SystemException { |
|
|
|
} |
|
|
|
return auditEventPersistence.countByC_ClassNameId_ClassPK(companyId, classNameId, classPK); |
|
|
|
|
|
|
|
} |
|
|
|
public int countByC_ClassNameId_ClassPK(long companyId, long classNameId, String classPK) |
|
|
|
|
|
|
|
throws SystemException { |
|
|
|
public List<String> findAllClassPkByClassName(long companyId, long classNameId, int start, int end) |
|
|
|
return auditEventPersistence.countByC_ClassNameId_ClassPK(companyId, classNameId, classPK); |
|
|
|
throws SystemException { |
|
|
|
} |
|
|
|
DynamicQuery dynamicQuery = dynamicQueryClassPkByClassName(companyId, classNameId); |
|
|
|
|
|
|
|
return auditEventLocalService.dynamicQuery(dynamicQuery, start, end); |
|
|
|
public List<String> findAllClassPkByClassName(long companyId, long classNameId, int start, int end) |
|
|
|
} |
|
|
|
throws SystemException { |
|
|
|
|
|
|
|
DynamicQuery dynamicQuery = dynamicQueryClassPkByClassName(companyId, classNameId); |
|
|
|
public int countClassPkByClassName(long companyId, long classNameId) throws SystemException { |
|
|
|
return auditEventLocalService.dynamicQuery(dynamicQuery, start, end); |
|
|
|
DynamicQuery dynamicQuery = dynamicQueryClassPkByClassName(companyId, classNameId); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return (int) auditEventLocalService.dynamicQueryCount(dynamicQuery); |
|
|
|
public int countClassPkByClassName(long companyId, long classNameId) throws SystemException { |
|
|
|
} |
|
|
|
DynamicQuery dynamicQuery = dynamicQueryClassPkByClassName(companyId, classNameId); |
|
|
|
|
|
|
|
|
|
|
|
private DynamicQuery dynamicQueryClassPkByClassName(long companyId, long classNameId) { |
|
|
|
return (int) auditEventLocalService.dynamicQueryCount(dynamicQuery); |
|
|
|
DynamicQuery dynamicQuery = auditEventLocalService.dynamicQuery(); |
|
|
|
} |
|
|
|
dynamicQuery.setProjection(ProjectionFactoryUtil.property("classPK")); |
|
|
|
|
|
|
|
dynamicQuery.setProjection(ProjectionFactoryUtil.groupProperty("classPK")); |
|
|
|
private DynamicQuery dynamicQueryClassPkByClassName(long companyId, long classNameId) { |
|
|
|
dynamicQuery.add(RestrictionsFactoryUtil.eq("classNameId", classNameId)); |
|
|
|
DynamicQuery dynamicQuery = auditEventLocalService.dynamicQuery(); |
|
|
|
return dynamicQuery; |
|
|
|
dynamicQuery.setProjection(ProjectionFactoryUtil.property("classPK")); |
|
|
|
} |
|
|
|
dynamicQuery.setProjection(ProjectionFactoryUtil.groupProperty("classPK")); |
|
|
|
|
|
|
|
dynamicQuery.add(RestrictionsFactoryUtil.eq("classNameId", classNameId)); |
|
|
|
public List<AuditEvent> findByC_ClassNameId_AuditEventTable(long companyId, long classNameId, String auditEventTable, |
|
|
|
return dynamicQuery; |
|
|
|
int start, int end) throws SystemException { |
|
|
|
} |
|
|
|
return auditEventPersistence.findByC_ClassNameId_AuditEventTable(companyId, classNameId, auditEventTable, start, |
|
|
|
|
|
|
|
end); |
|
|
|
public List<AuditEvent> findByC_ClassNameId_AuditEventTable(long companyId, long classNameId, |
|
|
|
} |
|
|
|
String auditEventTable, int start, int end) throws SystemException { |
|
|
|
|
|
|
|
return auditEventPersistence.findByC_ClassNameId_AuditEventTable(companyId, classNameId, |
|
|
|
public int countByC_ClassNameId_AuditEventTable(long companyId, long classNameId, String auditEventTable) |
|
|
|
auditEventTable, start, end); |
|
|
|
throws SystemException { |
|
|
|
} |
|
|
|
return auditEventPersistence.countByC_ClassNameId_AuditEventTable(companyId, classNameId, auditEventTable); |
|
|
|
|
|
|
|
} |
|
|
|
public int countByC_ClassNameId_AuditEventTable(long companyId, long classNameId, String auditEventTable) |
|
|
|
|
|
|
|
throws SystemException { |
|
|
|
public List<AuditEvent> findByC_ClassNameId_ClassPK_AuditEventTable(long companyId, long classNameId, String classPK, |
|
|
|
return auditEventPersistence.countByC_ClassNameId_AuditEventTable(companyId, classNameId, |
|
|
|
String auditEventTable, int start, int end) throws SystemException { |
|
|
|
auditEventTable); |
|
|
|
return auditEventPersistence.findByC_ClassNameId_ClassPK_AuditEventTable(companyId, classNameId, classPK, |
|
|
|
} |
|
|
|
auditEventTable, start, end); |
|
|
|
|
|
|
|
} |
|
|
|
public List<AuditEvent> findByC_ClassNameId_ClassPK_AuditEventTable(long companyId, long classNameId, |
|
|
|
|
|
|
|
String classPK, String auditEventTable, int start, int end) throws SystemException { |
|
|
|
public int countByC_ClassNameId_ClassPK_AuditEventTable(long companyId, long classNameId, String classPK, |
|
|
|
return auditEventPersistence.findByC_ClassNameId_ClassPK_AuditEventTable(companyId, classNameId, |
|
|
|
String auditEventTable) throws SystemException { |
|
|
|
classPK, auditEventTable, start, end); |
|
|
|
return auditEventPersistence.countByC_ClassNameId_ClassPK_AuditEventTable(companyId, classNameId, classPK, |
|
|
|
} |
|
|
|
auditEventTable); |
|
|
|
|
|
|
|
} |
|
|
|
public int countByC_ClassNameId_ClassPK_AuditEventTable(long companyId, long classNameId, String classPK, |
|
|
|
|
|
|
|
String auditEventTable) throws SystemException { |
|
|
|
/* |
|
|
|
return auditEventPersistence.countByC_ClassNameId_ClassPK_AuditEventTable(companyId, classNameId, |
|
|
|
* public List<AuditEvent> findByC_ParentClassNameId_ParentClassPK(long companyId, long |
|
|
|
classPK, auditEventTable); |
|
|
|
* parentClassNameId, String parentClassPK, int start, int end) throws SystemException { return |
|
|
|
} |
|
|
|
* auditEventPersistence.findByC_ParentClassNameId_ParentClassPK(companyId, parentClassNameId, |
|
|
|
|
|
|
|
* parentClassPK, start, end); } |
|
|
|
/* |
|
|
|
* |
|
|
|
* public List<AuditEvent> findByC_ParentClassNameId_ParentClassPK(long |
|
|
|
* public int countByC_ParentClassNameId_ParentClassPK(long companyId, long parentClassNameId, |
|
|
|
* companyId, long parentClassNameId, String parentClassPK, int start, int |
|
|
|
* String parentClassPK) throws SystemException { return |
|
|
|
* end) throws SystemException { return |
|
|
|
* auditEventPersistence.countByC_ParentClassNameId_ParentClassPK(companyId, parentClassNameId, |
|
|
|
* auditEventPersistence.findByC_ParentClassNameId_ParentClassPK(companyId, |
|
|
|
* parentClassPK); } |
|
|
|
* parentClassNameId, parentClassPK, start, end); } |
|
|
|
*/ |
|
|
|
* |
|
|
|
|
|
|
|
* public int countByC_ParentClassNameId_ParentClassPK(long companyId, long |
|
|
|
public List<AuditEvent> findByC_Parent_Related_ClassNameId(long companyId, long parentClassNameId, |
|
|
|
* parentClassNameId, String parentClassPK) throws SystemException { return |
|
|
|
String parentClassPK, long relatedClassNameId, String relatedClassPK, long classNameId, int start, int end) |
|
|
|
* auditEventPersistence.countByC_ParentClassNameId_ParentClassPK(companyId, |
|
|
|
throws SystemException { |
|
|
|
* parentClassNameId, parentClassPK); } |
|
|
|
DynamicQuery dynamicQuery = |
|
|
|
*/ |
|
|
|
createC_Parent_Related_ClassNameId(companyId, parentClassNameId, parentClassPK, relatedClassNameId, |
|
|
|
|
|
|
|
relatedClassPK, classNameId); |
|
|
|
public List<AuditEvent> findByC_Parent_Related_ClassNameId(long companyId, long parentClassNameId, |
|
|
|
dynamicQuery.addOrder(OrderFactoryUtil.desc("createDate")); |
|
|
|
String parentClassPK, long relatedClassNameId, String relatedClassPK, long classNameId, |
|
|
|
return auditEventLocalService.dynamicQuery(dynamicQuery, start, end); |
|
|
|
int start, int end) throws SystemException { |
|
|
|
} |
|
|
|
DynamicQuery dynamicQuery = createC_Parent_Related_ClassNameId(companyId, parentClassNameId, |
|
|
|
|
|
|
|
parentClassPK, relatedClassNameId, relatedClassPK, classNameId); |
|
|
|
public int countByC_Parent_Related_ClassNameId(long companyId, long parentClassNameId, String parentClassPK, |
|
|
|
dynamicQuery.addOrder(OrderFactoryUtil.desc("createDate")); |
|
|
|
long relatedClassNameId, String relatedClassPK, long classNameId) throws SystemException { |
|
|
|
return auditEventLocalService.dynamicQuery(dynamicQuery, start, end); |
|
|
|
|
|
|
|
} |
|
|
|
return (int) auditEventPersistence.countWithDynamicQuery(createC_Parent_Related_ClassNameId(companyId, |
|
|
|
|
|
|
|
parentClassNameId, parentClassPK, relatedClassNameId, relatedClassPK, classNameId)); |
|
|
|
public int countByC_Parent_Related_ClassNameId(long companyId, long parentClassNameId, |
|
|
|
} |
|
|
|
String parentClassPK, long relatedClassNameId, String relatedClassPK, long classNameId) |
|
|
|
|
|
|
|
throws SystemException { |
|
|
|
private DynamicQuery createC_Parent_Related_ClassNameId(long companyId, long parentClassNameId, String parentClassPK, |
|
|
|
|
|
|
|
long relatedClassNameId, String relatedClassPK, long classNameId) { |
|
|
|
return (int) auditEventPersistence |
|
|
|
DynamicQuery dynamicQuery = auditEventLocalService.dynamicQuery(); |
|
|
|
.countWithDynamicQuery(createC_Parent_Related_ClassNameId(companyId, parentClassNameId, |
|
|
|
dynamicQuery.add(RestrictionsFactoryUtil.eq("companyId", companyId)); |
|
|
|
parentClassPK, relatedClassNameId, relatedClassPK, classNameId)); |
|
|
|
Disjunction dis = RestrictionsFactoryUtil.disjunction(); |
|
|
|
} |
|
|
|
Conjunction parent = RestrictionsFactoryUtil.conjunction(); |
|
|
|
|
|
|
|
Conjunction related = RestrictionsFactoryUtil.conjunction(); |
|
|
|
private DynamicQuery createC_Parent_Related_ClassNameId(long companyId, long parentClassNameId, |
|
|
|
|
|
|
|
String parentClassPK, long relatedClassNameId, String relatedClassPK, long classNameId) { |
|
|
|
parent.add(RestrictionsFactoryUtil.eq("parentClassNameId", parentClassNameId)); |
|
|
|
DynamicQuery dynamicQuery = auditEventLocalService.dynamicQuery(); |
|
|
|
parent.add(RestrictionsFactoryUtil.eq("parentClassPK", parentClassPK)); |
|
|
|
dynamicQuery.add(RestrictionsFactoryUtil.eq("companyId", companyId)); |
|
|
|
|
|
|
|
Disjunction dis = RestrictionsFactoryUtil.disjunction(); |
|
|
|
related.add(RestrictionsFactoryUtil.eq("relatedClassNameId", relatedClassNameId)); |
|
|
|
Conjunction parent = RestrictionsFactoryUtil.conjunction(); |
|
|
|
related.add(RestrictionsFactoryUtil.eq("relatedClassPK", relatedClassPK)); |
|
|
|
Conjunction related = RestrictionsFactoryUtil.conjunction(); |
|
|
|
|
|
|
|
|
|
|
|
dis.add(parent); |
|
|
|
parent.add(RestrictionsFactoryUtil.eq("parentClassNameId", parentClassNameId)); |
|
|
|
dis.add(related); |
|
|
|
parent.add(RestrictionsFactoryUtil.eq("parentClassPK", parentClassPK)); |
|
|
|
dynamicQuery.add(dis); |
|
|
|
|
|
|
|
dynamicQuery.add(RestrictionsFactoryUtil.eq("classNameId", classNameId)); |
|
|
|
related.add(RestrictionsFactoryUtil.eq("relatedClassNameId", relatedClassNameId)); |
|
|
|
return dynamicQuery; |
|
|
|
related.add(RestrictionsFactoryUtil.eq("relatedClassPK", relatedClassPK)); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
dis.add(parent); |
|
|
|
public List<Long> findEventClassNameByC_Parent_and_Related(long companyId, long parentClassNameId, |
|
|
|
dis.add(related); |
|
|
|
String parentClassPK, long relatedClassNameId, String relatedClassPK) throws SystemException { |
|
|
|
dynamicQuery.add(dis); |
|
|
|
DynamicQuery dynamicQuery = auditEventLocalService.dynamicQuery(); |
|
|
|
dynamicQuery.add(RestrictionsFactoryUtil.eq("classNameId", classNameId)); |
|
|
|
dynamicQuery.add(RestrictionsFactoryUtil.eq("companyId", companyId)); |
|
|
|
return dynamicQuery; |
|
|
|
Disjunction dis = RestrictionsFactoryUtil.disjunction(); |
|
|
|
} |
|
|
|
Conjunction parent = RestrictionsFactoryUtil.conjunction(); |
|
|
|
|
|
|
|
Conjunction related = RestrictionsFactoryUtil.conjunction(); |
|
|
|
public List<Long> findEventClassNameByC_Parent_and_Related(long companyId, long parentClassNameId, |
|
|
|
|
|
|
|
String parentClassPK, long relatedClassNameId, String relatedClassPK) throws SystemException { |
|
|
|
parent.add(RestrictionsFactoryUtil.eq("parentClassNameId", parentClassNameId)); |
|
|
|
DynamicQuery dynamicQuery = auditEventLocalService.dynamicQuery(); |
|
|
|
parent.add(RestrictionsFactoryUtil.eq("parentClassPK", parentClassPK)); |
|
|
|
dynamicQuery.add(RestrictionsFactoryUtil.eq("companyId", companyId)); |
|
|
|
|
|
|
|
Disjunction dis = RestrictionsFactoryUtil.disjunction(); |
|
|
|
related.add(RestrictionsFactoryUtil.eq("relatedClassNameId", relatedClassNameId)); |
|
|
|
Conjunction parent = RestrictionsFactoryUtil.conjunction(); |
|
|
|
related.add(RestrictionsFactoryUtil.eq("relatedClassPK", relatedClassPK)); |
|
|
|
Conjunction related = RestrictionsFactoryUtil.conjunction(); |
|
|
|
|
|
|
|
|
|
|
|
dis.add(parent); |
|
|
|
parent.add(RestrictionsFactoryUtil.eq("parentClassNameId", parentClassNameId)); |
|
|
|
dis.add(related); |
|
|
|
parent.add(RestrictionsFactoryUtil.eq("parentClassPK", parentClassPK)); |
|
|
|
dynamicQuery.add(dis); |
|
|
|
|
|
|
|
|
|
|
|
related.add(RestrictionsFactoryUtil.eq("relatedClassNameId", relatedClassNameId)); |
|
|
|
dynamicQuery.setProjection(ProjectionFactoryUtil.distinct(ProjectionFactoryUtil.property("classNameId"))); |
|
|
|
related.add(RestrictionsFactoryUtil.eq("relatedClassPK", relatedClassPK)); |
|
|
|
|
|
|
|
|
|
|
|
return auditEventPersistence.findWithDynamicQuery(dynamicQuery); |
|
|
|
dis.add(parent); |
|
|
|
} |
|
|
|
dis.add(related); |
|
|
|
|
|
|
|
dynamicQuery.add(dis); |
|
|
|
public List<String> findEventTableNameByC_ClassNameId_ClassPK(long companyId, long classNameId, String classPK) |
|
|
|
|
|
|
|
throws SystemException { |
|
|
|
dynamicQuery.setProjection(ProjectionFactoryUtil.distinct(ProjectionFactoryUtil |
|
|
|
DynamicQuery dynamicQuery = auditEventLocalService.dynamicQuery(); |
|
|
|
.property("classNameId"))); |
|
|
|
dynamicQuery.add(RestrictionsFactoryUtil.eq("companyId", companyId)); |
|
|
|
|
|
|
|
dynamicQuery.add(RestrictionsFactoryUtil.eq("classNameId", classNameId)); |
|
|
|
return auditEventPersistence.findWithDynamicQuery(dynamicQuery); |
|
|
|
dynamicQuery.add(RestrictionsFactoryUtil.eq("classPK", classPK)); |
|
|
|
} |
|
|
|
dynamicQuery.setProjection(ProjectionFactoryUtil.distinct(ProjectionFactoryUtil.property("auditEventTable"))); |
|
|
|
|
|
|
|
|
|
|
|
public List<String> findEventTableNameByC_ClassNameId_ClassPK(long companyId, long classNameId, |
|
|
|
return auditEventPersistence.findWithDynamicQuery(dynamicQuery); |
|
|
|
String classPK) throws SystemException { |
|
|
|
} |
|
|
|
DynamicQuery dynamicQuery = auditEventLocalService.dynamicQuery(); |
|
|
|
|
|
|
|
dynamicQuery.add(RestrictionsFactoryUtil.eq("companyId", companyId)); |
|
|
|
public List<String> findEventTableNameByC_ClassNameId(long companyId, long classNameId) throws SystemException { |
|
|
|
dynamicQuery.add(RestrictionsFactoryUtil.eq("classNameId", classNameId)); |
|
|
|
DynamicQuery dynamicQuery = auditEventLocalService.dynamicQuery(); |
|
|
|
dynamicQuery.add(RestrictionsFactoryUtil.eq("classPK", classPK)); |
|
|
|
dynamicQuery.add(RestrictionsFactoryUtil.eq("companyId", companyId)); |
|
|
|
dynamicQuery.setProjection(ProjectionFactoryUtil.distinct(ProjectionFactoryUtil |
|
|
|
dynamicQuery.add(RestrictionsFactoryUtil.eq("classNameId", classNameId)); |
|
|
|
.property("auditEventTable"))); |
|
|
|
dynamicQuery.setProjection(ProjectionFactoryUtil.distinct(ProjectionFactoryUtil.property("auditEventTable"))); |
|
|
|
|
|
|
|
|
|
|
|
return auditEventPersistence.findWithDynamicQuery(dynamicQuery); |
|
|
|
return auditEventPersistence.findWithDynamicQuery(dynamicQuery); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public List<String> findEventTableNameByC_ClassNameId(long companyId, long classNameId) |
|
|
|
|
|
|
|
throws SystemException { |
|
|
|
|
|
|
|
DynamicQuery dynamicQuery = auditEventLocalService.dynamicQuery(); |
|
|
|
|
|
|
|
dynamicQuery.add(RestrictionsFactoryUtil.eq("companyId", companyId)); |
|
|
|
|
|
|
|
dynamicQuery.add(RestrictionsFactoryUtil.eq("classNameId", classNameId)); |
|
|
|
|
|
|
|
dynamicQuery.setProjection(ProjectionFactoryUtil.distinct(ProjectionFactoryUtil |
|
|
|
|
|
|
|
.property("auditEventTable"))); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return auditEventPersistence.findWithDynamicQuery(dynamicQuery); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|