Merge branch 'dmp-refactoring' of https://code-repo.d4science.org/MaDgiK-CITE/argos into dmp-refactoring
This commit is contained in:
commit
f8a2bd34fa
|
@ -94,7 +94,7 @@ public class InAppNotificationController {
|
|||
UUID userId = this.userScope.getUserId();
|
||||
this.censorFactory.censor(InAppNotificationCensor.class).censor(fieldSet, userId);
|
||||
|
||||
InAppNotificationQuery query = this.queryFactory.query(InAppNotificationQuery.class).authorize(AuthorizationFlags.OwnerOrPermission).userId(userId).ids(id);
|
||||
InAppNotificationQuery query = this.queryFactory.query(InAppNotificationQuery.class).disableTracking().authorize(AuthorizationFlags.OwnerOrPermission).userId(userId).ids(id);
|
||||
InAppNotification model = this.builderFactory.builder(InAppNotificationBuilder.class).authorize(AuthorizationFlags.OwnerOrPermission).build(fieldSet, query.firstAs(fieldSet));
|
||||
if (model == null)
|
||||
throw new MyNotFoundException(messageSource.getMessage("General_ItemNotFound", new Object[]{id, Notification.class.getSimpleName()}, LocaleContextHolder.getLocale()));
|
||||
|
@ -145,7 +145,7 @@ public class InAppNotificationController {
|
|||
|
||||
this.censorFactory.censor(InAppNotificationCensor.class).censor(new BaseFieldSet(InAppNotification.Field.ID), userId);
|
||||
|
||||
InAppNotificationQuery query = this.queryFactory.query(InAppNotificationQuery.class).isActive(IsActive.Active).trackingState(NotificationInAppTracking.STORED).userId(userId);
|
||||
InAppNotificationQuery query = this.queryFactory.query(InAppNotificationQuery.class).disableTracking().isActive(IsActive.Active).trackingState(NotificationInAppTracking.STORED).userId(userId);
|
||||
int count = Math.toIntExact(query.count());
|
||||
|
||||
//this.auditService.trackIdentity(AuditableAction.IdentityTracking_Action);
|
||||
|
|
|
@ -81,7 +81,7 @@ public class NotificationController {
|
|||
|
||||
this.censorFactory.censor(NotificationCensor.class).censor(fieldSet);
|
||||
|
||||
NotificationQuery query = this.queryFactory.query(NotificationQuery.class).authorize(AuthorizationFlags.OwnerOrPermission).ids(id);
|
||||
NotificationQuery query = this.queryFactory.query(NotificationQuery.class).disableTracking().authorize(AuthorizationFlags.OwnerOrPermission).ids(id);
|
||||
Notification model = this.builderFactory.builder(NotificationBuilder.class).authorize(AuthorizationFlags.OwnerOrPermission).build(fieldSet, query.firstAs(fieldSet));
|
||||
if (model == null)
|
||||
throw new MyNotFoundException(messageSource.getMessage("General_ItemNotFound", new Object[]{id, Notification.class.getSimpleName()}, LocaleContextHolder.getLocale()));
|
||||
|
|
|
@ -81,7 +81,7 @@ public class NotificationTemplateController {
|
|||
|
||||
this.censorFactory.censor(NotificationTemplateCensor.class).censor(fieldSet);
|
||||
|
||||
NotificationTemplateQuery query = this.queryFactory.query(NotificationTemplateQuery.class).authorize(AuthorizationFlags.OwnerOrPermission).ids(id);
|
||||
NotificationTemplateQuery query = this.queryFactory.query(NotificationTemplateQuery.class).disableTracking().authorize(AuthorizationFlags.OwnerOrPermission).ids(id);
|
||||
NotificationTemplate model = this.builderFactory.builder(NotificationTemplateBuilder.class).authorize(AuthorizationFlags.OwnerOrPermission).build(fieldSet, query.first());
|
||||
if (model == null)
|
||||
throw new MyNotFoundException(messageSource.getMessage("General_ItemNotFound", new Object[]{id, NotificationTemplate.class.getSimpleName()}, LocaleContextHolder.getLocale()));
|
||||
|
|
|
@ -103,7 +103,7 @@ public class TenantConfigurationController {
|
|||
|
||||
this.censorFactory.censor(TenantConfigurationCensor.class).censor(fieldSet, null);
|
||||
|
||||
TenantConfigurationQuery query = this.queryFactory.query(TenantConfigurationQuery.class).authorize(AuthorizationFlags.OwnerOrPermission).ids(id);
|
||||
TenantConfigurationQuery query = this.queryFactory.query(TenantConfigurationQuery.class).disableTracking()authorize(AuthorizationFlags.OwnerOrPermission).ids(id);
|
||||
TenantConfiguration model = this.builderFactory.builder(TenantConfigurationBuilder.class).authorize(AuthorizationFlags.OwnerOrPermission).build(fieldSet, query.firstAs(fieldSet));
|
||||
if (model == null)
|
||||
throw new MyNotFoundException(messageSource.getMessage("General_ItemNotFound", new Object[]{id, TenantConfiguration.class.getSimpleName()}, LocaleContextHolder.getLocale()));
|
||||
|
@ -122,7 +122,7 @@ public class TenantConfigurationController {
|
|||
|
||||
this.censorFactory.censor(TenantConfigurationCensor.class).censor(fieldSet, null);
|
||||
|
||||
TenantConfigurationQuery query = this.queryFactory.query(TenantConfigurationQuery.class).authorize(AuthorizationFlags.OwnerOrPermission).isActive(IsActive.Active).types(TenantConfigurationType.of(type));
|
||||
TenantConfigurationQuery query = this.queryFactory.query(TenantConfigurationQuery.class).disableTracking().authorize(AuthorizationFlags.OwnerOrPermission).isActive(IsActive.Active).types(TenantConfigurationType.of(type));
|
||||
if (this.tenantScope.isDefaultTenant()) query.tenantIsSet(false);
|
||||
else query.tenantIsSet(true).tenantIds(this.tenantScope.getTenant());
|
||||
|
||||
|
|
|
@ -95,7 +95,7 @@ public class UserNotificationPreferenceController {
|
|||
|
||||
Ordering ordering = new Ordering();
|
||||
ordering.addAscending(UserNotificationPreference._ordinal);
|
||||
UserNotificationPreferenceQuery query = this.queryFactory.query(UserNotificationPreferenceQuery.class).userId(userId).isActives(IsActive.Active);
|
||||
UserNotificationPreferenceQuery query = this.queryFactory.query(UserNotificationPreferenceQuery.class).disableTracking().userId(userId).isActives(IsActive.Active);
|
||||
query.setOrder(ordering);
|
||||
if (this.tenantScope.isMultitenant() && this.tenantScope.isSet()) {
|
||||
if (!this.tenantScope.isDefaultTenant()) {
|
||||
|
|
|
@ -63,7 +63,7 @@ public class UserInterceptor implements WebRequestInterceptor {
|
|||
this.userScope.setUserId(userId);
|
||||
}
|
||||
private UUID findExistingUserFromDb(String subjectId) {
|
||||
UserCredentialEntity userCredential = this.queryFactory.query(UserCredentialQuery.class).externalIds(subjectId).firstAs(new BaseFieldSet().ensure(UserCredential._user));
|
||||
UserCredentialEntity userCredential = this.queryFactory.query(UserCredentialQuery.class).disableTracking().externalIds(subjectId).firstAs(new BaseFieldSet().ensure(UserCredential._user));
|
||||
if (userCredential != null) {
|
||||
return userCredential.getUserId();
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ public class NotifyConsistencyHandler implements ConsistencyHandler<NotifyConsis
|
|||
@Override
|
||||
public Boolean isConsistent(NotifyConsistencyPredicates consistencyPredicates) {
|
||||
if (consistencyPredicates.getUserId() != null) {
|
||||
UserQuery query = this.queryFactory.query(UserQuery.class).ids(consistencyPredicates.getUserId()).isActive(IsActive.Active);
|
||||
UserQuery query = this.queryFactory.query(UserQuery.class).disableTracking().ids(consistencyPredicates.getUserId()).isActive(IsActive.Active);
|
||||
|
||||
BaseFieldSet fieldSet = new BaseFieldSet(
|
||||
User._id,
|
||||
|
@ -43,7 +43,7 @@ public class NotifyConsistencyHandler implements ConsistencyHandler<NotifyConsis
|
|||
User user = this.builderFactory.builder(UserBuilder.class).build(fieldSet, query.firstAs(fieldSet));
|
||||
if (user == null)
|
||||
return false;
|
||||
Long activeEmails = this.queryFactory.query(UserContactInfoQuery.class).ids(consistencyPredicates.getUserId()).isActive(IsActive.Active).type(ContactInfoType.Email).count();
|
||||
Long activeEmails = this.queryFactory.query(UserContactInfoQuery.class).disableTracking().ids(consistencyPredicates.getUserId()).isActive(IsActive.Active).type(ContactInfoType.Email).count();
|
||||
return consistencyPredicates.getContactTypeHint() == null || consistencyPredicates.getContactTypeHint() == NotificationContactType.IN_APP || !StringUtils.isNullOrEmpty(consistencyPredicates.getContactHint()) || activeEmails != 0;
|
||||
} else {
|
||||
return !StringUtils.isNullOrEmpty(consistencyPredicates.getContactHint());
|
||||
|
|
|
@ -83,7 +83,7 @@ public class NotifyIntegrationEventHandlerImpl implements NotifyIntegrationEvent
|
|||
EventProcessingStatus status = EventProcessingStatus.Success;
|
||||
try {
|
||||
if (this.tenantScope.isMultitenant() && properties.getTenantId() != null) {
|
||||
TenantEntity tenant = queryFactory.query(TenantQuery.class).ids(properties.getTenantId()).firstAs(new BaseFieldSet().ensure(Tenant._id).ensure(Tenant._code));
|
||||
TenantEntity tenant = queryFactory.query(TenantQuery.class).disableTracking().ids(properties.getTenantId()).firstAs(new BaseFieldSet().ensure(Tenant._id).ensure(Tenant._code));
|
||||
if (tenant == null) {
|
||||
logger.error("missing tenant from event message");
|
||||
return EventProcessingStatus.Error;
|
||||
|
|
|
@ -20,7 +20,7 @@ public class TenantDefaultLocaleRemovalConsistencyHandler implements Consistency
|
|||
@Override
|
||||
public Boolean isConsistent(TenantDefaultLocaleRemovalConsistencyPredicates consistencyPredicates) {
|
||||
if (consistencyPredicates.getTenantId() == null) return true;
|
||||
long count = this.queryFactory.query(TenantQuery.class).ids(consistencyPredicates.getTenantId()).count();
|
||||
long count = this.queryFactory.query(TenantQuery.class).disableTracking().ids(consistencyPredicates.getTenantId()).count();
|
||||
return count > 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ public class TenantDefaultLocaleRemovalIntegrationEventHandlerImpl implements Te
|
|||
}
|
||||
|
||||
if (this.tenantScope.isMultitenant() && properties.getTenantId() != null) {
|
||||
TenantEntity tenant = queryFactory.query(TenantQuery.class).ids(properties.getTenantId()).firstAs(new BaseFieldSet().ensure(Tenant._id).ensure(Tenant._code));
|
||||
TenantEntity tenant = queryFactory.query(TenantQuery.class).disableTracking().ids(properties.getTenantId()).firstAs(new BaseFieldSet().ensure(Tenant._id).ensure(Tenant._code));
|
||||
if (tenant == null) {
|
||||
logger.error("missing tenant from event message");
|
||||
return EventProcessingStatus.Error;
|
||||
|
|
|
@ -20,7 +20,7 @@ public class TenantDefaultLocaleTouchedConsistencyHandler implements Consistency
|
|||
@Override
|
||||
public Boolean isConsistent(TenantDefaultLocaleTouchedConsistencyPredicates consistencyPredicates) {
|
||||
if (consistencyPredicates.getTenantId() == null) return true;
|
||||
long count = this.queryFactory.query(TenantQuery.class).ids(consistencyPredicates.getTenantId()).count();
|
||||
long count = this.queryFactory.query(TenantQuery.class).disableTracking().ids(consistencyPredicates.getTenantId()).count();
|
||||
return count > 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@ public class TenantDefaultLocaleTouchedIntegrationEventHandlerImpl implements Te
|
|||
return status;
|
||||
}
|
||||
if (this.tenantScope.isMultitenant() && properties.getTenantId() != null) {
|
||||
TenantEntity tenant = queryFactory.query(TenantQuery.class).ids(properties.getTenantId()).firstAs(new BaseFieldSet().ensure(Tenant._id).ensure(Tenant._code));
|
||||
TenantEntity tenant = queryFactory.query(TenantQuery.class).disableTracking().ids(properties.getTenantId()).firstAs(new BaseFieldSet().ensure(Tenant._id).ensure(Tenant._code));
|
||||
if (tenant == null) {
|
||||
logger.error("missing tenant from event message");
|
||||
return EventProcessingStatus.Error;
|
||||
|
|
|
@ -19,7 +19,7 @@ public class TenantRemovalConsistencyHandler implements ConsistencyHandler<Tenan
|
|||
|
||||
@Override
|
||||
public Boolean isConsistent(TenantRemovalConsistencyPredicates consistencyPredicates) {
|
||||
long count = this.queryFactory.query(TenantQuery.class).ids(consistencyPredicates.getTenantId()).count();
|
||||
long count = this.queryFactory.query(TenantQuery.class).disableTracking().ids(consistencyPredicates.getTenantId()).count();
|
||||
return count > 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ public class UserRemovalConsistencyHandler implements ConsistencyHandler<UserRem
|
|||
|
||||
@Override
|
||||
public Boolean isConsistent(UserRemovalConsistencyPredicates consistencyPredicates) {
|
||||
long count = this.queryFactory.query(UserQuery.class).ids(consistencyPredicates.getUserId()).count();
|
||||
long count = this.queryFactory.query(UserQuery.class).disableTracking().ids(consistencyPredicates.getUserId()).count();
|
||||
return count != 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -82,7 +82,7 @@ public class UserRemovalIntegrationEventHandlerImpl implements UserRemovalIntegr
|
|||
EventProcessingStatus status = EventProcessingStatus.Success;
|
||||
try {
|
||||
if (this.tenantScope.isMultitenant() && properties.getTenantId() != null) {
|
||||
TenantEntity tenant = queryFactory.query(TenantQuery.class).ids(properties.getTenantId()).firstAs(new BaseFieldSet().ensure(Tenant._id).ensure(Tenant._code));
|
||||
TenantEntity tenant = queryFactory.query(TenantQuery.class).disableTracking().ids(properties.getTenantId()).firstAs(new BaseFieldSet().ensure(Tenant._id).ensure(Tenant._code));
|
||||
if (tenant == null) {
|
||||
logger.error("missing tenant from event message");
|
||||
return EventProcessingStatus.Error;
|
||||
|
|
|
@ -72,7 +72,7 @@ public class UserTouchedIntegrationEventHandlerImpl implements UserTouchedIntegr
|
|||
EventProcessingStatus status = EventProcessingStatus.Success;
|
||||
try {
|
||||
if (this.tenantScope.isMultitenant() && properties.getTenantId() != null) {
|
||||
TenantEntity tenant = queryFactory.query(TenantQuery.class).ids(properties.getTenantId()).firstAs(new BaseFieldSet().ensure(Tenant._id).ensure(Tenant._code));
|
||||
TenantEntity tenant = queryFactory.query(TenantQuery.class).disableTracking().ids(properties.getTenantId()).firstAs(new BaseFieldSet().ensure(Tenant._id).ensure(Tenant._code));
|
||||
if (tenant == null) {
|
||||
logger.error("missing tenant from event message");
|
||||
return EventProcessingStatus.Error;
|
||||
|
|
|
@ -102,7 +102,7 @@ public class InAppNotificationBuilder extends BaseBuilder<InAppNotification, InA
|
|||
Tenant::getId);
|
||||
} else {
|
||||
FieldSet clone = new BaseFieldSet(fields.getFields()).ensure(Tenant._id);
|
||||
TenantQuery q = this.queryFactory.query(TenantQuery.class).authorize(this.authorize).ids(data.stream().map(InAppNotificationEntity::getTenantId).distinct().collect(Collectors.toList()));
|
||||
TenantQuery q = this.queryFactory.query(TenantQuery.class).disableTracking().authorize(this.authorize).ids(data.stream().map(InAppNotificationEntity::getTenantId).distinct().collect(Collectors.toList()));
|
||||
itemMap = this.builderFactory.builder(TenantBuilder.class).authorize(this.authorize).asForeignKey(q, clone, Tenant::getId);
|
||||
}
|
||||
if (!fields.hasField(Tenant._id)) {
|
||||
|
@ -128,7 +128,7 @@ public class InAppNotificationBuilder extends BaseBuilder<InAppNotification, InA
|
|||
User::getId);
|
||||
} else {
|
||||
FieldSet clone = new BaseFieldSet(fields.getFields()).ensure(User._id);
|
||||
UserQuery q = this.queryFactory.query(UserQuery.class).authorize(this.authorize).ids(data.stream().map(InAppNotificationEntity::getUserId).distinct().collect(Collectors.toList()));
|
||||
UserQuery q = this.queryFactory.query(UserQuery.class).disableTracking().disableTracking().authorize(this.authorize).ids(data.stream().map(InAppNotificationEntity::getUserId).distinct().collect(Collectors.toList()));
|
||||
itemMap = this.builderFactory.builder(UserBuilder.class).authorize(this.authorize).asForeignKey(q, clone, User::getId);
|
||||
}
|
||||
if (!fields.hasField(User._id)) {
|
||||
|
|
|
@ -103,7 +103,7 @@ public class NotificationBuilder extends BaseBuilder<Notification, NotificationE
|
|||
Tenant::getId);
|
||||
} else {
|
||||
FieldSet clone = new BaseFieldSet(fields.getFields()).ensure(Tenant._id);
|
||||
TenantQuery q = this.queryFactory.query(TenantQuery.class).authorize(this.authorize).ids(data.stream().map(NotificationEntity::getTenantId).distinct().collect(Collectors.toList()));
|
||||
TenantQuery q = this.queryFactory.query(TenantQuery.class).disableTracking().authorize(this.authorize).ids(data.stream().map(NotificationEntity::getTenantId).distinct().collect(Collectors.toList()));
|
||||
itemMap = this.builderFactory.builder(TenantBuilder.class).authorize(this.authorize).asForeignKey(q, clone, Tenant::getId);
|
||||
}
|
||||
if (!fields.hasField(Tenant._id)) {
|
||||
|
@ -129,7 +129,7 @@ public class NotificationBuilder extends BaseBuilder<Notification, NotificationE
|
|||
User::getId);
|
||||
} else {
|
||||
FieldSet clone = new BaseFieldSet(fields.getFields()).ensure(User._id);
|
||||
UserQuery q = this.queryFactory.query(UserQuery.class).authorize(this.authorize).ids(data.stream().map(NotificationEntity::getUserId).filter(Objects::nonNull).distinct().collect(Collectors.toList()));
|
||||
UserQuery q = this.queryFactory.query(UserQuery.class).disableTracking().authorize(this.authorize).ids(data.stream().map(NotificationEntity::getUserId).filter(Objects::nonNull).distinct().collect(Collectors.toList()));
|
||||
itemMap = this.builderFactory.builder(UserBuilder.class).authorize(this.authorize).asForeignKey(q, clone, User::getId);
|
||||
}
|
||||
if (!fields.hasField(User._id)) {
|
||||
|
|
|
@ -95,7 +95,7 @@ public class NotificationTemplateBuilder extends BaseBuilder<NotificationTemplat
|
|||
x -> x.getId());
|
||||
} else {
|
||||
FieldSet clone = new BaseFieldSet(fields.getFields()).ensure(Tenant._id);
|
||||
TenantQuery q = this.queryFactory.query(TenantQuery.class).authorize(this.authorize).ids(datas.stream().map(x -> x.getTenantId()).distinct().collect(Collectors.toList()));
|
||||
TenantQuery q = this.queryFactory.query(TenantQuery.class).disableTracking().authorize(this.authorize).ids(datas.stream().map(x -> x.getTenantId()).distinct().collect(Collectors.toList()));
|
||||
itemMap = this.builderFactory.builder(TenantBuilder.class).authorize(this.authorize).asForeignKey(q, clone, x -> x.getId());
|
||||
}
|
||||
if (!fields.hasField(Tenant._id)) {
|
||||
|
|
|
@ -85,7 +85,7 @@ public class UserContactInfoBuilder extends BaseBuilder<UserContactInfo, UserCon
|
|||
User::getId);
|
||||
} else {
|
||||
FieldSet clone = new BaseFieldSet(fields.getFields()).ensure(User._id);
|
||||
UserQuery q = this.queryFactory.query(UserQuery.class).authorize(this.authorize).ids(data.stream().map(UserContactInfoEntity::getUserId).distinct().collect(Collectors.toList()));
|
||||
UserQuery q = this.queryFactory.query(UserQuery.class).disableTracking().authorize(this.authorize).ids(data.stream().map(UserContactInfoEntity::getUserId).distinct().collect(Collectors.toList()));
|
||||
itemMap = this.builderFactory.builder(UserBuilder.class).authorize(this.authorize).asForeignKey(q, clone, User::getId);
|
||||
}
|
||||
if (!fields.hasField(User._id)) {
|
||||
|
|
|
@ -156,6 +156,16 @@ public class InAppNotificationQuery extends QueryBase<InAppNotificationEntity> {
|
|||
return this;
|
||||
}
|
||||
|
||||
public InAppNotificationQuery enableTracking() {
|
||||
this.noTracking = false;
|
||||
return this;
|
||||
}
|
||||
|
||||
public InAppNotificationQuery disableTracking() {
|
||||
this.noTracking = false;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Boolean isFalseQuery() {
|
||||
return this.isNullOrEmpty(this.ids)
|
||||
|
|
|
@ -206,6 +206,16 @@ public class NotificationQuery extends QueryBase<NotificationEntity> {
|
|||
return this;
|
||||
}
|
||||
|
||||
public NotificationQuery enableTracking() {
|
||||
this.noTracking = false;
|
||||
return this;
|
||||
}
|
||||
|
||||
public NotificationQuery disableTracking() {
|
||||
this.noTracking = false;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Boolean isFalseQuery() {
|
||||
return this.isNullOrEmpty(this.ids)
|
||||
|
|
|
@ -145,6 +145,16 @@ public class NotificationTemplateQuery extends QueryBase<NotificationTemplateEnt
|
|||
return this;
|
||||
}
|
||||
|
||||
public NotificationTemplateQuery enableTracking() {
|
||||
this.noTracking = false;
|
||||
return this;
|
||||
}
|
||||
|
||||
public NotificationTemplateQuery disableTracking() {
|
||||
this.noTracking = false;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Boolean isFalseQuery() {
|
||||
return this.isNullOrEmpty(this.ids)
|
||||
|
|
|
@ -120,6 +120,16 @@ public class QueueInboxQuery extends QueryBase<QueueInboxEntity> {
|
|||
return this;
|
||||
}
|
||||
|
||||
public QueueInboxQuery enableTracking() {
|
||||
this.noTracking = false;
|
||||
return this;
|
||||
}
|
||||
|
||||
public QueueInboxQuery disableTracking() {
|
||||
this.noTracking = false;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class<QueueInboxEntity> entityClass() {
|
||||
return QueueInboxEntity.class;
|
||||
|
|
|
@ -126,6 +126,16 @@ public class QueueOutboxQuery extends QueryBase<QueueOutboxEntity> {
|
|||
return this;
|
||||
}
|
||||
|
||||
public QueueOutboxQuery enableTracking() {
|
||||
this.noTracking = false;
|
||||
return this;
|
||||
}
|
||||
|
||||
public QueueOutboxQuery disableTracking() {
|
||||
this.noTracking = false;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class<QueueOutboxEntity> entityClass() {
|
||||
return QueueOutboxEntity.class;
|
||||
|
|
|
@ -119,6 +119,16 @@ public class TenantConfigurationQuery extends QueryBase<TenantConfigurationEntit
|
|||
return this;
|
||||
}
|
||||
|
||||
public TenantConfigurationQuery enableTracking() {
|
||||
this.noTracking = false;
|
||||
return this;
|
||||
}
|
||||
|
||||
public TenantConfigurationQuery disableTracking() {
|
||||
this.noTracking = false;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Boolean isFalseQuery() {
|
||||
return this.isEmpty(this.ids) ||this.isEmpty(this.isActives) ||this.isEmpty(this.types) || this.isEmpty(this.tenantIds);
|
||||
|
|
|
@ -63,6 +63,16 @@ public class TenantQuery extends QueryBase<TenantEntity> {
|
|||
return this;
|
||||
}
|
||||
|
||||
public TenantQuery enableTracking() {
|
||||
this.noTracking = false;
|
||||
return this;
|
||||
}
|
||||
|
||||
public TenantQuery disableTracking() {
|
||||
this.noTracking = false;
|
||||
return this;
|
||||
}
|
||||
|
||||
public TenantQuery authorize(EnumSet<AuthorizationFlags> values) {
|
||||
this.authorize = values;
|
||||
return this;
|
||||
|
|
|
@ -114,6 +114,16 @@ public class TenantUserQuery extends QueryBase<TenantUserEntity> {
|
|||
return this;
|
||||
}
|
||||
|
||||
public TenantUserQuery enableTracking() {
|
||||
this.noTracking = false;
|
||||
return this;
|
||||
}
|
||||
|
||||
public TenantUserQuery disableTracking() {
|
||||
this.noTracking = false;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class<TenantUserEntity> entityClass() {
|
||||
return TenantUserEntity.class;
|
||||
|
|
|
@ -154,6 +154,16 @@ public class UserContactInfoQuery extends QueryBase<UserContactInfoEntity> {
|
|||
return this;
|
||||
}
|
||||
|
||||
public UserContactInfoQuery enableTracking() {
|
||||
this.noTracking = false;
|
||||
return this;
|
||||
}
|
||||
|
||||
public UserContactInfoQuery disableTracking() {
|
||||
this.noTracking = false;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Boolean isFalseQuery() {
|
||||
return this.isEmpty(this.userIds) || this.isEmpty(this.excludedUserIds) || this.isEmpty(this.isActives)
|
||||
|
|
|
@ -125,6 +125,16 @@ public class UserCredentialQuery extends QueryBase<UserCredentialEntity> {
|
|||
return this;
|
||||
}
|
||||
|
||||
public UserCredentialQuery enableTracking() {
|
||||
this.noTracking = false;
|
||||
return this;
|
||||
}
|
||||
|
||||
public UserCredentialQuery disableTracking() {
|
||||
this.noTracking = false;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Boolean isFalseQuery() {
|
||||
return
|
||||
|
|
|
@ -127,6 +127,16 @@ public class UserNotificationPreferenceQuery extends QueryBase<UserNotificationP
|
|||
return this;
|
||||
}
|
||||
|
||||
public UserNotificationPreferenceQuery enableTracking() {
|
||||
this.noTracking = false;
|
||||
return this;
|
||||
}
|
||||
|
||||
public UserNotificationPreferenceQuery disableTracking() {
|
||||
this.noTracking = false;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Boolean isFalseQuery() {
|
||||
return this.isEmpty(this.ids) || this.isEmpty(this.tenantIds) ||this.isEmpty(this.excludedIds) ||this.isNullOrEmpty(this.userId) && this.isNullOrEmpty(this.type) && this.isNullOrEmpty(this.channel);
|
||||
|
|
|
@ -81,6 +81,16 @@ public class UserQuery extends QueryBase<UserEntity> {
|
|||
return this;
|
||||
}
|
||||
|
||||
|
||||
public UserQuery enableTracking() {
|
||||
this.noTracking = false;
|
||||
return this;
|
||||
}
|
||||
|
||||
public UserQuery disableTracking() {
|
||||
this.noTracking = false;
|
||||
return this;
|
||||
}
|
||||
@Override
|
||||
protected Class<UserEntity> entityClass() {
|
||||
return UserEntity.class;
|
||||
|
|
|
@ -125,6 +125,16 @@ public class UserRoleQuery extends QueryBase<UserRoleEntity> {
|
|||
return this;
|
||||
}
|
||||
|
||||
public UserRoleQuery enableTracking() {
|
||||
this.noTracking = false;
|
||||
return this;
|
||||
}
|
||||
|
||||
public UserRoleQuery disableTracking() {
|
||||
this.noTracking = false;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Boolean isFalseQuery() {
|
||||
return
|
||||
|
|
|
@ -65,7 +65,7 @@ public class EmailContactExtractor implements ContactExtractor {
|
|||
}
|
||||
else if (notification.getUserId() != null) {
|
||||
logger.trace("extracting from user");
|
||||
UserContactInfoEntity userContactInfo = this.queryFactory.query(UserContactInfoQuery.class)
|
||||
UserContactInfoEntity userContactInfo = this.queryFactory.query(UserContactInfoQuery.class).disableTracking()
|
||||
.userIds(notification.getUserId())
|
||||
.isActive(IsActive.Active)
|
||||
.type(ContactInfoType.Email).firstAs(new BaseFieldSet().ensure(UserContactInfo._value));
|
||||
|
|
|
@ -57,7 +57,7 @@ public class InAppNotificationServiceImpl implements InAppNotificationService {
|
|||
try {
|
||||
logger.debug(new DataLogEntry("marking as read in-app notifications", ids));
|
||||
UUID userId = this.userScope.getUserId();
|
||||
List<InAppNotificationEntity> items = this.queryFactory.query(InAppNotificationQuery.class)
|
||||
List<InAppNotificationEntity> items = this.queryFactory.query(InAppNotificationQuery.class).disableTracking()
|
||||
.ids(ids)
|
||||
.userId(userId)
|
||||
.collect();
|
||||
|
|
|
@ -83,7 +83,7 @@ public class MessageBuilderServiceImpl implements MessageInfoBuilderService {
|
|||
|
||||
UserEntity userProfile = null;
|
||||
if (notification.getUserId() != null) {
|
||||
userProfile = this.queryFactory.query(UserQuery.class)
|
||||
userProfile = this.queryFactory.query(UserQuery.class).disableTracking()
|
||||
.ids(notification.getUserId())
|
||||
.isActive(IsActive.Active).first();
|
||||
}
|
||||
|
@ -109,7 +109,7 @@ public class MessageBuilderServiceImpl implements MessageInfoBuilderService {
|
|||
|
||||
if (this.scope.isMultitenant()) {
|
||||
if (!this.scope.isDefaultTenant()) {
|
||||
TenantEntity tenantInfo = this.queryFactory.query(TenantQuery.class)
|
||||
TenantEntity tenantInfo = this.queryFactory.query(TenantQuery.class).disableTracking()
|
||||
.isActive(IsActive.Active).firstAs(new BaseFieldSet(TenantEntity._id, TenantEntity._code));
|
||||
|
||||
if (tenantInfo == null) {
|
||||
|
|
|
@ -159,7 +159,7 @@ public class NotificationServiceImpl implements NotificationService {
|
|||
if (notification.getUserId() == null) return null;
|
||||
Ordering ordering = new Ordering();
|
||||
ordering.addAscending(UserNotificationPreference._ordinal);
|
||||
UserNotificationPreferenceQuery query = this.queryFactory.query(UserNotificationPreferenceQuery.class).userId(notification.getUserId()).type(notification.getType()).isActives(IsActive.Active);
|
||||
UserNotificationPreferenceQuery query = this.queryFactory.query(UserNotificationPreferenceQuery.class).disableTracking().userId(notification.getUserId()).type(notification.getType()).isActives(IsActive.Active);
|
||||
query.setOrder(ordering);
|
||||
|
||||
List<UserNotificationPreferenceEntity> preferences = query.collectAs(new BaseFieldSet().ensure(UserNotificationPreference._channel).ensure(UserNotificationPreference._tenantId).ensure(UserNotificationPreference._id));
|
||||
|
|
|
@ -184,7 +184,7 @@ public class NotificationServiceTemplateImpl implements NotificationTemplateServ
|
|||
|
||||
@Override
|
||||
public NotificationTemplate lookupOverriddenTemplates(UUID notificationType, NotificationTemplateChannel channel, String language) {
|
||||
NotificationTemplateQuery query = this.queryFactory.query(NotificationTemplateQuery.class)
|
||||
NotificationTemplateQuery query = this.queryFactory.query(NotificationTemplateQuery.class).disableTracking()
|
||||
.notificationTypes(notificationType)
|
||||
.channels(channel)
|
||||
.languageCodes(language)
|
||||
|
|
|
@ -207,7 +207,7 @@ public class TenantConfigurationServiceImpl implements TenantConfigurationServic
|
|||
|
||||
@Override
|
||||
public TenantConfigurationEntity getTenantConfigurationEntityForType(TenantConfigurationType type){
|
||||
TenantConfigurationQuery query = this.queryFactory.query(TenantConfigurationQuery.class).authorize(AuthorizationFlags.OwnerOrPermission).isActive(IsActive.Active).types(type);
|
||||
TenantConfigurationQuery query = this.queryFactory.query(TenantConfigurationQuery.class).disableTracking().authorize(AuthorizationFlags.OwnerOrPermission).isActive(IsActive.Active).types(type);
|
||||
if (this.tenantScope.isDefaultTenant()) query.tenantIsSet(false);
|
||||
else {
|
||||
try {
|
||||
|
|
Loading…
Reference in New Issue