微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

javax.persistence.PostLoad的实例源码

项目:springboot-shiro-cas-mybatis    文件AbstractRegisteredService.java   
/**
 * Initializes the registered service with default values
 * for fields that are unspecified. Only triggered by JPA.
 * @since 4.1
 */
@PostLoad
public final void postLoad() {
    if (this.proxyPolicy == null) {
        this.proxyPolicy = new RefuseRegisteredServiceProxyPolicy();
    }
    if (this.usernameAttributeProvider == null) {
        this.usernameAttributeProvider = new DefaultRegisteredServiceUsernameProvider();
    }
    if (this.logoutType == null) {
        this.logoutType = logoutType.BACK_CHANNEL;
    }
    if (this.requiredHandlers == null) {
        this.requiredHandlers = new HashSet<>();
    }
    if (this.accessstrategy == null) {
        this.accessstrategy = new DefaultRegisteredServiceAccessstrategy();
    }
    if (this.properties == null) {
        this.properties = new HashMap<>();
    }
}
项目:springboot-shiro-cas-mybatis    文件AbstractRegisteredService.java   
/**
 * Initializes the registered service with default values
 * for fields that are unspecified. Only triggered by JPA.
 * @since 4.1
 */
@PostLoad
public final void postLoad() {
    if (this.proxyPolicy == null) {
        this.proxyPolicy = new RefuseRegisteredServiceProxyPolicy();
    }
    if (this.usernameAttributeProvider == null) {
        this.usernameAttributeProvider = new DefaultRegisteredServiceUsernameProvider();
    }
    if (this.logoutType == null) {
        this.logoutType = logoutType.BACK_CHANNEL;
    }
    if (this.requiredHandlers == null) {
        this.requiredHandlers = new HashSet<>();
    }
    if (this.accessstrategy == null) {
        this.accessstrategy = new DefaultRegisteredServiceAccessstrategy();
    }
    if (this.attributeReleasePolicy == null) {
        this.attributeReleasePolicy = new ReturnAllowedAttributeReleasePolicy();
    }
}
项目:os    文件CheckingEntityListener.java   
@PostLoad
public void checking(Object target) {
    AnnotationCheckingMetadata Metadata = AnnotationCheckingMetadata.getMetadata(target.getClass());
    if (Metadata.isCheckable()) {
        StringBuilder sb = new StringBuilder();
        for (Field field : Metadata.getCheckedFields()) {
            ReflectionUtils.makeAccessible(field);
            Object value = ReflectionUtils.getField(field,target);
            if (value instanceof Date) {
                throw new RuntimeException("不支持时间类型字段解密!");
            }
            sb.append(value).append(" - ");
        }
        sb.append(MD5_KEY);
        LOGGER.debug("验证数据:" + sb);
        String hex = MD5Utils.encode(sb.toString());
        Field checksumField = Metadata.getCheckableField();
        ReflectionUtils.makeAccessible(checksumField);
        String checksum = (String) ReflectionUtils.getField(checksumField,target);
        if (!checksum.equals(hex)) {
            //throw new RuntimeException("数据验证失败!");
        }
    }
}
项目:cas-server-4.2.1    文件AbstractRegisteredService.java   
/**
 * Initializes the registered service with default values
 * for fields that are unspecified. Only triggered by JPA.
 * @since 4.1
 */
