From 22f0074ca7c3c71a7b8065a66c135e48f40b27c8 Mon Sep 17 00:00:00 2001 From: Jonathan Cobb Date: Tue, 10 Mar 2020 05:33:48 -0400 Subject: [PATCH] make passthru optional, default to false --- .../src/main/java/bubble/dao/app/AppMatcherDAO.java | 5 +++++ bubble-server/src/main/java/bubble/model/app/AppMatcher.java | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/bubble-server/src/main/java/bubble/dao/app/AppMatcherDAO.java b/bubble-server/src/main/java/bubble/dao/app/AppMatcherDAO.java index 5c60cce3..920ce529 100644 --- a/bubble-server/src/main/java/bubble/dao/app/AppMatcherDAO.java +++ b/bubble-server/src/main/java/bubble/dao/app/AppMatcherDAO.java @@ -52,6 +52,11 @@ public class AppMatcherDAO extends AppTemplateEntityDAO { return list(criteria().add(gt(MTIME, lastMod))); } + @Override public Object preCreate(AppMatcher matcher) { + if (matcher.getPassthru() == null) matcher.setPassthru(false); + return super.preCreate(matcher); + } + @Override public AppMatcher postUpdate(AppMatcher matcher, Object context) { final BubbleApp app = appDAO.findByUuid(matcher.getApp()); if (app == null) return die("postUpdate("+ matcher.getUuid()+"): app not found: "+ matcher.getApp()); diff --git a/bubble-server/src/main/java/bubble/model/app/AppMatcher.java b/bubble-server/src/main/java/bubble/model/app/AppMatcher.java index b5e6e4d0..5622c18f 100644 --- a/bubble-server/src/main/java/bubble/model/app/AppMatcher.java +++ b/bubble-server/src/main/java/bubble/model/app/AppMatcher.java @@ -125,7 +125,7 @@ public class AppMatcher extends IdentifiableBase implements AppTemplateEntity, H @ECIndex @Column(nullable=false) @Getter @Setter private Boolean enabled = true; - @ECSearchable @ECField(index=120) + @ECSearchable @ECField(index=120, required=EntityFieldRequired.optional) @ECIndex @Column(nullable=false) @Getter @Setter private Boolean passthru; public boolean passthru () { return bool(passthru); }