Package org.hibernate.annotations

Examples of org.hibernate.annotations.OptimisticLockType


      polymorphism = PolymorphismType.valueOf( hibernateEntityAnnotation.value( "polymorphism" ).asEnum() );
    }
    isExplicitPolymorphism = polymorphism == PolymorphismType.EXPLICIT;

    // see HHH-6401
    OptimisticLockType optimisticLockType = OptimisticLockType.VERSION;
    if ( hibernateEntityAnnotation != null && hibernateEntityAnnotation.value( "optimisticLock" ) != null ) {
      optimisticLockType = OptimisticLockType.valueOf(
          hibernateEntityAnnotation.value( "optimisticLock" )
              .asEnum()
      );
    }
    optimisticLockStyle = OptimisticLockStyle.valueOf( optimisticLockType.name() );

    final AnnotationInstance hibernateImmutableAnnotation = JandexHelper.getSingleAnnotation(
        getClassInfo(), HibernateDotNames.IMMUTABLE
    );
    isMutable = hibernateImmutableAnnotation == null
View Full Code Here


      polymorphism = PolymorphismType.valueOf( hibernateEntityAnnotation.value( "polymorphism" ).asEnum() );
    }
    isExplicitPolymorphism = polymorphism == PolymorphismType.EXPLICIT;

    // see HHH-6401
    OptimisticLockType optimisticLockType = OptimisticLockType.VERSION;
    if ( hibernateEntityAnnotation != null && hibernateEntityAnnotation.value( "optimisticLock" ) != null ) {
      optimisticLockType = OptimisticLockType.valueOf(
          hibernateEntityAnnotation.value( "optimisticLock" )
              .asEnum()
      );
    }
    optimisticLockStyle = OptimisticLockStyle.valueOf( optimisticLockType.name() );

    final AnnotationInstance hibernateImmutableAnnotation = JandexHelper.getSingleAnnotation(
        getClassInfo(), HibernateDotNames.IMMUTABLE
    );
    isMutable = hibernateImmutableAnnotation == null
View Full Code Here

      polymorphism = PolymorphismType.valueOf( hibernateEntityAnnotation.value( "polymorphism" ).asEnum() );
    }
    isExplicitPolymorphism = polymorphism == PolymorphismType.EXPLICIT;

    // see HHH-6401
    OptimisticLockType optimisticLockType = OptimisticLockType.VERSION;
    if ( hibernateEntityAnnotation != null && hibernateEntityAnnotation.value( "optimisticLock" ) != null ) {
      optimisticLockType = OptimisticLockType.valueOf(
          hibernateEntityAnnotation.value( "optimisticLock" )
              .asEnum()
      );
    }
    optimisticLockStyle = OptimisticLockStyle.valueOf( optimisticLockType.name() );

    final AnnotationInstance hibernateImmutableAnnotation = JandexHelper.getSingleAnnotation(
        getClassInfo(), HibernateDotNames.IMMUTABLE
    );
    isMutable = hibernateImmutableAnnotation == null
View Full Code Here

    boolean mutable = true;
    boolean dynamicInsert = false;
    boolean dynamicUpdate = false;
    boolean selectBeforeUpdate = false;
    PolymorphismType polymorphism = PolymorphismType.IMPLICIT;
    OptimisticLockType optimisticLock = OptimisticLockType.VERSION;

    AnnotationInstance hibernateEntityAnnotation = JandexHelper.getSingleAnnotation(
        entityClass.getClassInfo(), HibernateDotNames.ENTITY
    );
View Full Code Here

      polymorphism = PolymorphismType.valueOf( hibernateEntityAnnotation.value( "polymorphism" ).asEnum() );
    }
    isExplicitPolymorphism = polymorphism == PolymorphismType.EXPLICIT;

    // see HHH-6401
    OptimisticLockType optimisticLockType = OptimisticLockType.VERSION;
    if ( hibernateEntityAnnotation != null && hibernateEntityAnnotation.value( "optimisticLock" ) != null ) {
      optimisticLockType = OptimisticLockType.valueOf(
          hibernateEntityAnnotation.value( "optimisticLock" )
              .asEnum()
      );
    }
    optimisticLockStyle = OptimisticLockStyle.valueOf( optimisticLockType.name() );

    final AnnotationInstance hibernateImmutableAnnotation = JandexHelper.getSingleAnnotation(
        getClassInfo(), HibernateDotNames.IMMUTABLE
    );
    isMutable = hibernateImmutableAnnotation == null