@PostLoad
public final void postLoad() {
    if (this.proxyPolicy == null) {
        this.proxyPolicy = new RefuseRegisteredServiceProxyPolicy();
    }
    if (this.usernameAttributeProvider == null) {
        this.usernameAttributeProvider = new DefaultRegisteredServiceUsernameProvider();
    }
    if (this.logoutType == null) {
        this.logoutType = logoutType.BACK_CHANNEL;
    }
    if (this.requiredHandlers == null) {
        this.requiredHandlers = new HashSet<>();
    }
    if (this.accessstrategy == null) {
        this.accessstrategy = new DefaultRegisteredServiceAccessstrategy();
    }
    if (this.properties == null) {
        this.properties = new HashMap<>();
    }
}
项目:ha-db    文件CheckingEntityListener.java   
@PostLoad
public void checking(Object target) {
    AnnotationCheckingMetadata Metadata = AnnotationCheckingMetadata.getMetadata(target.getClass());
    if (Metadata.isCheckable()) {
        StringBuilder sb = new StringBuilder();
        for (Field field : Metadata.getCheckedFields()) {
            ReflectionUtils.makeAccessible(field);
            Object value = ReflectionUtils.getField(field,target);
        if (!checksum.equals(hex)) {
            //throw new RuntimeException("数据验证失败!");
        }
    }
}
项目:devwars.tv    文件User.java   
@PostLoad
public void postLoad() {
    Session session = DatabaseManager.getSession();

    if (this.getRanking() != null) {
        this.rank = (Rank) session.createCriteria(Rank.class)
            .add(Restrictions.le("xprequired",this.getRanking().getXp().intValue()))
            .addOrder(Order.desc("xprequired"))
            .setMaxResults(1)
            .uniqueResult();

        this.nextRank = (Rank) session.get(Rank.class,this.rank == null ? 1 : this.rank.getLevel() + 1);
    }

    session.close();
}
项目:cas4.1.9    文件AbstractRegisteredService.java   
/**
 * Initializes the registered service with default values
 * for fields that are unspecified. Only triggered by JPA.
 * @since 4.1
 */
@PostLoad
public final void postLoad() {
    if (this.proxyPolicy == null) {
        this.proxyPolicy = new RefuseRegisteredServiceProxyPolicy();
    }
    if (this.usernameAttributeProvider == null) {
        this.usernameAttributeProvider = new DefaultRegisteredServiceUsernameProvider();
    }
    if (this.logoutType == null) {
        this.logoutType = logoutType.BACK_CHANNEL;
    }
    if (this.requiredHandlers == null) {
        this.requiredHandlers = new HashSet<>();
    }
    if (this.accessstrategy == null) {
        this.accessstrategy = new DefaultRegisteredServiceAccessstrategy();
    }
    if (this.attributeReleasePolicy == null) {
        this.attributeReleasePolicy = new ReturnAllowedAttributeReleasePolicy();
    }
    if (this.properties == null) {
        this.properties = new HashMap<>();
    }
}
项目:warpdb    文件WarpDbCRUDAndCallbackTest.java   
@Test
public void testLoad() throws Exception {
    String[] ids = { User.nextId(),User.nextId(),User.nextId() };
    for (int i = 0; i < ids.length; i++) {
        User user = new User();
        user.id = ids[i];
        user.name = "Mr No." + i;
        user.email = "no." + i + "@somewhere.org";
        warpdb.save(user);
    }
    // test get & fetch:
    User u1 = warpdb.get(User.class,ids[0]);
    assertTrue(u1.callbacks.contains(PostLoad.class));
    User u2 = warpdb.fetch(User.class,ids[1]);
    assertTrue(u2.callbacks.contains(PostLoad.class));
    // test list:
    List<User> us = warpdb.list(User.class,"SELECT * FROM User where id>?",ids[1]);
    assertEquals(2,us.size());
    assertTrue(us.get(0).callbacks.contains(PostLoad.class));
    assertTrue(us.get(1).callbacks.contains(PostLoad.class));
    // test criteria:
    List<User> users = warpdb.from(User.class).where("id>?",ids[1]).list();
    assertEquals(2,users.size());
    assertTrue(users.get(0).callbacks.contains(PostLoad.class));
    assertTrue(users.get(1).callbacks.contains(PostLoad.class));
}
项目:sap_mobile_platform_espm_olingo_services    文件Product.java   
@PostLoad
private void postLoad() {
    EntityManagerFactory emf = Utility.getEntityManagerFactory();
    EntityManager em = emf.createEntityManager();
    try {
        ProductText productText = getProductText(em);
        if (productText != null) {
            this.name = productText.getName();
            this.shortDescription = productText.getShortDescription();
            this.longDescription = productText.getLongDescription();
        } else {
            this.name = "";
            this.shortDescription = "";
            this.longDescription = "";
        }
    } finally {
        em.close();
    }
}
项目:kc-rice    文件PeopleFlowBo.java   
/**
 * Updates the values in the attribute values map from the attribute bos and updates the members.
 */
@PostLoad
protected void postLoad() {
    this.attributeValues = new HashMap<String,String>();
    for (PeopleFlowAttributeBo attributeBo: attributeBos) {
        this.attributeValues.put(attributeBo.getAttributeDeFinition().getName(),attributeBo.getValue());
    }
    for (PeopleFlowMemberBo member: members) {
        if (member.getMemberName() == null) {
            member.updateRelatedobject();
        }
        for (PeopleFlowDelegateBo delegate: member.getDelegates()) {
            if (delegate.getMemberName() == null) {
                delegate.updateRelatedobject();
            }
        }
    }
}
项目:rice    文件PeopleFlowBo.java   
/**
 * Updates the values in the attribute values map from the attribute bos and updates the members.
 */
@PostLoad
protected void postLoad() {
    this.attributeValues = new HashMap<String,attributeBo.getValue());
    }
    for (PeopleFlowMemberBo member: members) {
        if (member.getMemberName() == null) {
            member.updateRelatedobject();
        }
        for (PeopleFlowDelegateBo delegate: member.getDelegates()) {
            if (delegate.getMemberName() == null) {
                delegate.updateRelatedobject();
            }
        }
    }
}
项目:spring-cloud-skipper    文件Release.java   
@PostLoad
public void afterLoad() {
    ObjectMapper mapper = new ObjectMapper();
    mapper.configure(DeserializationFeature.FAIL_ON_UNKNowN_PROPERTIES,false);
    try {
        this.pkg = mapper.readValue(this.pkgJsonString,Package.class);
        this.configValues = new ConfigValues();
        if (this.configValuesstring != null && StringUtils.hasText(configValuesstring)) {
            this.configValues.setRaw(this.configValuesstring);
        }
    }
    catch (IOException e) {
        e.printstacktrace();
    }
}
项目:cas-5.1.0    文件OidcRegisteredService.java   
/**
 * Initializes the registered service with default values
 * for fields that are unspecified. Only triggered by JPA.
 */
