customer = customerService.readCustomerById(overrideId); if (customer != null && !customer.isRegistered() && !customer.isLoggedIn() && !customer.isCookied()) { customer.setAnonymous(true);
customer.setAnonymous(true);
/** * After a JPA merge occurs, there is a new object created representing the merged changes. The new object does * not reflect the state of transient fields that may have been set on the object that was merged. * * This method, by default, resets the state of transient properties. * and allows the user to override this method to set additional (or different) transient values. * * @param preMergedCustome * @param postMergedCustomer */ protected void resetTransientFields(Customer preMergedCustomer, Customer postMergedCustomer) { postMergedCustomer.setUnencodedPassword(preMergedCustomer.getUnencodedPassword()); postMergedCustomer.setUnencodedChallengeAnswer(preMergedCustomer.getUnencodedChallengeAnswer()); postMergedCustomer.setAnonymous(preMergedCustomer.isAnonymous()); postMergedCustomer.setCookied(preMergedCustomer.isCookied()); postMergedCustomer.setLoggedIn(preMergedCustomer.isRegistered()); postMergedCustomer.getTransientProperties().putAll(preMergedCustomer.getTransientProperties()); }
cloned.setAnonymous(anonymous); cloned.setChallengeAnswer(challengeAnswer); cloned.setChallengeQuestion(challengeQuestion);
customer.setAnonymous(true);
/** * After a JPA merge occurs, there is a new object created representing the merged changes. The new object does * not reflect the state of transient fields that may have been set on the object that was merged. * * This method, by default, resets the state of transient properties. * and allows the user to override this method to set additional (or different) transient values. * * @param preMergedCustome * @param postMergedCustomer */ protected void resetTransientFields(Customer preMergedCustomer, Customer postMergedCustomer) { postMergedCustomer.setUnencodedPassword(preMergedCustomer.getUnencodedPassword()); postMergedCustomer.setUnencodedChallengeAnswer(preMergedCustomer.getUnencodedChallengeAnswer()); postMergedCustomer.setAnonymous(preMergedCustomer.isAnonymous()); postMergedCustomer.setCookied(preMergedCustomer.isCookied()); postMergedCustomer.setLoggedIn(preMergedCustomer.isLoggedIn()); postMergedCustomer.getTransientProperties().putAll(preMergedCustomer.getTransientProperties()); }