Package javax.persistence

Examples of javax.persistence.GeneratedValue


      //guess if its a component and find id data access (property, field etc)
      final boolean isComponent = returnedClass.isAnnotationPresent( Embeddable.class )
          || property.isAnnotationPresent( EmbeddedId.class );
      AccessType propertyAccessor = entityBinder.getPropertyAccessor( returnedClass );

      GeneratedValue generatedValue = property.getAnnotation( GeneratedValue.class );
      String generatorType = generatedValue != null ?
          generatorType( generatedValue.strategy() ) :
          "assigned";
      String generator = generatedValue != null ?
          generatedValue.generator() :
          BinderHelper.ANNOTATION_STRING_DEFAULT;
      if ( isComponent ) generatorType = "assigned"; //a component must not have any generator

      bindId(
          generatorType,
View Full Code Here


      Column col = getAnnotation(objectType, parameterName, Column.class);
      if (col != null && ! isNullOrEmpty(col.name()))
        sn = col.name();
      Id id = getAnnotation(objectType, parameterName, Id.class);
      Version version = getAnnotation(objectType, parameterName, Version.class);
      GeneratedValue generated = getAnnotation(objectType, parameterName, GeneratedValue.class);
      Enumerated enumerated = getAnnotation(objectType, parameterName, Enumerated.class);
     
      boolean idFlag = id != null;
      boolean versionFlag = version != null;
      boolean generatedFlag = generated != null;
View Full Code Here

    //manage composite related metadata
    //guess if its a component and find id data access (property, field etc)
    final boolean isComponent = returnedClass.isAnnotationPresent( Embeddable.class )
        || property.isAnnotationPresent( EmbeddedId.class );

    GeneratedValue generatedValue = property.getAnnotation( GeneratedValue.class );
    String generatorType = generatedValue != null ?
        generatorType( generatedValue.strategy(), mappings ) :
        "assigned";
    String generatorName = generatedValue != null ?
        generatedValue.generator() :
        BinderHelper.ANNOTATION_STRING_DEFAULT;
    if ( isComponent ) {
      generatorType = "assigned";
    } //a component must not have any generator
    BinderHelper.makeIdGenerator( idValue, generatorType, generatorName, mappings, localGenerators );
View Full Code Here

          property.isAnnotationPresent( Id.class ) ) {
        //clone classGenerator and override with local values
        Map<String, IdGenerator> localGenerators = new HashMap<String, IdGenerator>();
        localGenerators.putAll( buildLocalGenerators( property, mappings ) );

        GeneratedValue generatedValue = property.getAnnotation( GeneratedValue.class );
        String generatorType = generatedValue != null ? generatorType(
            generatedValue.strategy(), mappings
        ) : "assigned";
        String generator = generatedValue != null ? generatedValue.generator() : BinderHelper.ANNOTATION_STRING_DEFAULT;

        BinderHelper.makeIdGenerator(
            ( SimpleValue ) comp.getProperty( property.getName() ).getValue(),
            generatorType,
            generator,
View Full Code Here

          || property.isAnnotationPresent( EmbeddedId.class );
      boolean propertyAnnotated = entityBinder.isPropertyAnnotated( returnedClass );
      String propertyAccessor = entityBinder.getPropertyAccessor( returnedClass );
      //if ( isComponent && embeddableAnn != null && embeddableAnn.access() == AccessType.FIELD ) propertyAccess = false;

      GeneratedValue generatedValue = property.getAnnotation( GeneratedValue.class );
      String generatorType = generatedValue != null ? generatorType( generatedValue.strategy() ) : "assigned";
      String generator = generatedValue != null ? generatedValue.generator() : BinderHelper.ANNOTATION_STRING_DEFAULT;
      if ( isComponent ) generatorType = "assigned"; //a component must not have any generator
      Type typeAnn = property.getAnnotation( Type.class );
      bindId(
          generatorType,
          generator,
View Full Code Here

          || property.isAnnotationPresent( EmbeddedId.class );
      boolean propertyAnnotated = entityBinder.isPropertyAnnotated( returnedClass );
      String propertyAccessor = entityBinder.getPropertyAccessor( returnedClass );
      //if ( isComponent && embeddableAnn != null && embeddableAnn.access() == AccessType.FIELD ) propertyAccess = false;

      GeneratedValue generatedValue = property.getAnnotation( GeneratedValue.class );
      String generatorType = generatedValue != null ? generatorType( generatedValue.strategy() ) : "assigned";
      String generator = generatedValue != null ? generatedValue.generator() : BinderHelper.ANNOTATION_STRING_DEFAULT;
      if ( isComponent ) generatorType = "assigned"; //a component must not have any generator
      Type typeAnn = property.getAnnotation( Type.class );
      bindId(
          generatorType,
          generator,
View Full Code Here

    //manage composite related metadata
    //guess if its a component and find id data access (property, field etc)
    final boolean isComponent = returnedClass.isAnnotationPresent( Embeddable.class )
        || property.isAnnotationPresent( EmbeddedId.class );

    GeneratedValue generatedValue = property.getAnnotation( GeneratedValue.class );
    String generatorType = generatedValue != null ?
        generatorType( generatedValue.strategy(), mappings ) :
        "assigned";
    String generatorName = generatedValue != null ?
        generatedValue.generator() :
        BinderHelper.ANNOTATION_STRING_DEFAULT;
    if ( isComponent ) {
      generatorType = "assigned";
    } //a component must not have any generator
    BinderHelper.makeIdGenerator( idValue, generatorType, generatorName, mappings, localGenerators );
View Full Code Here

          property.isAnnotationPresent( Id.class ) ) {
        //clone classGenerator and override with local values
        Map<String, IdGenerator> localGenerators = new HashMap<String, IdGenerator>();
        localGenerators.putAll( buildLocalGenerators( property, mappings ) );

        GeneratedValue generatedValue = property.getAnnotation( GeneratedValue.class );
        String generatorType = generatedValue != null ? generatorType(
            generatedValue.strategy(), mappings
        ) : "assigned";
        String generator = generatedValue != null ? generatedValue.generator() : BinderHelper.ANNOTATION_STRING_DEFAULT;

        BinderHelper.makeIdGenerator(
            ( SimpleValue ) comp.getProperty( property.getName() ).getValue(),
            generatorType,
            generator,
View Full Code Here

    //manage composite related metadata
    //guess if its a component and find id data access (property, field etc)
    final boolean isComponent = returnedClass.isAnnotationPresent( Embeddable.class )
        || property.isAnnotationPresent( EmbeddedId.class );

    GeneratedValue generatedValue = property.getAnnotation( GeneratedValue.class );
    String generatorType = generatedValue != null ?
        generatorType( generatedValue.strategy(), mappings ) :
        "assigned";
    String generatorName = generatedValue != null ?
        generatedValue.generator() :
        BinderHelper.ANNOTATION_STRING_DEFAULT;
    if ( isComponent ) {
      generatorType = "assigned";
    } //a component must not have any generator
    BinderHelper.makeIdGenerator( idValue, generatorType, generatorName, mappings, localGenerators );
View Full Code Here

          property.isAnnotationPresent( Id.class ) ) {
        //clone classGenerator and override with local values
        Map<String, IdGenerator> localGenerators = new HashMap<String, IdGenerator>();
        localGenerators.putAll( buildLocalGenerators( property, mappings ) );

        GeneratedValue generatedValue = property.getAnnotation( GeneratedValue.class );
        String generatorType = generatedValue != null ? generatorType(
            generatedValue.strategy(), mappings
        ) : "assigned";
        String generator = generatedValue != null ? generatedValue.generator() : BinderHelper.ANNOTATION_STRING_DEFAULT;

        BinderHelper.makeIdGenerator(
            ( SimpleValue ) comp.getProperty( property.getName() ).getValue(),
            generatorType,
            generator,
View Full Code Here

TOP

Related Classes of javax.persistence.GeneratedValue

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.