@PostLoad
public void postLoad() {
    if (this.scopes == null) {
        this.scopes = new HashSet<>();
    }
}
项目:cas-5.1.0    文件OAuthRegisteredService.java   
/**
 * Post load processing,once the service is located via JPA.
 */
@PostLoad
public void postLoad() {
    if (this.supportedGrantTypes == null) {
        this.supportedGrantTypes = new HashSet<>();
    }
    if (this.supportedResponseTypes == null) {
        this.supportedResponseTypes = new HashSet<>();
    }
}
项目:cas-5.1.0    文件AbstractRegisteredService.java   
/**
 * Initializes the registered service with default values
 * for fields that are unspecified. Only triggered by JPA.
 *
 * @since 4.1
 */
@PostLoad
public void postLoad() {
    if (this.proxyPolicy == null) {
        this.proxyPolicy = new RefuseRegisteredServiceProxyPolicy();
    }
    if (this.usernameAttributeProvider == null) {
        this.usernameAttributeProvider = new DefaultRegisteredServiceUsernameProvider();
    }
    if (this.logoutType == null) {
        this.logoutType = logoutType.BACK_CHANNEL;
    }
    if (this.requiredHandlers == null) {
        this.requiredHandlers = new HashSet<>();
    }
    if (this.accessstrategy == null) {
        this.accessstrategy = new DefaultRegisteredServiceAccessstrategy();
    }
    if (this.multifactorPolicy == null) {
        this.multifactorPolicy = new DefaultRegisteredServiceMultifactorPolicy();
    }
    if (this.properties == null) {
        this.properties = new HashMap<>();
    }
    if (this.attributeReleasePolicy == null) {
        this.attributeReleasePolicy = new ReturnAllowedAttributeReleasePolicy();
    }
}
项目:xm-ms-entity    文件AvatarUrlListener.java   
@PostLoad
public void postLoad(XmEntity obj) {
    String avatarUrl = obj.getAvatarUrl();
    if (StringUtils.isNoneBlank(avatarUrl)) {
        if (avatarUrl.matches(PATTERN_PART)) {
            obj.setAvatarUrl(getPrefix() + avatarUrl);
        } else {
            obj.setAvatarUrl(null);
        }
    }
}
项目:lams    文件EntityClass.java   
private void processDefaultJpaCallbacks(String instanceCallbackClassName,List<JpaCallbackClass> jpaCallbackClassList) {
    ClassInfo callbackClassInfo = getLocalBindingContext().getClassInfo( instanceCallbackClassName );

    // Process superclass first if available and not excluded
    if ( JandexHelper.getSingleAnnotation( callbackClassInfo,JPADotNames.EXCLUDE_SUPERCLASS_LISTENERS ) != null ) {
        DotName superName = callbackClassInfo.superName();
        if ( superName != null ) {
            processDefaultJpaCallbacks( instanceCallbackClassName,jpaCallbackClassList );
        }
    }

    String callbackClassName = callbackClassInfo.name().toString();
    Map<Class<?>,String> callbacksByType = new HashMap<Class<?>,String>();
    createDefaultCallback(
            PrePersist.class,PseudoJpaDotNames.DEFAULT_PRE_PERSIST,callbackClassName,callbacksByType
    );
    createDefaultCallback(
            PreRemove.class,PseudoJpaDotNames.DEFAULT_PRE_REMOVE,callbacksByType
    );
    createDefaultCallback(
            PreUpdate.class,PseudoJpaDotNames.DEFAULT_PRE_UPDATE,callbacksByType
    );
    createDefaultCallback(
            PostLoad.class,PseudoJpaDotNames.DEFAULT_POST_LOAD,callbacksByType
    );
    createDefaultCallback(
            PostPersist.class,PseudoJpaDotNames.DEFAULT_POST_PERSIST,callbacksByType
    );
    createDefaultCallback(
            PostRemove.class,PseudoJpaDotNames.DEFAULT_POST_REMOVE,callbacksByType
    );
    createDefaultCallback(
            PostUpdate.class,PseudoJpaDotNames.DEFAULT_POST_UPDATE,callbacksByType
    );
    if ( !callbacksByType.isEmpty() ) {
        jpaCallbackClassList.add( new JpaCallbackClassImpl( instanceCallbackClassName,callbacksByType,true ) );
    }
}
项目:lams    文件EntityClass.java   
private void processJpaCallbacks(String instanceCallbackClassName,boolean isListener,List<JpaCallbackClass> callbackClassList) {

        ClassInfo callbackClassInfo = getLocalBindingContext().getClassInfo( instanceCallbackClassName );

        // Process superclass first if available and not excluded
        if ( JandexHelper.getSingleAnnotation( callbackClassInfo,JPADotNames.EXCLUDE_SUPERCLASS_LISTENERS ) != null ) {
            DotName superName = callbackClassInfo.superName();
            if ( superName != null ) {
                processJpaCallbacks(
                        instanceCallbackClassName,isListener,callbackClassList
                );
            }
        }

        Map<Class<?>,String>();
        createCallback( PrePersist.class,JPADotNames.PRE_PERSIST,callbackClassInfo,isListener );
        createCallback( PreRemove.class,JPADotNames.PRE_REMOVE,isListener );
        createCallback( PreUpdate.class,JPADotNames.PRE_UPDATE,isListener );
        createCallback( PostLoad.class,JPADotNames.POST_LOAD,isListener );
        createCallback( PostPersist.class,JPADotNames.POST_PERSIST,isListener );
        createCallback( PostRemove.class,JPADotNames.POST_REMOVE,isListener );
        createCallback( PostUpdate.class,JPADotNames.POST_UPDATE,isListener );
        if ( !callbacksByType.isEmpty() ) {
            callbackClassList.add( new JpaCallbackClassImpl( instanceCallbackClassName,isListener ) );
        }
    }
