@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 void postLoad(Object object) { System.out.println("++ postLoad"); } }
@PostLoad private void splitAndPopulate() { String[] split = details.split(DELIMITER); assert ((split != null) && (split.length == 2)) : "DoubleRangeConstraint.setDetails - Details could not be split. Details: " + details; minimum = (UNBOUNDED_SYMBOL.equals(split[0])) ? null : new Double(split[0]); maximum = (UNBOUNDED_SYMBOL.equals(split[1])) ? null : new Double(split[1]); }
@PostLoad private void splitAndPopulate() { String[] split = details.split(DELIMITER); assert ((split != null) && (split.length == 2)) : "IntegerRangeConstraint.setDetails - Details could not be split. Details: " + details; minimum = (UNBOUNDED_SYMBOL.equals(split[0])) ? null : new Long(split[0]); maximum = (UNBOUNDED_SYMBOL.equals(split[1])) ? null : new Long(split[1]); }
@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 public void load() throws IOException { if (!StringUtils.isEmpty(details)) { this.detailsMap = JsonUtil.toEntity(details, new TypeReference<Map<String, Object>>() { }); } }
@PostLoad private void loadMethods() { if (Objeto.notBlank(tag)) { tags = Lists.newArrayList(tag.split(";")); // tags = Arrays.asList(tag.split(";")); } }