Package info.archinnov.achilles.internal.metadata.parsing.context

Examples of info.archinnov.achilles.internal.metadata.parsing.context.EntityParsingContext


    public ParsingResult buildMetaDatas(ConfigurationContext configContext, List<Class<?>> entities) {
        log.debug("Build meta data for candidate entities");
        Map<Class<?>, EntityMeta> entityMetaMap = new HashMap<>();
        boolean hasSimpleCounter = false;
        for (Class<?> entityClass : entities) {
            EntityParsingContext context = new EntityParsingContext(configContext, entityClass);
            EntityMeta entityMeta = entityParser.parseEntity(context);
            entityMetaMap.put(entityClass, entityMeta);

            hasSimpleCounter = hasSimpleCounter || (context.hasSimpleCounter() && !entityMeta.structure().isClusteredCounter());
            boolean shouldValidateBean = configContext.isClassConstrained(entityClass);
            if (shouldValidateBean) {
                configContext.addBeanValidationInterceptor(entityMeta);
            }
        }
View Full Code Here


        assertThat(meta.config().isSchemaUpdateEnabled()).isTrue();
    }

    private <T> void initEntityParsingContext(Class<T> entityClass) {
        entityContext = new EntityParsingContext(configContext, entityClass);
    }
View Full Code Here

            public void setCounter(Counter counter) {
                this.counter = counter;
            }
        }
        entityContext = new EntityParsingContext(configContext, Test.class);
        entityContext.setCurrentConsistencyLevels(Pair.create(TWO, THREE));
        PropertyParsingContext context = entityContext.newPropertyContext(Test.class.getDeclaredField("counter"));

        PropertyMeta meta = parser.parse(context);
View Full Code Here

                this.counter = counter;
            }
        }
        expectedEx.expect(AchillesBeanMappingException.class);
        expectedEx.expectMessage("Counter field 'counter' of entity 'null' cannot have ANY as read/write consistency level. All consistency levels except ANY are allowed");
        entityContext = new EntityParsingContext(configContext, Test.class);
        entityContext.setCurrentConsistencyLevels(Pair.create(TWO, THREE));
        PropertyParsingContext context = entityContext.newPropertyContext(Test.class.getDeclaredField("counter"));
        parser.parse(context);
    }
View Full Code Here

            }
        }

        expectedEx.expect(AchillesBeanMappingException.class);
        expectedEx.expectMessage("Counter field 'counter' of entity 'null' cannot have ANY as read/write consistency level. All consistency levels except ANY are allowed");
        entityContext = new EntityParsingContext(configContext, Test.class);
        entityContext.setCurrentConsistencyLevels(Pair.create(TWO, THREE));
        PropertyParsingContext context = entityContext.newPropertyContext(Test.class.getDeclaredField("counter"));
        parser.parse(context);
    }
View Full Code Here

            return null;
        }
    };

    private <T> PropertyParsingContext newContext(Class<T> entityClass, Field field) {
        entityContext = new EntityParsingContext(configContext, entityClass);

        return entityContext.newPropertyContext(field);
    }
View Full Code Here

TOP

Related Classes of info.archinnov.achilles.internal.metadata.parsing.context.EntityParsingContext

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.