@PostLoad public void postLoad(Person person) { person.postLoaded = this.context; }
@PostLoad public void calculate() { //... } }
@PostLoad public void calculateAge() { Calendar birth = new GregorianCalendar(); birth.setTime( dateOfBirth ); Calendar now = new GregorianCalendar(); now.setTime( new Date() ); int adjust = 0; if ( now.get( Calendar.DAY_OF_YEAR ) - birth.get( Calendar.DAY_OF_YEAR ) < 0 ) { adjust = -1; } age = now.get( Calendar.YEAR ) - birth.get( Calendar.YEAR ) + adjust; }
/** * Set the transient property at load time based on a calculation. * Note that a native Hibernate formula mapping is better for this purpose. */ @PostLoad public void calculateAge() { age = ChronoUnit.YEARS.between( LocalDateTime.ofInstant( Instant.ofEpochMilli( dateOfBirth.getTime()), ZoneOffset.UTC), LocalDateTime.now() ); } }
@PostLoad @PostPersist @PostUpdate public void decodePrincipal() { if (StringUtils.isNotBlank(encodedPrincipal)) { this.principal = AuthenticatedPrincipal.deserialize(encodedPrincipal); } }
@PostLoad @PostPersist @PostUpdate public void decodePrincipal() { if (StringUtils.isNotBlank(encodedPrincipal)) { this.principal = AuthenticatedPrincipal.deserialize(encodedPrincipal); } }
@PostLoad public void handledPostLoad(PersonEventDispatch user) { if(user != null) { user.setLastName("Post Load"); } }
@PostLoad public void handledPostLoad(PersonEventDispatch user) { //if(user != null) { user.setLastName("Post Load"); } }
@PostLoad void onPostLoad(Object o) { getDataBaseFacade().entityEvent(EntityEvent.POST_LOAD, o); if (CoreGlobalProperty.SHADOW_ENTITY_ON) { if (o instanceof ShadowEntity) { ShadowEntity s = (ShadowEntity) o; s.setShadow(SerializationUtils.clone((Serializable) o)); } } }
@PostLoad public void initialize() { if (CollectionUtils.isEmpty(this.applicationDefinitions)) { this.applicationDefinitions = getAppDefinitions(this.name, this.dslText); } }
@PostLoad private void loadMethods() { if (Objeto.notBlank(tag)) { tags = Lists.newArrayList(tag.split(";")); // tags = Arrays.asList(tag.split(";")); } }
@Override @PostLoad public final void onLoad() { setPersisted(true); }
@PostLoad public void load() throws IOException { if (!StringUtils.isEmpty(predicateConfig)) { this.configMap = JsonUtil.toEntity(predicateConfig, new TypeReference<Map<String, Object>>() { }); } }
@PostLoad public void load() throws IOException { if (!StringUtils.isEmpty(config)) { this.configMap = JsonUtil.toEntity(config, new TypeReference<Map<String, Object>>() { }); } }
@PostLoad public void load() throws IOException { if (!StringUtils.isEmpty(sinks)) { this.sinksList = JsonUtil.toEntity(sinks, new TypeReference<List<String>>() { }); } else { this.sinksList = null; } }
@PostLoad @PostUpdate public void determineLockStatus() { if (getToolItemAssociations() != null && getToolItemAssociations().size() > 0) { getMetadata().setLocked(true); } }
@PostLoad private void postLoad() { this.dollars = cents / 100D; long months = createdOn.toLocalDateTime().until(LocalDateTime.now(), ChronoUnit.MONTHS); double interestUnrounded = ( ( interestRate / 100D ) * cents * months ) / 12; this.interestCents = BigDecimal.valueOf(interestUnrounded).setScale(0, BigDecimal.ROUND_HALF_EVEN).longValue(); this.interestDollars = interestCents / 100D; }
@PostPersist @PostUpdate @PostLoad protected void decryptData() { // Encrypt the endpoint properties. configuration = CurrentDataEncrypter.instance.decrypt(configuration, new DataEncryptionContext()); }
@PostPersist @PostUpdate @PostLoad protected void decryptData() { // Decrypt the endpoint properties. EntityType entityType = EntityType.Api; if (type == PolicyType.Client) { entityType = EntityType.ClientApp; } else if (type == PolicyType.Plan) { entityType = EntityType.Plan; } DataEncryptionContext ctx = new DataEncryptionContext(organizationId, entityId, entityVersion, entityType); configuration = CurrentDataEncrypter.instance.decrypt(configuration, ctx); }
@PostLoad @PostUpdate public void determineSharedParentStatus() { Criterion criterion = getCriterion(); if (criterion != null) { Rubric rubric = criterion.getRubric(); if (rubric != null && rubric.getMetadata().isShared()) { getMetadata().setShared(true); } } }