diff --git a/.travis.yml b/.travis.yml index fb6a2d64..157ef94c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: java jdk: - - oraclejdk8 + - openjdk8 install: - mvn test-compile -DskipTests=true -Dmaven.javadoc.skip=true -B -V diff --git a/auth/pom.xml b/auth/pom.xml index 957d7e7e..6eefc762 100644 --- a/auth/pom.xml +++ b/auth/pom.xml @@ -12,7 +12,7 @@ edu.tamu.weaver webservice-parent - 2.0.0 + 2.0.1-SNAPSHOT @@ -20,25 +20,25 @@ edu.tamu.weaver core - 2.0.0 + 2.0.1-SNAPSHOT edu.tamu.weaver user - 2.0.0 + 2.0.1-SNAPSHOT edu.tamu.weaver token - 2.0.0 + 2.0.1-SNAPSHOT edu.tamu.weaver email - 2.0.0 + 2.0.1-SNAPSHOT diff --git a/core/pom.xml b/core/pom.xml index 8139adc8..9041eecb 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -12,7 +12,7 @@ edu.tamu.weaver webservice-parent - 2.0.0 + 2.0.1-SNAPSHOT diff --git a/data/pom.xml b/data/pom.xml index 2cb694c7..d6adf5a2 100644 --- a/data/pom.xml +++ b/data/pom.xml @@ -12,7 +12,7 @@ edu.tamu.weaver webservice-parent - 2.0.0 + 2.0.1-SNAPSHOT @@ -20,7 +20,7 @@ edu.tamu.weaver core - 2.0.0 + 2.0.1-SNAPSHOT diff --git a/data/src/main/java/edu/tamu/weaver/data/utility/EntityUtility.java b/data/src/main/java/edu/tamu/weaver/data/utility/EntityUtility.java index 39ead630..88f20974 100644 --- a/data/src/main/java/edu/tamu/weaver/data/utility/EntityUtility.java +++ b/data/src/main/java/edu/tamu/weaver/data/utility/EntityUtility.java @@ -29,7 +29,6 @@ public class EntityUtility { public static final String NAME_COLUMN_NAME = "name"; public static final String PASSWORD_COLUMN_NAME = "password"; public static final String POSITION_COLUMN_NAME = "position"; - public static final String SYSTEM_COLUMN_NAME = "isSystemRequired"; public static String snakeToCamelWithoutId(String value) { int l = 0; @@ -205,14 +204,6 @@ public static List queryByProperty(Class clazz, String property, Obje return entityManager.createQuery(query).getResultList(); } - public static Object createNewFromSystemDefault(Object model) { - EntityManager entityManager = SpringContext.bean(EntityManager.class); - setValueForProperty(model, SYSTEM_COLUMN_NAME, false); - setValueForProperty(model, ID_COLUMN_NAME, null); - entityManager.persist(model); - return model; - } - public static Field recursivelyFindField(Class clazz, String property) { Field field = null; try { diff --git a/email/pom.xml b/email/pom.xml index 636a0365..c303a49d 100644 --- a/email/pom.xml +++ b/email/pom.xml @@ -12,7 +12,7 @@ edu.tamu.weaver webservice-parent - 2.0.0 + 2.0.1-SNAPSHOT diff --git a/messaging/pom.xml b/messaging/pom.xml index adb38dfc..2a2a3f18 100644 --- a/messaging/pom.xml +++ b/messaging/pom.xml @@ -12,7 +12,7 @@ edu.tamu.weaver webservice-parent - 2.0.0 + 2.0.1-SNAPSHOT diff --git a/pom.xml b/pom.xml index 201175b8..3b2215ed 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ webservice-parent - 2.0.0 + 2.0.1-SNAPSHOT Weaver Webservice Parent diff --git a/reporting/pom.xml b/reporting/pom.xml index c45d28df..3d4afb18 100644 --- a/reporting/pom.xml +++ b/reporting/pom.xml @@ -12,7 +12,7 @@ edu.tamu.weaver webservice-parent - 2.0.0 + 2.0.1-SNAPSHOT @@ -20,13 +20,13 @@ edu.tamu.weaver core - 2.0.0 + 2.0.1-SNAPSHOT edu.tamu.weaver email - 2.0.0 + 2.0.1-SNAPSHOT diff --git a/token-provider/pom.xml b/token-provider/pom.xml index f02693d0..906b510e 100644 --- a/token-provider/pom.xml +++ b/token-provider/pom.xml @@ -13,7 +13,7 @@ edu.tamu.weaver webservice-parent - 2.0.0 + 2.0.1-SNAPSHOT @@ -26,13 +26,13 @@ edu.tamu.weaver token - 2.0.0 + 2.0.1-SNAPSHOT edu.tamu.weaver core - 2.0.0 + 2.0.1-SNAPSHOT diff --git a/token/pom.xml b/token/pom.xml index e9644d45..5fb3ccee 100644 --- a/token/pom.xml +++ b/token/pom.xml @@ -12,7 +12,7 @@ edu.tamu.weaver webservice-parent - 2.0.0 + 2.0.1-SNAPSHOT diff --git a/user/pom.xml b/user/pom.xml index 6d4dc360..c455290b 100644 --- a/user/pom.xml +++ b/user/pom.xml @@ -12,7 +12,7 @@ edu.tamu.weaver webservice-parent - 2.0.0 + 2.0.1-SNAPSHOT @@ -21,13 +21,13 @@ edu.tamu.weaver data - 2.0.0 + 2.0.1-SNAPSHOT edu.tamu.weaver validation - 2.0.0 + 2.0.1-SNAPSHOT diff --git a/validation/pom.xml b/validation/pom.xml index c3eba9c3..113d4133 100644 --- a/validation/pom.xml +++ b/validation/pom.xml @@ -12,7 +12,7 @@ edu.tamu.weaver webservice-parent - 2.0.0 + 2.0.1-SNAPSHOT @@ -21,7 +21,7 @@ edu.tamu.weaver data - 2.0.0 + 2.0.1-SNAPSHOT diff --git a/validation/src/main/java/edu/tamu/weaver/validation/utility/ValidationUtility.java b/validation/src/main/java/edu/tamu/weaver/validation/utility/ValidationUtility.java index ab25f91d..58250f90 100644 --- a/validation/src/main/java/edu/tamu/weaver/validation/utility/ValidationUtility.java +++ b/validation/src/main/java/edu/tamu/weaver/validation/utility/ValidationUtility.java @@ -2,9 +2,6 @@ import static edu.tamu.weaver.data.utility.EntityUtility.NAME_COLUMN_NAME; import static edu.tamu.weaver.data.utility.EntityUtility.PASSWORD_COLUMN_NAME; -import static edu.tamu.weaver.data.utility.EntityUtility.SYSTEM_COLUMN_NAME; -import static edu.tamu.weaver.data.utility.EntityUtility.createNewFromSystemDefault; -import static edu.tamu.weaver.data.utility.EntityUtility.getFieldForProperty; import static edu.tamu.weaver.data.utility.EntityUtility.getValueForProperty; import static edu.tamu.weaver.data.utility.EntityUtility.getValueFromPath; import static edu.tamu.weaver.data.utility.EntityUtility.queryAllWithClass; @@ -237,16 +234,10 @@ public static ValidationResults validateBusiness(Bu // check if unique constraints will be violated!! - Boolean isSystemRequired = (Boolean) getValueForProperty(model, SYSTEM_COLUMN_NAME); - - if (isSystemRequired != null && isSystemRequired) { - model = (U) createNewFromSystemDefault(model); - } else { - if (uniqueConstraintPropertyChange(model)) { - UniqueConstraintViolation uniqueConstraintViolation = validateUniqueConstraints(model); - invalid = uniqueConstraintViolation.invalid; - message = uniqueConstraintViolation.message; - } + if (uniqueConstraintPropertyChange(model)) { + UniqueConstraintViolation uniqueConstraintViolation = validateUniqueConstraints(model); + invalid = uniqueConstraintViolation.invalid; + message = uniqueConstraintViolation.message; } } @@ -295,7 +286,8 @@ public static ValidationResults validateBusiness(Bu if (!invalid) { - // check if relationships from params(columns) will cause foreign key constraints!! + // check if relationships from params(columns) will cause foreign key + // constraints!! U modelToDelete = (U) queryResults.get(0); @@ -422,14 +414,6 @@ public static ValidationResults validateBusiness(Bu } - if (!invalid) { - Object value = getValueForProperty(model, SYSTEM_COLUMN_NAME); - if (value != null && ((Boolean) value) == true) { - invalid = true; - message = model.getClass().getSimpleName() + " with id " + ((WeaverEntity) model).getId() + " is a system default and cannot be deleted"; - } - } - if (invalid) { results.addMessage(BUSINESS_MESSAGE_KEY, validator.getType().toString(), message); results.setValid(false); @@ -454,24 +438,6 @@ public static ValidationResults validateBusiness(Bu } } - // check if model has a system default - - if (!invalid) { - if (getFieldForProperty(model, SYSTEM_COLUMN_NAME) == null) { - invalid = true; - message = model.getClass().getSimpleName() + " is not a system default in which can be reset"; - } - } - - // check if model is not a system default - - if (!invalid) { - if ((Boolean) getValueForProperty(model, SYSTEM_COLUMN_NAME) == true) { - invalid = true; - message = model.getClass().getSimpleName() + " is the system default"; - } - } - if (invalid) { results.addMessage(BUSINESS_MESSAGE_KEY, validator.getType().toString(), message); results.setValid(false); diff --git a/wro/pom.xml b/wro/pom.xml index a6e6020b..c69890ee 100644 --- a/wro/pom.xml +++ b/wro/pom.xml @@ -13,7 +13,7 @@ edu.tamu.weaver webservice-parent - 2.0.0 + 2.0.1-SNAPSHOT @@ -22,7 +22,7 @@ edu.tamu.weaver data - 2.0.0 + 2.0.1-SNAPSHOT