View Full Code Here

    boolean mutable = true;
    boolean dynamicInsert = false;
    boolean dynamicUpdate = false;
    boolean selectBeforeUpdate = false;
    PolymorphismType polymorphism = PolymorphismType.IMPLICIT;
    OptimisticLockType optimisticLock = OptimisticLockType.VERSION;

    AnnotationInstance hibernateEntityAnnotation = JandexHelper.getSingleAnnotation(
        configuredClass.getClassInfo(), HibernateDotNames.ENTITY
    );
View Full Code Here

    boolean mutable = true;
    boolean dynamicInsert = false;
    boolean dynamicUpdate = false;
    boolean selectBeforeUpdate = false;
    PolymorphismType polymorphism = PolymorphismType.IMPLICIT;
    OptimisticLockType optimisticLock = OptimisticLockType.VERSION;

    AnnotationInstance hibernateEntityAnnotation = JandexHelper.getSingleAnnotation(
        configuredClass.getClassInfo(), HibernateDotNames.ENTITY
    );

    if ( hibernateEntityAnnotation != null ) {
      if ( hibernateEntityAnnotation.value( "mutable" ) != null ) {
        mutable = hibernateEntityAnnotation.value( "mutable" ).asBoolean();
      }

      if ( hibernateEntityAnnotation.value( "dynamicInsert" ) != null ) {
        dynamicInsert = hibernateEntityAnnotation.value( "dynamicInsert" ).asBoolean();
      }

      if ( hibernateEntityAnnotation.value( "dynamicUpdate" ) != null ) {
        dynamicUpdate = hibernateEntityAnnotation.value( "dynamicUpdate" ).asBoolean();
      }

      if ( hibernateEntityAnnotation.value( "selectBeforeUpdate" ) != null ) {
        selectBeforeUpdate = hibernateEntityAnnotation.value( "selectBeforeUpdate" ).asBoolean();
      }

      if ( hibernateEntityAnnotation.value( "polymorphism" ) != null ) {
        polymorphism = PolymorphismType.valueOf( hibernateEntityAnnotation.value( "polymorphism" ).asEnum() );
      }

      if ( hibernateEntityAnnotation.value( "optimisticLock" ) != null ) {
        optimisticLock = OptimisticLockType.valueOf(
            hibernateEntityAnnotation.value( "optimisticLock" ).asEnum()
        );
      }

      if ( hibernateEntityAnnotation.value( "persister" ) != null ) {
        String persister = ( hibernateEntityAnnotation.value( "persister" ).toString() );
        ClassLoaderService classLoaderService = meta.getServiceRegistry()
            .getService( ClassLoaderService.class );
        Class<?> persisterClass = classLoaderService.classForName( persister );
        entityBinding.setEntityPersisterClass( persisterClass );
      }
    }

    // also check for the immutable annotation
    AnnotationInstance immutableAnnotation = JandexHelper.getSingleAnnotation(
        configuredClass.getClassInfo(), HibernateDotNames.IMMUTABLE
    );
    if ( immutableAnnotation != null ) {
      mutable = false;
    }

    entityBinding.setMutable( mutable );
    entityBinding.setDynamicInsert( dynamicInsert );
    entityBinding.setDynamicUpdate( dynamicUpdate );
    entityBinding.setSelectBeforeUpdate( selectBeforeUpdate );
    entityBinding.setExplicitPolymorphism( PolymorphismType.EXPLICIT.equals( polymorphism ) );
    entityBinding.setOptimisticLockMode( optimisticLock.ordinal() );
  }
View Full Code Here

TOP

Related Classes of org.hibernate.annotations.OptimisticLockType

Copyright © 2018 www.massapicom. 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.