项目:OperatieBRP    文件GegevenInOnderzoekListener.java   
/**
 * Als dit een gegeven in onderzoek betreft dan moet de associatie van de entiteit naar dit
 * gegeven in onderzoek worden aangemaakt.
 *
 * @param entity de geladen entiteit
 */
@PostLoad
public void postLoad(final Object entity) {
    if (entity instanceof GegevenInOnderzoek) {
        final GegevenInOnderzoek gegevenInOnderzoek = (GegevenInOnderzoek) entity;
        if (gegevenInOnderzoek.getEntiteitOfVoorkomen() != null) {
            Entiteit.convertToPojo(gegevenInOnderzoek.getEntiteitOfVoorkomen()).setGegevenInOnderzoek(gegevenInOnderzoek);
        }
    }
}
项目:OSCAR-ConCert    文件Admission.java   
@PostLoad
public void postLoad() {        
    TeamName = team == null ? "" : team.getName();
    ProgramName = program.getName();
    ProgramType = program.getType();

}
项目:OSCAR-ConCert    文件ProviderPreference.java   
@PostLoad
protected void hibernatePreFetchCollectionsFix() {
    // forces eager fetching which can't be done normally as hibernate doesn't allow mulitple collection eager fetching
    appointmentScreenForms.size();
    appointmentScreenEForms.size();
    appointmentScreenQuickLinks.size();
}
项目:devwars.tv    文件DatabaseManager.java   
@Override
public void init() {
    boolean testing = Boolean.parseBoolean(System.getProperty("testing"));

    Configuration configuration = new Configuration();
    configuration.configure("hibernate.cfg.xml");
    configuration.setInterceptor(new HibernateInterceptor());

    if (!testing) {
        configuration.setProperty("hibernate.connection.username",Reference.getEnvironmentProperty("db.username"));
        configuration.setProperty("hibernate.connection.password",Reference.getEnvironmentProperty("db.password"));
        String url = "jdbc:MysqL://" + Reference.getEnvironmentProperty("db.host") + ":" + Reference.getEnvironmentProperty("db.port") + "/devwars";
        configuration.setProperty("hibernate.connection.url",url);
    } else {
        configuration.setProperty("hibernate.connection.driver_class","org.hsqldb.jdbcDriver");
        configuration.setProperty("hibernate.connection.url","jdbc:hsqldb:mem:testdb");
        configuration.setProperty("hibernate.connection.username","sa");
        configuration.setProperty("hibernate.dialect","org.hibernate.dialect.HsqlDialect");
    }

    ServiceRegistry serviceRegistry = new ServiceRegistryBuilder().applySettings(configuration.getProperties()).buildServiceRegistry();
    sessionFactory = configuration.buildSessionFactory(serviceRegistry);

    EventListenerRegistry registry = ((SessionFactoryImpl) DatabaseManager.sessionFactory).getServiceRegistry().getService(EventListenerRegistry.class);

    registry.getEventListenerGroup(EventType.POST_LOAD).appendListener(postLoadEvent ->
    {
        HibernateInterceptor.postLoadAny(postLoadEvent.getEntity());
        HibernateInterceptor.invokeMethodWithAnnotation(postLoadEvent.getEntity(),PostLoad.class);
    });
}
项目:devwars.tv    文件UserTeam.java   
@PostLoad
public void setRanks() {
    Session session = DatabaseManager.getSession();

    this.rank = (Rank) session.createCriteria(Rank.class)
        .add(Restrictions.le("xprequired",this.getXp()))
        .addOrder(Order.desc("xprequired"))
        .setMaxResults(1)
        .uniqueResult();

    this.nextRank = (Rank) session.get(Rank.class,this.rank == null ? 1 : this.rank.getLevel() + 1);

    session.close();
}
项目:devwars.tv    文件User.java   
@PostLoad
public void performCalculatedProperties() {
    Session session = DatabaseManager.getSession();

    Query gamesQuery = session.createquery("select count(*) from Player p where p.user.id = :id");
    gamesQuery.setInteger("id",id);

    this.gamesPlayed = ((Long) DatabaseUtil.getFirstFromQuery(gamesQuery)).intValue();

    Query gamesWonQuery = session.createquery("select count(*) from Player p where p.user.id = :id and p.team.win = true and p.team.game.done = true");
    gamesWonQuery.setInteger("id",id);

    this.gamesWon = ((Long) DatabaseUtil.getFirstFromQuery(gamesWonQuery)).intValue();

    Query gamesLostQuery = session.createquery("select count(*) from Player p where p.user.id = :id and p.team.win = false and p.team.game.done = true");
    gamesLostQuery.setInteger("id",id);

    this.gamesLost = ((Long) DatabaseUtil.getFirstFromQuery(gamesLostQuery)).intValue();

    if (this.getownedTeams() != null) {
        Optional<UserTeam> ownedTeamOptional = this.getownedTeams().stream().findFirst();
        if (ownedTeamOptional.isPresent()) {
            this.setownedTeam(ownedTeamOptional.get());
        }
    }

    session.close();
}
项目:example-ddd-with-spring-data-jpa    文件SpringEntityListener.java   
@PostLoad
@PostPersist
public void inject(Object object) {
    AutowireCapablebeanfactory beanfactory = get().getbeanfactory();
    if(beanfactory == null) {
        LOG.warn("Bean Factory not set! Depdendencies will not be injected into: '{}'",object);
        return;
    }
    LOG.debug("Injecting dependencies into entity: '{}'.",object);
    beanfactory.autowireBean(object);
}
项目:jpasecurity    文件DefaultEntityListener.java   
@PostLoad
@SuppressWarnings("unused") // is used by reflection
private void privateTestMethod(Object entity) {
    if (entity == null) {
        throw new DefaultEntityListenerCalledException();
    }
}
项目:che    文件AbstractPermissions.java   
@PostLoad
private void postLoad() {
  if (userId == null) {
    userIdHolder = "*";
  } else {
    userIdHolder = userId;
  }
}
项目:che    文件ProjectConfigImpl.java   
@PostLoad
@PostUpdate
@PostPersist
private void postLoadAttributes() {
  if (dbAttributes != null) {
    attributes =
        dbAttributes.values().stream().collect(toMap(attr -> attr.name,attr -> attr.values));
  }
}
项目:sakai    文件Criterion.java   
@PostLoad
@PostUpdate
public void determineSharedParentStatus() {
    Rubric rubric = getRubric();
    if (rubric != null && rubric.getMetadata().isShared()) {
        getMetadata().setShared(true);
    }
}
项目:sakai    文件Rubric.java   
@PostLoad
@PostUpdate
public void determineLockStatus() {
    if (getToolItemAssociations() != null && getToolItemAssociations().size() > 0) {
        getMetadata().setLocked(true);
    }
}
项目:sakai    文件rating.java   
@PostLoad
@PostUpdate
public void determineSharedParentStatus() {
    Criterion criterion = getCriterion();
    if (criterion != null) {
        Rubric rubric = criterion.getRubric();
        if (rubric != null && rubric.getMetadata().isShared()) {
            getMetadata().setShared(true);
        }
    }
}
项目:npackd-gae-web    文件Package.java   
@PostLoad
public void postLoad() {
    if (this.comment == null) {
        this.comment = "";
    }
    if (this.lastModifiedAt == null) {
        this.lastModifiedAt = NWUtils.newDate();
    }
    if (this.createdAt == null) {
        this.createdAt = new Date(1355048474); // December 9,2012,11:21:14
    }
    if (this.discoveryPage == null) {
        this.discoveryPage = "";
    }
    if (this.discoveryRE == null) {
        this.discoveryRE = "";
    }
    if (this.discoveryURLPattern == null) {
        this.discoveryURLPattern = "";
    }
    if (this.createdBy == null) {
        this.createdBy = new User(NWUtils.THE_EMAIL,"gmail.com");
    }
    if (lastModifiedBy == null) {
        this.lastModifiedBy = this.createdBy;
    }
    if (this.tags == null) {
        this.tags = new ArrayList<String>();
    }
    if (permissions == null) {
        this.permissions = new ArrayList<User>();
    }
    if (permissions.size() == 0) {
        this.permissions.add(this.createdBy);
    }
    if (this.screenshots == null) {
        this.screenshots = new ArrayList<>();
    }
}
项目:fullMetalgalaxy    文件EbGamePreview.java   
@PostLoad
public void onLoad()
{
  /* do something after load */
  // This is a workarround because we can't store an @Embedded collection with
  // a null field
  getSetRegistration().remove( null );
  for( EbRegistration registration : getSetRegistration() )
  {
    if( registration.getAccount() != null && registration.getAccount().isTrancient() )
    {
      registration.setAccount( null );
    }
    if( registration.m_myEvents == null || registration.m_myEvents.isEmpty() )
    {
      registration.m_myEvents = null;
    }
    if( registration.m_singleColor == EnuColor.UnkNown || !registration.getEnuColor().contain( registration.m_singleColor ) )
    {
      registration.m_singleColor = registration.getEnuColor().getSingleColor().getValue();
    }
  }
  for( EbTeam team : getTeams() )
  {
    team.clearColorsCache();
  }
  if( m_currentPlayerId != 0 && (m_currentPlayerIds == null || m_currentPlayerIds.isEmpty()) )
  {
    m_currentPlayerIds = new ArrayList<Long>();
    m_currentPlayerIds.add( m_currentPlayerId );
  }
}
项目:mytourbook    文件TourData.java   
/**
 * Called after the object was loaded from the persistence store
 */
