Package javax.persistence

Examples of javax.persistence.GeneratedValue.generator()


            String schemaName = table.schema();
            if (schemaName != null && schemaName.indexOf('@') > 0)
            {
                schemaName = schemaName.substring(0, schemaName.indexOf('@'));
                GeneratedValue generatedValue = field.getAnnotation(GeneratedValue.class);
                if (generatedValue != null && generatedValue.generator() != null
                        && !generatedValue.generator().isEmpty())
                {
                    if (!(field.isAnnotationPresent(TableGenerator.class)
                            || field.isAnnotationPresent(SequenceGenerator.class)
                            || clazz.isAnnotationPresent(TableGenerator.class) || clazz
View Full Code Here


            if (schemaName != null && schemaName.indexOf('@') > 0)
            {
                schemaName = schemaName.substring(0, schemaName.indexOf('@'));
                GeneratedValue generatedValue = field.getAnnotation(GeneratedValue.class);
                if (generatedValue != null && generatedValue.generator() != null
                        && !generatedValue.generator().isEmpty())
                {
                    if (!(field.isAnnotationPresent(TableGenerator.class)
                            || field.isAnnotationPresent(SequenceGenerator.class)
                            || clazz.isAnnotationPresent(TableGenerator.class) || clazz
                                .isAnnotationPresent(SequenceGenerator.class)))
View Full Code Here

                    if (!(field.isAnnotationPresent(TableGenerator.class)
                            || field.isAnnotationPresent(SequenceGenerator.class)
                            || clazz.isAnnotationPresent(TableGenerator.class) || clazz
                                .isAnnotationPresent(SequenceGenerator.class)))
                    {
                        log.error("Unknown Id.generator{}: for class{}", generatedValue.generator(), clazz);
                        throw new IllegalArgumentException("Unknown Id.generator: " + generatedValue.generator());
                    }
                    else
                    {
                        checkForGenerator(clazz, field, generatedValue, schemaName);
View Full Code Here

                            || field.isAnnotationPresent(SequenceGenerator.class)
                            || clazz.isAnnotationPresent(TableGenerator.class) || clazz
                                .isAnnotationPresent(SequenceGenerator.class)))
                    {
                        log.error("Unknown Id.generator{}: for class{}", generatedValue.generator(), clazz);
                        throw new IllegalArgumentException("Unknown Id.generator: " + generatedValue.generator());
                    }
                    else
                    {
                        checkForGenerator(clazz, field, generatedValue, schemaName);
                    }
View Full Code Here

            Map<String, IdDiscriptor> entityNameToKeyDiscriptorMap)
    {
        IdDiscriptor keyValue = new IdDiscriptor();

        GeneratedValue value = idField.getAnnotation(GeneratedValue.class);
        String generatorName = value.generator();
        GenerationType generationType = value.strategy();

        switch (generationType)
        {
        case TABLE:
View Full Code Here

    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 );

    log.trace(
View Full Code Here

         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, mappings, localGenerators);
      }

    }
View Full Code Here

    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

        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
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.