Browse Source
Simplify RuleChainDetailsDao interface and refactor save to doSave
pull/15361/head
Viacheslav Klimov
4 months ago
Failed to extract signature
2 changed files with
4 additions and
10 deletions
-
dao/src/main/java/org/thingsboard/server/dao/rule/RuleChainDetailsDao.java
-
dao/src/main/java/org/thingsboard/server/dao/sql/rule/JpaRuleChainDetailsDao.java
|
|
|
@ -15,15 +15,9 @@ |
|
|
|
*/ |
|
|
|
package org.thingsboard.server.dao.rule; |
|
|
|
|
|
|
|
import org.thingsboard.server.common.data.id.TenantId; |
|
|
|
import org.thingsboard.server.common.data.rule.RuleChainDetails; |
|
|
|
import org.thingsboard.server.dao.Dao; |
|
|
|
|
|
|
|
import java.util.UUID; |
|
|
|
|
|
|
|
public interface RuleChainDetailsDao { |
|
|
|
|
|
|
|
RuleChainDetails findById(TenantId tenantId, UUID id); |
|
|
|
|
|
|
|
RuleChainDetails save(TenantId tenantId, RuleChainDetails ruleChainDetails); |
|
|
|
public interface RuleChainDetailsDao extends Dao<RuleChainDetails> { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@ -52,9 +52,9 @@ public class JpaRuleChainDetailsDao extends JpaAbstractDao<RuleChainDetailsEntit |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public RuleChainDetails save(TenantId tenantId, RuleChainDetails ruleChainDetails) { |
|
|
|
protected RuleChainDetailsEntity doSave(RuleChainDetailsEntity entity, boolean isNew, boolean flush) { |
|
|
|
try { |
|
|
|
return super.save(tenantId, ruleChainDetails); |
|
|
|
return super.doSave(entity, isNew, flush); |
|
|
|
} catch (Exception e) { |
|
|
|
String rootMsg = ExceptionUtils.getRootCauseMessage(e); |
|
|
|
if (StringUtils.contains(rootMsg, "value too long")) { |
|
|
|
|