@PostLoad
@PostUpdate
public void onPostLoad() {

    /*
     * disable post load when database is updated from 19 to 20 because data are converted
     */
    if (TourDatabase.IS_POST_UPDATE_019_to_020) {
        return;
    }

    onPostLoadGetDataSeries();
}
项目:olingo-odata2    文件SalesOrderTombstoneListener.java   
@PostLoad
public void handleDelta(final Object entity) {
  SalesOrderHeader so = (SalesOrderHeader) entity;

  if(so == null || so.getCreationDate() == null) {
    return;
  } else if (so.getCreationDate().getTime().getTime() < ODataJPATombstoneContext.getDeltaTokenUTCTimeStamp()) {
    return;
  } else {
    addToDelta(entity,ENTITY_NAME);
  }
}
项目:spring-entity-listener    文件PasswordListener.java   
/**
 * Decrypt password after loading.
 */
@PostLoad
@PostUpdate
public void decryptPassword(TwitterUser user) {
    user.setPassword(null);

    if (user.getEncryptedPassword() != null) {
        user.setPassword(encryptor.decryptString(user.getEncryptedPassword(),user.getSalt()));
    }

    // obvIoUsly we would never do this in practice
    System.out.printf("decrypted password '%s'\n",user.getpassword());
}
项目:picketBox    文件ACLEntryImpl.java   
/**
 * <p>
 * Method called by the JPA layer after loading the persisted object.
 * </p>
 */
