Package org.hibernate.collection

Examples of org.hibernate.collection.PersistentCollection.wasInitialized()


            TypeSerializer typeSer)
        throws IOException, JsonProcessingException
    {
        if (value instanceof PersistentCollection) {
            PersistentCollection coll = (PersistentCollection) value;
            if (!_forceLazyLoading && !coll.wasInitialized()) {
                provider.defaultSerializeNull(jgen);
                return;
            }
            value = coll.getValue();
            if (value == null) {
View Full Code Here


    final LoadingCollectionEntry loadingCollectionEntry = loadContexts.locateLoadingCollectionEntry( collectionKey );
    if ( loadingCollectionEntry == null ) {
      // look for existing collection as part of the persistence context
      PersistentCollection collection = loadContexts.getPersistenceContext().getCollection( collectionKey );
      if ( collection != null ) {
        if ( collection.wasInitialized() ) {
          log.trace( "collection already initialized; ignoring" );
          return null; // ignore this row of results! Note the early exit
        }
        else {
          // initialize this collection
View Full Code Here

    final LoadingCollectionEntry loadingCollectionEntry = loadContexts.locateLoadingCollectionEntry( collectionKey );
    if ( loadingCollectionEntry == null ) {
      // look for existing collection as part of the persistence context
      PersistentCollection collection = loadContexts.getPersistenceContext().getCollection( collectionKey );
      if ( collection != null ) {
        if ( collection.wasInitialized() ) {
          log.trace( "collection already initialized; ignoring" );
          return null; // ignore this row of results! Note the early exit
        }
        else {
          // initialize this collection
View Full Code Here

    LoadingCollectionEntry lce = getLoadingCollectionEntry(ckey);
    if ( lce == null ) {
      //look for existing collection
      PersistentCollection collection = context.getCollection(ckey);
      if ( collection != null ) {
        if ( collection.wasInitialized() ) {
          log.trace( "collection already initialized: ignoring" );
          return null; //ignore this row of results! Note the early exit
        }
        else {
          //initialize this collection
View Full Code Here

    if (isUpdate) removeCollection(persister, key, session);
    if ( collection!=null && (collection instanceof PersistentCollection) ) {
      PersistentCollection wrapper = (PersistentCollection) collection;
      wrapper.setCurrentSession(session);
      if ( wrapper.wasInitialized() ) {
        session.getPersistenceContext().addNewCollection(persister, wrapper);
      }
      else {
        reattachCollection( wrapper, type );
      }
View Full Code Here

    final LoadingCollectionEntry loadingCollectionEntry = locateLoadingCollectionEntry( collectionKey );
    if ( loadingCollectionEntry == null ) {
      // look for existing collection as part of the persistence context
      PersistentCollection collection = loadContexts.getPersistenceContext().getCollection( collectionKey );
      if ( collection != null ) {
        if ( collection.wasInitialized() ) {
          log.trace( "collection already initialized; ignoring" );
          return null; // ignore this row of results! Note the early exit
        }
        else {
          // initialize this collection
View Full Code Here

        throws IOException, JsonProcessingException
    {
        if (value instanceof PersistentCollection) {
            PersistentCollection coll = (PersistentCollection) value;
            // If lazy-loaded, not yet loaded, may serialize as null?
            if (!_forceLazyLoading && !coll.wasInitialized()) {
                provider.defaultSerializeNull(jgen);
                return;
            }
            value = coll.getValue();
            if (value == null) {
View Full Code Here

            TypeSerializer typeSer)
        throws IOException, JsonProcessingException
    {
        if (value instanceof PersistentCollection) {
            PersistentCollection coll = (PersistentCollection) value;
            if (!_forceLazyLoading && !coll.wasInitialized()) {
                provider.defaultSerializeNull(jgen);
                return;
            }
            value = coll.getValue();
            if (value == null) {
View Full Code Here

        return;
      }
      PersistentCollection persistentCollection = event.getCollection();
      final String collectionRole;
      if ( persistentCollection != null ) {
        if ( ! persistentCollection.wasInitialized() ) {
          // non-initialized collections will still trigger events, but we want to skip them
          // as they won't contain new values affecting the index state
          return;
        }
        collectionRole = persistentCollection.getRole();
View Full Code Here

        throws IOException, JsonProcessingException
    {
        if (value instanceof PersistentCollection) {
            PersistentCollection coll = (PersistentCollection) value;
            // If lazy-loaded, not yet loaded, may serialize as null?
            if (!_forceLazyLoading && !coll.wasInitialized()) {
                provider.defaultSerializeNull(jgen);
                return;
            }
            value = coll.getValue();
            if (value == null) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.