@PostLoad
@SuppressWarnings("unused")
private void loadState()
{
   if (this.permission != null)
      throw PicketBoxMessages.MESSAGES.aclEntryPermissionAlreadySet();
   this.permission = new CompositeACLPermission(this.bitMask);
}
项目:REST-OCD-Services    文件CustomGraph.java   
/**
 * PostLoad Method. Creates node and edge objects from the custom nodes and
 * edges and sets the mappings between the two. The mapping indices are
 * reset to omit rising numbers due to deletions and reinsertions.
 */
@PostLoad
private void postLoad() {
    List<CustomNode> nodes = new ArrayList<CustomNode>(this.customNodes.values());
    this.nodeIds.clear();
    this.customNodes.clear();
    for (CustomNode customNode : nodes) {
        Node node = customNode.createNode(this);
        this.nodeIds.put(node,node.index());
        this.customNodes.put(node.index(),customNode);
        this.reverseNodeMap.put(customNode,node);
    }
    List<CustomEdge> edges = new ArrayList<CustomEdge>(this.customEdges.values());
    this.edgeIds.clear();
    this.customEdges.clear();
    for (CustomEdge customEdge : edges) {
        Edge edge = customEdge.createEdge(this,reverseNodeMap.get(customEdge.getSource()),this.reverseNodeMap.get(customEdge.getTarget()));
        this.edgeIds.put(edge,edge.index());
        this.customEdges.put(edge.index(),customEdge);
    }
    nodeIndexer = this.nodeCount();
    edgeIndexer = this.edgeCount();
    Iterator<?> listenerIt = this.getGraphListeners();
    while (listenerIt.hasNext()) {
        this.removeGraphListener((GraphListener) listenerIt.next());
        listenerIt.remove();
    }
    this.addGraphListener(new CustomGraphListener());
}
项目:Transitdatafeeder    文件StopTime.java   
@PostLoad
public void splitArrivalAndDepartureTimes() {
    if (arrivalTime != null) {
        java.util.Calendar arrivalTimeCal = java.util.Calendar.getInstance();
        arrivalTimeCal.setTime(arrivalTime);
        arrivalTimeHour = arrivalTimeCal.get(java.util.Calendar.HOUR_OF_DAY);
        arrivalTimeMinute = arrivalTimeCal.get(java.util.Calendar.MINUTE);
    }
    if (departureTime != null) {
        java.util.Calendar departureTimeCal = java.util.Calendar.getInstance();
        departureTimeCal.setTime(departureTime);
        departureTimeHour = departureTimeCal.get(java.util.Calendar.HOUR_OF_DAY);
        departureTimeMinute = departureTimeCal.get(java.util.Calendar.MINUTE);
    }
}
项目:Transitdatafeeder    文件Trip.java   
@PostLoad
public void splitTripStartTime() {
    if (tripStartTime != null) {
        java.util.Calendar startTimeCal = getStartTimeCalendar();
        startTimeHour = startTimeCal.get(java.util.Calendar.HOUR_OF_DAY);
        startTimeMinute = startTimeCal.get(java.util.Calendar.MINUTE);
    }
}

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。