├── .gitignore ├── CONTRIBUTING.md ├── LICENSE.md ├── README.md ├── artemis-column ├── .gitignore ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── jnosql │ │ │ └── artemis │ │ │ └── column │ │ │ ├── AbstractColumnEntityConverter.java │ │ │ ├── AbstractColumnTemplate.java │ │ │ ├── AbstractColumnTemplateAsync.java │ │ │ ├── AbstractColumnWorkflow.java │ │ │ ├── ColumnDeleteQueryExecute.java │ │ │ ├── ColumnEntityConverter.java │ │ │ ├── ColumnEntityPostPersist.java │ │ │ ├── ColumnEntityPrePersist.java │ │ │ ├── ColumnEventPersistManager.java │ │ │ ├── ColumnFieldConverter.java │ │ │ ├── ColumnFieldConverters.java │ │ │ ├── ColumnFieldValue.java │ │ │ ├── ColumnMapperObserver.java │ │ │ ├── ColumnPreparedStatement.java │ │ │ ├── ColumnPreparedStatementAsync.java │ │ │ ├── ColumnQueryExecute.java │ │ │ ├── ColumnRepositoryAsyncProducer.java │ │ │ ├── ColumnRepositoryAsyncSupplier.java │ │ │ ├── ColumnRepositoryProducer.java │ │ │ ├── ColumnRepositorySupplier.java │ │ │ ├── ColumnTemplate.java │ │ │ ├── ColumnTemplateAsync.java │ │ │ ├── ColumnTemplateAsyncProducer.java │ │ │ ├── ColumnTemplateProducer.java │ │ │ ├── ColumnWorkflow.java │ │ │ ├── DefaultColumnDeleteQueryExecute.java │ │ │ ├── DefaultColumnEntityConverter.java │ │ │ ├── DefaultColumnEntityPostPersist.java │ │ │ ├── DefaultColumnEntityPrePersist.java │ │ │ ├── DefaultColumnEventPersistManager.java │ │ │ ├── DefaultColumnFieldValue.java │ │ │ ├── DefaultColumnQueryExecute.java │ │ │ ├── DefaultColumnTemplate.java │ │ │ ├── DefaultColumnTemplateAsync.java │ │ │ ├── DefaultColumnTemplateAsyncProducer.java │ │ │ ├── DefaultColumnTemplateProducer.java │ │ │ ├── DefaultColumnWorkflow.java │ │ │ ├── DefaultEntityColumnPostPersist.java │ │ │ ├── DefaultEntityColumnPrePersist.java │ │ │ ├── EntityColumnPostPersist.java │ │ │ ├── EntityColumnPrePersist.java │ │ │ ├── package-info.java │ │ │ ├── query │ │ │ ├── AbstractColumnRepository.java │ │ │ ├── AbstractColumnRepositoryAsync.java │ │ │ ├── AbstractColumnRepositoryAsyncProxy.java │ │ │ ├── AbstractColumnRepositoryProxy.java │ │ │ ├── AbstractMapperQuery.java │ │ │ ├── ArtemisColumnDeleteQuery.java │ │ │ ├── ArtemisColumnQuery.java │ │ │ ├── BaseColumnRepository.java │ │ │ ├── ColumnMapperDeleteFrom.java │ │ │ ├── ColumnMapperDeleteNameCondition.java │ │ │ ├── ColumnMapperDeleteNotCondition.java │ │ │ ├── ColumnMapperDeleteQueryBuild.java │ │ │ ├── ColumnMapperDeleteWhere.java │ │ │ ├── ColumnMapperFrom.java │ │ │ ├── ColumnMapperLimit.java │ │ │ ├── ColumnMapperNameCondition.java │ │ │ ├── ColumnMapperNameOrder.java │ │ │ ├── ColumnMapperNotCondition.java │ │ │ ├── ColumnMapperOrder.java │ │ │ ├── ColumnMapperQueryBuild.java │ │ │ ├── ColumnMapperSkip.java │ │ │ ├── ColumnMapperWhere.java │ │ │ ├── ColumnQueryMapperBuilder.java │ │ │ ├── ColumnRepositoryAsyncProxy.java │ │ │ ├── ColumnRepositoryProxy.java │ │ │ ├── ColumnTokenProcessor.java │ │ │ ├── DefaultColumnMapperDeleteBuilder.java │ │ │ ├── DefaultColumnMapperSelectBuilder.java │ │ │ ├── DefaultColumnQueryMapperBuilder.java │ │ │ ├── DefaultColumnRepositoryAsyncProducer.java │ │ │ ├── DefaultColumnRepositoryProducer.java │ │ │ ├── RepositoryAsyncColumnBean.java │ │ │ ├── RepositoryColumnBean.java │ │ │ ├── RepositoryColumnObserverParser.java │ │ │ ├── ReturnTypeConverterUtil.java │ │ │ └── package-info.java │ │ │ └── spi │ │ │ ├── ColumnFamilyManagerConfigurationProducer.java │ │ │ ├── ColumnFamilyProducerExtension.java │ │ │ ├── ColumnRepositoryConfigurationProducer.java │ │ │ ├── ColumnTemplateAsyncBean.java │ │ │ ├── ColumnTemplateBean.java │ │ │ └── ColumnTemplateConfigurationProducer.java │ └── resources │ │ └── META-INF │ │ ├── beans.xml │ │ └── services │ │ └── javax.enterprise.inject.spi.Extension │ └── test │ ├── java │ └── org │ │ └── jnosql │ │ └── artemis │ │ ├── CDIExtension.java │ │ ├── DatabaseQualifierTest.java │ │ ├── IgnoreRepository.java │ │ ├── IgnoreRepositoryAsync.java │ │ ├── MockProducer.java │ │ ├── PersonIgnoreRepository.java │ │ ├── PersonRepository.java │ │ ├── PersonRepositoryAsync.java │ │ ├── UserRepository.java │ │ ├── column │ │ ├── ColumnEntityPostPersistTest.java │ │ ├── ColumnEntityPrePersistTest.java │ │ ├── ColumnFamilyManagerConfigurationProducerTest.java │ │ ├── ColumnFamilyManagerConfigurationProducerXMLTest.java │ │ ├── ColumnFamilyManagerMock.java │ │ ├── ColumnRepositoryConfigurationTest.java │ │ ├── ColumnTemplateConfigurationProducer.java │ │ ├── DefaultColumnEntityConverterTest.java │ │ ├── DefaultColumnEventPersistManagerTest.java │ │ ├── DefaultColumnTemplateAsyncProducerTest.java │ │ ├── DefaultColumnTemplateAsyncTest.java │ │ ├── DefaultColumnTemplateProducerTest.java │ │ ├── DefaultColumnTemplateTest.java │ │ ├── DefaultColumnWorkflowTest.java │ │ ├── RepositoryService.java │ │ ├── query │ │ │ ├── ColumnRepositoryAsyncProxyTest.java │ │ │ ├── ColumnRepositoryExtensionTest.java │ │ │ ├── ColumnRepositoryProxyTest.java │ │ │ ├── DefaultColumnMapperDeleteBuilderTest.java │ │ │ ├── DefaultColumnMapperSelectBuilderTest.java │ │ │ ├── DefaultColumnQueryMapperBuilderTest.java │ │ │ ├── DefaultColumnRepositoryAsyncProducerTest.java │ │ │ ├── DefaultColumnRepositoryProducerTest.java │ │ │ └── ParamsBinderTest.java │ │ └── spi │ │ │ └── ColumnFamilyProducerExtensionTest.java │ │ └── model │ │ ├── Actor.java │ │ ├── ActorBuilder.java │ │ ├── Address.java │ │ ├── Animal.java │ │ ├── AppointmentBook.java │ │ ├── Contact.java │ │ ├── ContactType.java │ │ ├── Director.java │ │ ├── Job.java │ │ ├── Machine.java │ │ ├── Money.java │ │ ├── MoneyConverter.java │ │ ├── Movie.java │ │ ├── Person.java │ │ ├── PersonBuilder.java │ │ ├── User.java │ │ ├── Worker.java │ │ └── Zipcode.java │ └── resources │ └── META-INF │ ├── beans.xml │ ├── column.json │ ├── column.xml │ └── services │ └── javax.enterprise.inject.spi.Extension ├── artemis-configuration ├── .gitignore ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── jnosql │ │ │ └── artemis │ │ │ └── configuration │ │ │ ├── Configurable.java │ │ │ ├── ConfigurableImpl.java │ │ │ ├── ConfigurableReader.java │ │ │ ├── ConfigurationException.java │ │ │ ├── DefaultConfigurationReader.java │ │ │ ├── DefaultConfigurationSettingsUnit.java │ │ │ ├── NamedLiteral.java │ │ │ ├── json │ │ │ └── ConfigurableReaderJSON.java │ │ │ ├── package-info.java │ │ │ ├── xml │ │ │ ├── ConfigurableReaderXML.java │ │ │ └── ConfigurablesXML.java │ │ │ └── yaml │ │ │ ├── ConfigurableReaderYAML.java │ │ │ └── ConfigurablesYAML.java │ └── resources │ │ └── META-INF │ │ └── beans.xml │ └── test │ ├── java │ └── org │ │ └── jnosql │ │ └── artemis │ │ ├── CDIExtension.java │ │ ├── DatabaseQualifierTest.java │ │ └── configuration │ │ ├── DefaultConfigurationReaderTest.java │ │ ├── DefaultJSONConfigurationreaderTest.java │ │ ├── DefaultMockConfiguration.java │ │ ├── DefaultXMLConfigurationReaderTest.java │ │ ├── DefaultYAMLConfigurationReaderTest.java │ │ ├── InvalidConfiguration.java │ │ └── MockConfiguration.java │ └── resources │ └── META-INF │ ├── beans.xml │ ├── column.json │ ├── column.xml │ ├── document.json │ ├── document.xml │ ├── invalid-class.json │ ├── invalid.json │ ├── invalid.xml │ ├── invalid.yaml │ ├── jnosql-2.json │ ├── jnosql.json │ ├── jnosql.xml │ ├── jnosql.yaml │ ├── key-value.json │ ├── key-value.xml │ └── services │ └── javax.enterprise.inject.spi.Extension ├── artemis-core ├── .gitignore ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── jnosql │ │ │ └── artemis │ │ │ ├── ArtemisException.java │ │ │ ├── AttributeConverter.java │ │ │ ├── Column.java │ │ │ ├── ConfigurationException.java │ │ │ ├── ConfigurationReader.java │ │ │ ├── ConfigurationSettingsUnit.java │ │ │ ├── ConfigurationUnit.java │ │ │ ├── Convert.java │ │ │ ├── Converters.java │ │ │ ├── Database.java │ │ │ ├── DatabaseMetadata.java │ │ │ ├── DatabaseQualifier.java │ │ │ ├── DatabaseType.java │ │ │ ├── Databases.java │ │ │ ├── DefaultConverters.java │ │ │ ├── DefaultEntityPostPersist.java │ │ │ ├── DefaultEntityPrePersist.java │ │ │ ├── DefaultPagination.java │ │ │ ├── DynamicQueryException.java │ │ │ ├── Embeddable.java │ │ │ ├── Entity.java │ │ │ ├── EntityNotFoundException.java │ │ │ ├── EntityPostPersit.java │ │ │ ├── EntityPrePersist.java │ │ │ ├── Id.java │ │ │ ├── IdNotFoundException.java │ │ │ ├── MappedSuperclass.java │ │ │ ├── Pagination.java │ │ │ ├── Param.java │ │ │ ├── PreparedStatement.java │ │ │ ├── PreparedStatementAsync.java │ │ │ ├── Query.java │ │ │ ├── Repository.java │ │ │ ├── RepositoryAsync.java │ │ │ ├── package-info.java │ │ │ ├── query │ │ │ └── RepositoryType.java │ │ │ ├── reflection │ │ │ ├── AbstractFieldMapping.java │ │ │ ├── ClassConverter.java │ │ │ ├── ClassInformationNotFoundException.java │ │ │ ├── ClassMapping.java │ │ │ ├── ClassMappingBuilder.java │ │ │ ├── ClassMappingExtension.java │ │ │ ├── ClassMappings.java │ │ │ ├── ClassOperation.java │ │ │ ├── ClassOperationFactory.java │ │ │ ├── ConstructorException.java │ │ │ ├── DefaultClassMapping.java │ │ │ ├── DefaultClassMappings.java │ │ │ ├── DefaultFieldMapping.java │ │ │ ├── DefaultFieldValue.java │ │ │ ├── DefaultReflections.java │ │ │ ├── EmbeddedFieldMapping.java │ │ │ ├── FieldMapping.java │ │ │ ├── FieldMappingBuilder.java │ │ │ ├── FieldReader.java │ │ │ ├── FieldReaderFactory.java │ │ │ ├── FieldType.java │ │ │ ├── FieldValue.java │ │ │ ├── FieldWriter.java │ │ │ ├── FieldWriterFactory.java │ │ │ ├── GeneratedJavaFileManager.java │ │ │ ├── GenericFieldMapping.java │ │ │ ├── InstanceSupplier.java │ │ │ ├── InstanceSupplierFactory.java │ │ │ ├── JavaCompiledStream.java │ │ │ ├── JavaCompilerClassLoader.java │ │ │ ├── JavaCompilerClassOperation.java │ │ │ ├── JavaCompilerFacade.java │ │ │ ├── JavaCompilerFieldReaderFactory.java │ │ │ ├── JavaCompilerFieldWriterFactory.java │ │ │ ├── JavaCompilerInstanceSupplierFactory.java │ │ │ ├── JavaFileObject.java │ │ │ ├── JavaSource.java │ │ │ ├── NativeMapping.java │ │ │ ├── ReflectionClassOperation.java │ │ │ ├── ReflectionFieldReaderFactory.java │ │ │ ├── ReflectionFieldWriterFactory.java │ │ │ ├── ReflectionInstanceSupplier.java │ │ │ ├── ReflectionInstanceSupplierFactory.java │ │ │ ├── Reflections.java │ │ │ ├── StringFormatter.java │ │ │ ├── TemplateReader.java │ │ │ └── package-info.java │ │ │ └── util │ │ │ ├── AnnotationLiteralUtil.java │ │ │ ├── ConfigurationUnitUtils.java │ │ │ ├── ConverterUtil.java │ │ │ ├── ParamsBinder.java │ │ │ └── StringUtils.java │ └── resources │ │ ├── FieldReader.tempalte │ │ ├── FieldWriter.template │ │ ├── InstanceSupplier.template │ │ └── META-INF │ │ ├── beans.xml │ │ └── services │ │ └── javax.enterprise.inject.spi.Extension │ └── test │ ├── java │ └── org │ │ └── jnosql │ │ └── artemis │ │ ├── CDIExtension.java │ │ ├── DatabaseMetadataTest.java │ │ ├── DatabaseQualifierTest.java │ │ ├── model │ │ ├── Actor.java │ │ ├── ActorBuilder.java │ │ ├── Address.java │ │ ├── Animal.java │ │ ├── AppointmentBook.java │ │ ├── Contact.java │ │ ├── ContactType.java │ │ ├── Director.java │ │ ├── Job.java │ │ ├── Machine.java │ │ ├── Money.java │ │ ├── MoneyConverter.java │ │ ├── Movie.java │ │ ├── Person.java │ │ ├── PersonBuilder.java │ │ ├── User.java │ │ ├── Worker.java │ │ └── Zipcode.java │ │ ├── reflection │ │ ├── ClassConverterJavaFieldParserTest.java │ │ ├── ClassConverterTest.java │ │ ├── Faa.java │ │ ├── FieldMappingTest.java │ │ ├── FieldTypeTest.java │ │ ├── Foo.java │ │ ├── JavaCompilerBeanPropertyReaderFactory.java │ │ ├── JavaCompilerFacadeTest.java │ │ ├── JavaCompilerFieldReaderFactoryTest.java │ │ ├── JavaCompilerFieldWriterFactoryTest.java │ │ ├── JavaCompilerInstanceSupplierFactoryTest.java │ │ ├── ReadFromGetterMethod.java │ │ ├── ReflectionFieldReaderFactoryTest.java │ │ ├── ReflectionFieldWriterFactoryTest.java │ │ ├── ReflectionInstanceSupplierFactoryTest.java │ │ └── ReflectionsTest.java │ │ └── util │ │ └── ConverterUtilTest.java │ └── resources │ └── META-INF │ ├── beans.xml │ ├── column.json │ ├── column.xml │ ├── document.json │ ├── document.xml │ ├── invalid-class.json │ ├── invalid.json │ ├── jnosql-2.json │ ├── jnosql.json │ ├── jnosql.xml │ ├── key-value.json │ ├── key-value.xml │ └── services │ └── javax.enterprise.inject.spi.Extension ├── artemis-document ├── .gitignore ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── jnosql │ │ │ └── artemis │ │ │ └── document │ │ │ ├── AbsctractDocumentWorkflow.java │ │ │ ├── AbstractDocumentEntityConverter.java │ │ │ ├── AbstractDocumentTemplate.java │ │ │ ├── AbstractDocumentTemplateAsync.java │ │ │ ├── DefaultDocumentDeleteQueryExecute.java │ │ │ ├── DefaultDocumentEntityConverter.java │ │ │ ├── DefaultDocumentEntityPostPersist.java │ │ │ ├── DefaultDocumentEntityPrePersist.java │ │ │ ├── DefaultDocumentEventPersistManager.java │ │ │ ├── DefaultDocumentFieldValue.java │ │ │ ├── DefaultDocumentQueryExecute.java │ │ │ ├── DefaultDocumentTemplate.java │ │ │ ├── DefaultDocumentTemplateAsync.java │ │ │ ├── DefaultDocumentTemplateAsyncProducer.java │ │ │ ├── DefaultDocumentTemplateProducer.java │ │ │ ├── DefaultDocumentWorkflow.java │ │ │ ├── DefaultEntityDocumentPostPersist.java │ │ │ ├── DefaultEntityDocumentPrePersist.java │ │ │ ├── DocumentDeleteQueryExecute.java │ │ │ ├── DocumentEntityConverter.java │ │ │ ├── DocumentEntityPostPersist.java │ │ │ ├── DocumentEntityPrePersist.java │ │ │ ├── DocumentEventPersistManager.java │ │ │ ├── DocumentFieldConverter.java │ │ │ ├── DocumentFieldConverters.java │ │ │ ├── DocumentFieldValue.java │ │ │ ├── DocumentMapperObserver.java │ │ │ ├── DocumentPreparedStatement.java │ │ │ ├── DocumentPreparedStatementAsync.java │ │ │ ├── DocumentQueryExecute.java │ │ │ ├── DocumentRepositoryAsyncProducer.java │ │ │ ├── DocumentRepositoryAsyncSupplier.java │ │ │ ├── DocumentRepositoryProducer.java │ │ │ ├── DocumentRepositorySupplier.java │ │ │ ├── DocumentTemplate.java │ │ │ ├── DocumentTemplateAsync.java │ │ │ ├── DocumentTemplateAsyncProducer.java │ │ │ ├── DocumentTemplateProducer.java │ │ │ ├── DocumentWorkflow.java │ │ │ ├── EntityDocumentPostPersist.java │ │ │ ├── EntityDocumentPrePersist.java │ │ │ ├── package-info.java │ │ │ ├── query │ │ │ ├── AbstractDocumentRepository.java │ │ │ ├── AbstractDocumentRepositoryAsync.java │ │ │ ├── AbstractDocumentRepositoryAsyncProxy.java │ │ │ ├── AbstractDocumentRepositoryProxy.java │ │ │ ├── AbstractMapperQuery.java │ │ │ ├── ArtemisDocumentDeleteQuery.java │ │ │ ├── ArtemisDocumentQuery.java │ │ │ ├── BaseDocumentRepository.java │ │ │ ├── DefaultDocumentMapperDeleteBuilder.java │ │ │ ├── DefaultDocumentMapperSelectBuilder.java │ │ │ ├── DefaultDocumentQueryMapperBuilder.java │ │ │ ├── DefaultDocumentRepositoryAsyncProducer.java │ │ │ ├── DefaultDocumentRepositoryProducer.java │ │ │ ├── DocumentMapperDeleteFrom.java │ │ │ ├── DocumentMapperDeleteNameCondition.java │ │ │ ├── DocumentMapperDeleteNotCondition.java │ │ │ ├── DocumentMapperDeleteQueryBuild.java │ │ │ ├── DocumentMapperDeleteWhere.java │ │ │ ├── DocumentMapperFrom.java │ │ │ ├── DocumentMapperLimit.java │ │ │ ├── DocumentMapperNameCondition.java │ │ │ ├── DocumentMapperNameOrder.java │ │ │ ├── DocumentMapperNotCondition.java │ │ │ ├── DocumentMapperOrder.java │ │ │ ├── DocumentMapperQueryBuild.java │ │ │ ├── DocumentMapperSkip.java │ │ │ ├── DocumentMapperWhere.java │ │ │ ├── DocumentQueryMapperBuilder.java │ │ │ ├── DocumentRepositoryAsyncBean.java │ │ │ ├── DocumentRepositoryAsyncProxy.java │ │ │ ├── DocumentRepositoryProxy.java │ │ │ ├── DocumentTokenProcessor.java │ │ │ ├── RepositoryDocumentBean.java │ │ │ ├── RepositoryDocumentObserverParser.java │ │ │ ├── ReturnTypeConverterUtil.java │ │ │ └── package-info.java │ │ │ └── spi │ │ │ ├── DocumentCollectionConfigurationProducer.java │ │ │ ├── DocumentCollectionProducerExtension.java │ │ │ ├── DocumentRepositoryConfigurationProducer.java │ │ │ ├── DocumentTemplateAsyncBean.java │ │ │ ├── DocumentTemplateBean.java │ │ │ └── DocumentTemplateConfigurationProducer.java │ └── resources │ │ └── META-INF │ │ ├── beans.xml │ │ └── services │ │ └── javax.enterprise.inject.spi.Extension │ └── test │ ├── java │ └── org │ │ └── jnosql │ │ └── artemis │ │ ├── CDIExtension.java │ │ ├── DatabaseQualifierTest.java │ │ ├── IgnoreRepository.java │ │ ├── IgnoreRepositoryAsync.java │ │ ├── MockProducer.java │ │ ├── PersonIgnoreRepository.java │ │ ├── PersonRepository.java │ │ ├── PersonRepositoryAsync.java │ │ ├── UserRepository.java │ │ ├── document │ │ ├── DefaultDocumentEntityConverterTest.java │ │ ├── DefaultDocumentEventPersistManagerTest.java │ │ ├── DefaultDocumentTemplateAsyncProducerTest.java │ │ ├── DefaultDocumentTemplateAsyncTest.java │ │ ├── DefaultDocumentTemplateProducerTest.java │ │ ├── DefaultDocumentTemplateTest.java │ │ ├── DefaultDocumentWorkflowTest.java │ │ ├── DocumentCollectionConfigurationProducerTest.java │ │ ├── DocumentCollectionConfigurationProducerXMLTest.java │ │ ├── DocumentCollectionManagerMock.java │ │ ├── DocumentEntityPostPersistTest.java │ │ ├── DocumentEntityPrePersistTest.java │ │ ├── DocumentRepositoryConfigurationTest.java │ │ ├── DocumentTemplateConfigurationProducer.java │ │ ├── RepositoryService.java │ │ └── query │ │ │ ├── DefaultDocumentMapperDeleteBuilderTest.java │ │ │ ├── DefaultDocumentMapperSelectBuilderTest.java │ │ │ ├── DefaultDocumentQueryMapperBuilderTest.java │ │ │ ├── DefaultDocumentRepositoryAsyncProducerTest.java │ │ │ ├── DefaultDocumentRepositoryProducerTest.java │ │ │ ├── DocumentRepositoryAsyncProxyTest.java │ │ │ ├── DocumentRepositoryExtensionTest.java │ │ │ ├── DocumentRepositoryProxyTest.java │ │ │ └── ParamsBinderTest.java │ │ └── model │ │ ├── Actor.java │ │ ├── ActorBuilder.java │ │ ├── Address.java │ │ ├── Animal.java │ │ ├── AppointmentBook.java │ │ ├── Contact.java │ │ ├── ContactType.java │ │ ├── Director.java │ │ ├── Job.java │ │ ├── Machine.java │ │ ├── Money.java │ │ ├── MoneyConverter.java │ │ ├── Movie.java │ │ ├── Person.java │ │ ├── PersonBuilder.java │ │ ├── User.java │ │ ├── Worker.java │ │ └── Zipcode.java │ └── resources │ └── META-INF │ ├── beans.xml │ ├── document.json │ ├── document.xml │ └── services │ └── javax.enterprise.inject.spi.Extension ├── artemis-graph ├── README.md ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── jnosql │ │ │ └── artemis │ │ │ └── graph │ │ │ ├── AbstractEdgeTraversal.java │ │ │ ├── AbstractGraphConverter.java │ │ │ ├── AbstractGraphTemplate.java │ │ │ ├── AbstractVertexTraversal.java │ │ │ ├── DefaultEdgeEntity.java │ │ │ ├── DefaultEdgeRepeatStepTraversal.java │ │ │ ├── DefaultEdgeRepeatTraversal.java │ │ │ ├── DefaultEdgeTraversal.java │ │ │ ├── DefaultEdgeTraversalOrder.java │ │ │ ├── DefaultEdgeUntilTraversal.java │ │ │ ├── DefaultEntityGraphPostPersist.java │ │ │ ├── DefaultEntityGraphPrePersist.java │ │ │ ├── DefaultGraphConverter.java │ │ │ ├── DefaultGraphEntityPostPersist.java │ │ │ ├── DefaultGraphEntityPrePersist.java │ │ │ ├── DefaultGraphEventPersistManager.java │ │ │ ├── DefaultGraphTemplate.java │ │ │ ├── DefaultGraphTemplateProducer.java │ │ │ ├── DefaultGraphTraversalSourceConverter.java │ │ │ ├── DefaultGraphTraversalSourceTemplate.java │ │ │ ├── DefaultGraphWorkflow.java │ │ │ ├── DefaultPreparedStatement.java │ │ │ ├── DefaultProperty.java │ │ │ ├── DefaultValueMapTraversal.java │ │ │ ├── DefaultVertexRepeatStepTraversal.java │ │ │ ├── DefaultVertexRepeatTraversal.java │ │ │ ├── DefaultVertexTraversal.java │ │ │ ├── DefaultVertexTraversalOrder.java │ │ │ ├── DefaultVertexUntilTraversal.java │ │ │ ├── EdgeConditionTraversal.java │ │ │ ├── EdgeEntity.java │ │ │ ├── EdgeRepeatStepTraversal.java │ │ │ ├── EdgeRepeatTraversal.java │ │ │ ├── EdgeTraversal.java │ │ │ ├── EdgeTraversalOrder.java │ │ │ ├── EdgeUntilTraversal.java │ │ │ ├── EntityGraphPostPersist.java │ │ │ ├── EntityGraphPrePersist.java │ │ │ ├── FieldGraph.java │ │ │ ├── GraphConverter.java │ │ │ ├── GraphEntityPostPersist.java │ │ │ ├── GraphEntityPrePersist.java │ │ │ ├── GraphEventPersistManager.java │ │ │ ├── GraphProducer.java │ │ │ ├── GraphRepositoryProducer.java │ │ │ ├── GraphRepositorySupplier.java │ │ │ ├── GraphTemplate.java │ │ │ ├── GraphTemplateProducer.java │ │ │ ├── GraphTraversalSourceOperation.java │ │ │ ├── GraphTraversalSourceSupplier.java │ │ │ ├── GraphWorkflow.java │ │ │ ├── GremlinExecutor.java │ │ │ ├── GremlinQueryException.java │ │ │ ├── Transactional.java │ │ │ ├── TransactionalInterceptor.java │ │ │ ├── ValueMapTraversal.java │ │ │ ├── VertexConditionTraversal.java │ │ │ ├── VertexRepeatStepTraversal.java │ │ │ ├── VertexRepeatTraversal.java │ │ │ ├── VertexTraversal.java │ │ │ ├── VertexTraversalOrder.java │ │ │ ├── VertexUntilTraversal.java │ │ │ ├── package-info.java │ │ │ ├── query │ │ │ ├── AbstractGraphRepository.java │ │ │ ├── AbstractGraphRepositoryProxy.java │ │ │ ├── AbstractQueryConvert.java │ │ │ ├── DefaultGraphRepositoryProducer.java │ │ │ ├── DeleteQueryConverter.java │ │ │ ├── GraphQueryMethod.java │ │ │ ├── GraphRepositoryProxy.java │ │ │ ├── RepositoryGraphBean.java │ │ │ ├── ReturnTypeConverterUtil.java │ │ │ ├── SelectQueryConverter.java │ │ │ └── package-info.java │ │ │ └── spi │ │ │ ├── GraphConfigurationProducer.java │ │ │ ├── GraphProducerExtension.java │ │ │ ├── GraphRepositoryConfigurationProducer.java │ │ │ ├── GraphTemplateBean.java │ │ │ └── GraphTemplateConfigurationProducer.java │ └── resources │ │ └── META-INF │ │ ├── beans.xml │ │ └── services │ │ └── javax.enterprise.inject.spi.Extension │ └── test │ ├── java │ └── org │ │ └── jnosql │ │ └── artemis │ │ └── graph │ │ ├── AbstractGraphConverterTest.java │ │ ├── AbstractGraphTemplateTest.java │ │ ├── AbstractTraversalTest.java │ │ ├── BookRepository.java │ │ ├── BookTemplateTest.java │ │ ├── DefaultEdgeTraversalTest.java │ │ ├── DefaultGraphConverterTest.java │ │ ├── DefaultGraphEventPersistManagerTest.java │ │ ├── DefaultGraphTemplateProducerTest.java │ │ ├── DefaultGraphTraversalSourceConverterTest.java │ │ ├── DefaultGraphTraversalSourceTemplateTest.java │ │ ├── DefaultGraphWorkflowTest.java │ │ ├── DefaultPropertyTest.java │ │ ├── DefaultValueMapTraversalTest.java │ │ ├── DefaultVertexTraversalTest.java │ │ ├── EdgeEntityTest.java │ │ ├── GraphConfigurationProducerTest.java │ │ ├── GraphRepositoryConfigurationTest.java │ │ ├── GraphTemplateConfigurationProducer.java │ │ ├── GraphTemplateTest.java │ │ ├── GremlinExecutorTest.java │ │ ├── RepositoryService.java │ │ ├── cdi │ │ ├── CDIExtension.java │ │ └── GraphProducer.java │ │ ├── model │ │ ├── Actor.java │ │ ├── ActorBuilder.java │ │ ├── Animal.java │ │ ├── Book.java │ │ ├── BookTemplate.java │ │ ├── Director.java │ │ ├── Job.java │ │ ├── Money.java │ │ ├── MoneyConverter.java │ │ ├── Movie.java │ │ ├── Person.java │ │ ├── PersonBuilder.java │ │ ├── User.java │ │ ├── Worker.java │ │ └── WrongEntity.java │ │ ├── producer │ │ ├── AbstractGraphMock.java │ │ ├── GraphMockA.java │ │ ├── GraphMockB.java │ │ ├── GraphProducerA.java │ │ └── GraphProducerB.java │ │ ├── query │ │ ├── DefaultGraphRepositoryProducerTest.java │ │ ├── DeleteQueryConverterTest.java │ │ ├── GraphRepositoryProxyTest.java │ │ └── SelectQueryConverterTest.java │ │ └── spi │ │ └── GraphConfigurationProducerExtensionTest.java │ └── resources │ └── META-INF │ ├── beans.xml │ └── graph.json ├── artemis-key-value ├── .gitignore ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── jnosql │ │ │ └── artemis │ │ │ └── key │ │ │ ├── AbstractKeyValueEntityConverter.java │ │ │ ├── AbstractKeyValueTemplate.java │ │ │ ├── AbstractKeyValueWorkflow.java │ │ │ ├── DefaultEntityKeyValuePostPersist.java │ │ │ ├── DefaultEntityKeyValuePrePersist.java │ │ │ ├── DefaultKeyValueEntityConverter.java │ │ │ ├── DefaultKeyValueEntityPostPersist.java │ │ │ ├── DefaultKeyValueEntityPrePersist.java │ │ │ ├── DefaultKeyValueEventPersistManager.java │ │ │ ├── DefaultKeyValueTemplate.java │ │ │ ├── DefaultKeyValueTemplateProducer.java │ │ │ ├── DefaultKeyValueWorkflow.java │ │ │ ├── EntityKeyValuePostPersist.java │ │ │ ├── EntityKeyValuePrePersist.java │ │ │ ├── KeyRepositorySupplier.java │ │ │ ├── KeyValueEntityConverter.java │ │ │ ├── KeyValueEntityPostPersist.java │ │ │ ├── KeyValueEntityPrePersist.java │ │ │ ├── KeyValueEventPersistManager.java │ │ │ ├── KeyValuePreparedStatement.java │ │ │ ├── KeyValueRepositoryProducer.java │ │ │ ├── KeyValueTemplate.java │ │ │ ├── KeyValueTemplateProducer.java │ │ │ ├── KeyValueWorkflow.java │ │ │ ├── package-info.java │ │ │ ├── query │ │ │ ├── AbstractKeyValueRepository.java │ │ │ ├── AbstractKeyValueRepositoryProxy.java │ │ │ ├── DefaultKeyValueRepository.java │ │ │ ├── DefaultKeyValueRepositoryProducer.java │ │ │ ├── KeyValueRepositoryBean.java │ │ │ ├── KeyValueRepositoryProxy.java │ │ │ └── ReturnTypeConverterUtil.java │ │ │ └── spi │ │ │ ├── BucketManagerConfigurationProducer.java │ │ │ ├── BucketManagerProducerExtension.java │ │ │ ├── KeyValueRepositoryConfigurationProducer.java │ │ │ ├── KeyValueTemplateBean.java │ │ │ └── KeyValueTemplateConfigurationProducer.java │ └── resources │ │ └── META-INF │ │ ├── beans.xml │ │ └── services │ │ └── javax.enterprise.inject.spi.Extension │ └── test │ ├── java │ └── org │ │ └── jnosql │ │ └── artemis │ │ ├── CDIExtension.java │ │ ├── DatabaseQualifierTest.java │ │ ├── IgnoreRepository.java │ │ ├── IgnoreRepositoryAsync.java │ │ ├── MockProducer.java │ │ ├── PersonIgnoreRepository.java │ │ ├── PersonRepository.java │ │ ├── PersonRepositoryAsync.java │ │ ├── UserRepository.java │ │ ├── key │ │ ├── BucketManagerConfigurationProducerTest.java │ │ ├── BucketManagerConfigurationProducerXMLTest.java │ │ ├── DefaultKeyValueEntityConverterTest.java │ │ ├── DefaultKeyValueEventPersistManagerTest.java │ │ ├── DefaultKeyValueTemplateProducerTest.java │ │ ├── DefaultKeyValueTemplateTest.java │ │ ├── DefaultKeyValueWorkflowTest.java │ │ ├── KeyValueConfigurationMock.java │ │ ├── KeyValueRepositoryConfigurationTest.java │ │ ├── KeyValueTemplateConfigurationProducerTest.java │ │ ├── RepositoryService.java │ │ ├── query │ │ │ ├── DefaultKeyValueRepositoryProducerTest.java │ │ │ └── KeyValueRepositoryProxyTest.java │ │ └── spi │ │ │ └── BucketManagerProducerExtensionTest.java │ │ └── model │ │ ├── Actor.java │ │ ├── ActorBuilder.java │ │ ├── Animal.java │ │ ├── AppointmentBook.java │ │ ├── Contact.java │ │ ├── ContactType.java │ │ ├── Director.java │ │ ├── Job.java │ │ ├── Machine.java │ │ ├── Money.java │ │ ├── MoneyConverter.java │ │ ├── Movie.java │ │ ├── Person.java │ │ ├── PersonBuilder.java │ │ ├── User.java │ │ └── Worker.java │ └── resources │ └── META-INF │ ├── beans.xml │ ├── key-value.json │ ├── key-value.xml │ └── services │ └── javax.enterprise.inject.spi.Extension ├── artemis-validation ├── .gitignore ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── jnosql │ │ │ └── artemis │ │ │ └── validation │ │ │ ├── ArtemisValidator.java │ │ │ ├── DefaultArtemisValidator.java │ │ │ ├── EntityObserver.java │ │ │ └── package-info.java │ └── resources │ │ └── META-INF │ │ └── beans.xml │ └── test │ ├── java │ └── org │ │ └── jnosql │ │ └── artemis │ │ └── validation │ │ ├── CDIExtension.java │ │ ├── ColumnRepositoryValidationTest.java │ │ ├── DocumentRepositoryValidationTest.java │ │ ├── KeyValueRepositoryValidationTest.java │ │ ├── ManagerProducerProducer.java │ │ ├── Person.java │ │ └── PersonBuilder.java │ └── resources │ └── META-INF │ └── beans.xml └── pom.xml /.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | pom.xml.tag 3 | pom.xml.releaseBackup 4 | pom.xml.versionsBackup 5 | pom.xml.next 6 | test-output/ 7 | /doc 8 | *.iml 9 | *.idea 10 | *.log 11 | .classpath 12 | -project 13 | /.resourceCache 14 | /.project 15 | /.idea 16 | .settings/ 17 | -------------------------------------------------------------------------------- /artemis-column/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | pom.xml.tag 3 | pom.xml.releaseBackup 4 | pom.xml.versionsBackup 5 | pom.xml.next 6 | test-output/ 7 | /doc 8 | *.iml 9 | *.log 10 | .classpath 11 | -project 12 | /.resourceCache 13 | /.project 14 | /.idea 15 | .settings/ 16 | -------------------------------------------------------------------------------- /artemis-column/src/main/java/org/jnosql/artemis/column/ColumnDeleteQueryExecute.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.column; 16 | 17 | 18 | import org.jnosql.diana.api.column.ColumnDeleteQuery; 19 | 20 | /** 21 | * When a column delete query is executed this event if fired 22 | */ 23 | public interface ColumnDeleteQueryExecute { 24 | 25 | /** 26 | * The ColumnQuery before executed 27 | * 28 | * @return the {@link ColumnDeleteQuery} 29 | */ 30 | ColumnDeleteQuery getQuery(); 31 | 32 | 33 | /** 34 | * Returns a ColumnQueryExecute instance 35 | * 36 | * @param query the query 37 | * @return a ColumnQueryExecute instance 38 | */ 39 | static ColumnDeleteQueryExecute of(ColumnDeleteQuery query) { 40 | return new DefaultColumnDeleteQueryExecute(query); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /artemis-column/src/main/java/org/jnosql/artemis/column/ColumnFieldConverter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.column; 16 | 17 | import org.jnosql.artemis.reflection.FieldMapping; 18 | import org.jnosql.diana.api.column.Column; 19 | 20 | import java.util.List; 21 | import java.util.Optional; 22 | 23 | interface ColumnFieldConverter { 24 | void convert(T instance, List columns, Optional column, FieldMapping field, 25 | AbstractColumnEntityConverter converter); 26 | } 27 | -------------------------------------------------------------------------------- /artemis-column/src/main/java/org/jnosql/artemis/column/ColumnFieldValue.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.column; 16 | 17 | import org.jnosql.artemis.Converters; 18 | import org.jnosql.artemis.reflection.FieldValue; 19 | import org.jnosql.diana.api.column.Column; 20 | 21 | import java.util.List; 22 | 23 | /** 24 | * The specialist {@link FieldValue} to column 25 | */ 26 | public interface ColumnFieldValue extends FieldValue { 27 | 28 | 29 | List toColumn(ColumnEntityConverter converter, Converters converters); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /artemis-column/src/main/java/org/jnosql/artemis/column/ColumnQueryExecute.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.column; 16 | 17 | 18 | import org.jnosql.diana.api.column.ColumnQuery; 19 | 20 | /** 21 | * When a column query is executed this event if fired 22 | */ 23 | public interface ColumnQueryExecute { 24 | 25 | /** 26 | * The ColumnQuery before executed 27 | * 28 | * @return the {@link ColumnQuery} 29 | */ 30 | ColumnQuery getQuery(); 31 | 32 | 33 | /** 34 | * Returns a ColumnQueryExecute instance 35 | * 36 | * @param query the query 37 | * @return a ColumnQueryExecute instance 38 | */ 39 | static ColumnQueryExecute of(ColumnQuery query) { 40 | return new DefaultColumnQueryExecute(query); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /artemis-column/src/main/java/org/jnosql/artemis/column/ColumnRepositoryAsyncSupplier.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.column; 16 | 17 | 18 | import org.jnosql.artemis.RepositoryAsync; 19 | 20 | import java.util.function.Supplier; 21 | 22 | /** 23 | * A supplier to {@link RepositoryAsync} that implements document, that injects from {@link org.jnosql.artemis.ConfigurationUnit} 24 | * 25 | * @param a repository type 26 | */ 27 | public interface ColumnRepositoryAsyncSupplier> extends Supplier { 28 | } 29 | -------------------------------------------------------------------------------- /artemis-column/src/main/java/org/jnosql/artemis/column/ColumnRepositorySupplier.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.column; 16 | 17 | import org.jnosql.artemis.Repository; 18 | 19 | import java.util.function.Supplier; 20 | 21 | /** 22 | * A supplier to {@link Repository} that implements document, that injects from {@link org.jnosql.artemis.ConfigurationUnit} 23 | * 24 | * @param a repository type 25 | */ 26 | public interface ColumnRepositorySupplier > extends Supplier { 27 | } 28 | -------------------------------------------------------------------------------- /artemis-column/src/main/java/org/jnosql/artemis/column/ColumnTemplateAsyncProducer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.column; 16 | 17 | 18 | import org.jnosql.diana.api.column.ColumnFamilyManagerAsync; 19 | 20 | /** 21 | * The producer of {@link ColumnTemplate} 22 | */ 23 | public interface ColumnTemplateAsyncProducer { 24 | 25 | /** 26 | * creates a {@link ColumnFamilyManagerAsync} 27 | * 28 | * @param the ColumnTemplate instance 29 | * @param columnFamilyManager the columnFamilyManager 30 | * @return a new instance 31 | * @throws NullPointerException when columnFamilyManager is null 32 | */ 33 | T get(ColumnFamilyManagerAsync columnFamilyManager); 34 | 35 | } 36 | -------------------------------------------------------------------------------- /artemis-column/src/main/java/org/jnosql/artemis/column/ColumnTemplateProducer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.column; 16 | 17 | 18 | import org.jnosql.diana.api.column.ColumnFamilyManager; 19 | 20 | /** 21 | * The producer of {@link ColumnTemplate} 22 | */ 23 | public interface ColumnTemplateProducer { 24 | 25 | /** 26 | * creates a {@link ColumnFamilyManager} 27 | * 28 | * @param the ColumnTemplate instance 29 | * @param columnFamilyManager the columnFamilyManager 30 | * @return a new instance 31 | * @throws NullPointerException when columnFamilyManager is null 32 | */ 33 | T get(ColumnFamilyManager columnFamilyManager); 34 | 35 | } 36 | -------------------------------------------------------------------------------- /artemis-column/src/main/java/org/jnosql/artemis/column/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | 16 | /** 17 | * This package contains all objects to use a Column Family API. This API gonna focus in domain, in other words, 18 | * ubiquitous language. A column family is a NoSQL object that contains columns of related data. It is a tuple (pair) 19 | * that consists of a key-value pair, where the key is mapped to a value that is a set of columns. 20 | * In analogy with relational databases, a column family is as a "table", each key-value pair being a "row". 21 | * Each column is a tuple (triplet) consisting of a column name, a value, and a timestamp. In a relational 22 | * database table, this data would be grouped together within a table with other non-related data. 23 | * Ref: https://en.wikipedia.org/wiki/Column_family 24 | * 25 | */ 26 | package org.jnosql.artemis.column; -------------------------------------------------------------------------------- /artemis-column/src/main/java/org/jnosql/artemis/column/query/ColumnMapperDeleteFrom.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (c) 2017 Otávio Santana and others 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Apache License v2.0 which accompanies this distribution. 7 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 8 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 9 | * 10 | * You may elect to redistribute this code under either of these licenses. 11 | * 12 | * Contributors: 13 | * 14 | * Otavio Santana 15 | * 16 | */ 17 | package org.jnosql.artemis.column.query; 18 | 19 | 20 | /** 21 | * The Column Delete Query 22 | */ 23 | public interface ColumnMapperDeleteFrom extends ColumnMapperDeleteQueryBuild{ 24 | 25 | /** 26 | * Starts a new condition defining the column name 27 | * 28 | * @param name the column name 29 | * @return a new {@link ColumnMapperDeleteNameCondition} 30 | * @throws NullPointerException when name is null 31 | */ 32 | ColumnMapperDeleteNameCondition where(String name); 33 | } 34 | -------------------------------------------------------------------------------- /artemis-column/src/main/java/org/jnosql/artemis/column/query/ColumnMapperDeleteNotCondition.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (c) 2017 Otávio Santana and others 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Apache License v2.0 which accompanies this distribution. 7 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 8 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 9 | * 10 | * You may elect to redistribute this code under either of these licenses. 11 | * 12 | * Contributors: 13 | * 14 | * Otavio Santana 15 | * 16 | */ 17 | package org.jnosql.artemis.column.query; 18 | 19 | /** 20 | * The column not condition 21 | */ 22 | public interface ColumnMapperDeleteNotCondition extends ColumnMapperDeleteNameCondition { 23 | } 24 | -------------------------------------------------------------------------------- /artemis-column/src/main/java/org/jnosql/artemis/column/query/ColumnMapperLimit.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (c) 2017 Otávio Santana and others 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Apache License v2.0 which accompanies this distribution. 7 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 8 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 9 | * 10 | * You may elect to redistribute this code under either of these licenses. 11 | * 12 | * Contributors: 13 | * 14 | * Otavio Santana 15 | * 16 | */ 17 | package org.jnosql.artemis.column.query; 18 | 19 | /** 20 | * The Column Order whose define the the maximum number of results to retrieve. 21 | */ 22 | public interface ColumnMapperLimit extends ColumnMapperQueryBuild { 23 | 24 | /** 25 | * Defines the position of the first result to retrieve. 26 | * 27 | * @param skip the number of elements to skip 28 | * @return a query with first result defined 29 | */ 30 | ColumnMapperSkip skip(long skip); 31 | } 32 | -------------------------------------------------------------------------------- /artemis-column/src/main/java/org/jnosql/artemis/column/query/ColumnMapperNotCondition.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (c) 2017 Otávio Santana and others 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Apache License v2.0 which accompanies this distribution. 7 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 8 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 9 | * 10 | * You may elect to redistribute this code under either of these licenses. 11 | * 12 | * Contributors: 13 | * 14 | * Otavio Santana 15 | * 16 | */ 17 | package org.jnosql.artemis.column.query; 18 | 19 | 20 | /** 21 | * The column not condition 22 | */ 23 | public interface ColumnMapperNotCondition extends ColumnMapperNameCondition { 24 | } 25 | -------------------------------------------------------------------------------- /artemis-column/src/main/java/org/jnosql/artemis/column/query/ColumnMapperOrder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (c) 2017 Otávio Santana and others 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Apache License v2.0 which accompanies this distribution. 7 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 8 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 9 | * 10 | * You may elect to redistribute this code under either of these licenses. 11 | * 12 | * Contributors: 13 | * 14 | * Otavio Santana 15 | * 16 | */ 17 | package org.jnosql.artemis.column.query; 18 | 19 | 20 | /** 21 | * The definition to either {@link org.jnosql.diana.api.Sort.SortType} 22 | */ 23 | public interface ColumnMapperOrder { 24 | 25 | 26 | 27 | /** 28 | * Defines the order as {@link org.jnosql.diana.api.Sort.SortType#ASC} 29 | * @return the {@link ColumnMapperNameOrder} instance 30 | */ 31 | ColumnMapperNameOrder asc(); 32 | 33 | /** 34 | * Defines the order as {@link org.jnosql.diana.api.Sort.SortType#DESC} 35 | * @return the {@link ColumnMapperNameOrder} instance 36 | */ 37 | ColumnMapperNameOrder desc(); 38 | } 39 | -------------------------------------------------------------------------------- /artemis-column/src/main/java/org/jnosql/artemis/column/query/ColumnMapperSkip.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (c) 2017 Otávio Santana and others 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Apache License v2.0 which accompanies this distribution. 7 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 8 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 9 | * 10 | * You may elect to redistribute this code under either of these licenses. 11 | * 12 | * Contributors: 13 | * 14 | * Otavio Santana 15 | * 16 | */ 17 | package org.jnosql.artemis.column.query; 18 | 19 | 20 | /** 21 | * The Column Order whose define the position of the first result to retrieve. 22 | */ 23 | public interface ColumnMapperSkip extends ColumnMapperQueryBuild { 24 | 25 | 26 | /** 27 | * Defines the maximum number of results to retrieve. 28 | * 29 | * @param limit the limit 30 | * @return a query with the limit defined 31 | */ 32 | ColumnMapperLimit limit(long limit); 33 | } 34 | -------------------------------------------------------------------------------- /artemis-column/src/main/java/org/jnosql/artemis/column/query/ColumnTokenProcessor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.column.query; 16 | 17 | import org.jnosql.artemis.Converters; 18 | import org.jnosql.artemis.reflection.ClassMapping; 19 | import org.jnosql.diana.api.column.ColumnCondition; 20 | 21 | interface ColumnTokenProcessor { 22 | 23 | ColumnCondition process(String token, 24 | int index, 25 | Object[] args, 26 | String methodName, 27 | ClassMapping mapping, 28 | Converters converters); 29 | } 30 | -------------------------------------------------------------------------------- /artemis-column/src/main/java/org/jnosql/artemis/column/query/RepositoryColumnObserverParser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.column.query; 16 | 17 | import org.jnosql.artemis.reflection.ClassMapping; 18 | import org.jnosql.diana.api.column.ColumnObserverParser; 19 | 20 | import java.util.Optional; 21 | 22 | final class RepositoryColumnObserverParser implements ColumnObserverParser { 23 | 24 | private final ClassMapping classMapping; 25 | 26 | RepositoryColumnObserverParser(ClassMapping classMapping) { 27 | this.classMapping = classMapping; 28 | } 29 | 30 | @Override 31 | public String fireEntity(String entity) { 32 | return classMapping.getName(); 33 | } 34 | 35 | @Override 36 | public String fireField(String entity, String field) { 37 | return Optional.ofNullable(classMapping.getColumnField(field)).orElse(field); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /artemis-column/src/main/java/org/jnosql/artemis/column/query/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | 16 | /** 17 | * This package has the implementation to dynamic query to both {@link org.jnosql.artemis.Repository} 18 | * and {@link org.jnosql.artemis.RepositoryAsync} on Column database. 19 | */ 20 | package org.jnosql.artemis.column.query; -------------------------------------------------------------------------------- /artemis-column/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 15 | 16 | 21 | -------------------------------------------------------------------------------- /artemis-column/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017 Otávio Santana and others 3 | # All rights reserved. This program and the accompanying materials 4 | # are made available under the terms of the Eclipse Public License v1.0 5 | # and Apache License v2.0 which accompanies this distribution. 6 | # The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | # and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | # 9 | # You may elect to redistribute this code under either of these licenses. 10 | # 11 | # Contributors: 12 | # 13 | # Otavio Santana 14 | # 15 | org.jnosql.artemis.column.spi.ColumnFamilyProducerExtension -------------------------------------------------------------------------------- /artemis-column/src/test/java/org/jnosql/artemis/IgnoreRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis; 16 | 17 | 18 | public interface IgnoreRepository extends Repository { 19 | } 20 | -------------------------------------------------------------------------------- /artemis-column/src/test/java/org/jnosql/artemis/IgnoreRepositoryAsync.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis; 16 | 17 | 18 | public interface IgnoreRepositoryAsync extends RepositoryAsync { 19 | } 20 | -------------------------------------------------------------------------------- /artemis-column/src/test/java/org/jnosql/artemis/PersonIgnoreRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis; 16 | 17 | import org.jnosql.artemis.model.Person; 18 | 19 | 20 | public interface PersonIgnoreRepository extends IgnoreRepository{ 21 | } 22 | -------------------------------------------------------------------------------- /artemis-column/src/test/java/org/jnosql/artemis/PersonRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis; 16 | 17 | 18 | import org.jnosql.artemis.model.Person; 19 | 20 | public interface PersonRepository extends Repository { 21 | } 22 | -------------------------------------------------------------------------------- /artemis-column/src/test/java/org/jnosql/artemis/PersonRepositoryAsync.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis; 16 | 17 | 18 | import org.jnosql.artemis.model.Person; 19 | 20 | public interface PersonRepositoryAsync extends RepositoryAsync { 21 | } 22 | -------------------------------------------------------------------------------- /artemis-column/src/test/java/org/jnosql/artemis/UserRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis; 16 | 17 | 18 | import org.jnosql.artemis.model.User; 19 | 20 | public interface UserRepository extends Repository { 21 | } 22 | -------------------------------------------------------------------------------- /artemis-column/src/test/java/org/jnosql/artemis/column/ColumnEntityPostPersistTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.column; 16 | 17 | import org.jnosql.diana.api.column.ColumnEntity; 18 | import org.junit.jupiter.api.Assertions; 19 | import org.junit.jupiter.api.Test; 20 | 21 | import static org.junit.jupiter.api.Assertions.assertEquals; 22 | 23 | 24 | public class ColumnEntityPostPersistTest { 25 | 26 | 27 | @Test 28 | public void shouldReturnNPEWhenEntityIsNull() { 29 | Assertions.assertThrows(NullPointerException.class, () -> ColumnEntityPostPersist.of(null)); 30 | } 31 | 32 | @Test 33 | public void shouldReturnInstance() { 34 | ColumnEntity entity = ColumnEntity.of("columnFamily"); 35 | ColumnEntityPostPersist postPersist = ColumnEntityPostPersist.of(entity); 36 | assertEquals(entity, postPersist.getEntity()); 37 | } 38 | } -------------------------------------------------------------------------------- /artemis-column/src/test/java/org/jnosql/artemis/column/ColumnEntityPrePersistTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.column; 16 | 17 | import org.jnosql.diana.api.column.ColumnEntity; 18 | import org.junit.jupiter.api.Assertions; 19 | import org.junit.jupiter.api.Test; 20 | 21 | import static org.junit.jupiter.api.Assertions.assertEquals; 22 | 23 | 24 | public class ColumnEntityPrePersistTest { 25 | 26 | @Test 27 | public void shouldReturnNPEWhenEntityIsNull() { 28 | 29 | Assertions.assertThrows(NullPointerException.class, () -> ColumnEntityPrePersist.of(null)); 30 | } 31 | 32 | @Test 33 | public void shouldReturnInstance() { 34 | ColumnEntity entity = ColumnEntity.of("columnFamily"); 35 | ColumnEntityPrePersist prePersist = ColumnEntityPrePersist.of(entity); 36 | assertEquals(entity, prePersist.getEntity()); 37 | } 38 | } -------------------------------------------------------------------------------- /artemis-column/src/test/java/org/jnosql/artemis/model/ContactType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.model; 16 | 17 | public enum ContactType { 18 | MOBILE, PHONE, EMAIL 19 | } 20 | -------------------------------------------------------------------------------- /artemis-column/src/test/java/org/jnosql/artemis/model/Machine.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.model; 16 | 17 | 18 | import org.jnosql.artemis.Column; 19 | 20 | public class Machine { 21 | 22 | @Column 23 | private String name; 24 | 25 | public String getName() { 26 | return name; 27 | } 28 | 29 | public void setName(String name) { 30 | this.name = name; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /artemis-column/src/test/java/org/jnosql/artemis/model/MoneyConverter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.model; 16 | 17 | 18 | import org.jnosql.artemis.AttributeConverter; 19 | 20 | public class MoneyConverter implements AttributeConverter{ 21 | 22 | 23 | @Override 24 | public String convertToDatabaseColumn(Money attribute) { 25 | return attribute.toString(); 26 | } 27 | 28 | @Override 29 | public Money convertToEntityAttribute(String dbData) { 30 | return Money.parse(dbData); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /artemis-column/src/test/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 15 | 16 | 21 | -------------------------------------------------------------------------------- /artemis-column/src/test/resources/META-INF/column.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "description":"that is the description", 4 | "name":"name", 5 | "provider":"org.jnosql.artemis.column.ColumnFamilyManagerMock", 6 | "settings":{ 7 | "key":"value", 8 | "key2":"value2" 9 | 10 | } 11 | }, 12 | { 13 | "description":"that is the description", 14 | "name":"name-2", 15 | "provider":"org.jnosql.artemis.column.ColumnFamilyManagerMock", 16 | "settings":{ 17 | "key":"value", 18 | "key2":"value2", 19 | "key3":"value3" 20 | } 21 | } 22 | ] -------------------------------------------------------------------------------- /artemis-configuration/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | pom.xml.tag 3 | pom.xml.releaseBackup 4 | pom.xml.versionsBackup 5 | pom.xml.next 6 | test-output/ 7 | /doc 8 | *.iml 9 | *.log 10 | .classpath 11 | -project 12 | /.resourceCache 13 | /.project 14 | /.idea 15 | .settings/ 16 | -------------------------------------------------------------------------------- /artemis-configuration/src/main/java/org/jnosql/artemis/configuration/Configurable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.configuration; 16 | 17 | import java.io.Serializable; 18 | import java.util.Map; 19 | 20 | /** 21 | * This class is the information unit that returns from a file 22 | */ 23 | public interface Configurable extends Serializable { 24 | 25 | 26 | /** 27 | * Get the unit-name 28 | * 29 | * @return the name 30 | */ 31 | String getName(); 32 | 33 | 34 | /** 35 | * Get the description 36 | * 37 | * @return the description 38 | */ 39 | String getDescription(); 40 | 41 | /** 42 | * Get the provider 43 | * 44 | * @return provider 45 | */ 46 | String getProvider(); 47 | 48 | /** 49 | * the settings map 50 | * 51 | * @return the settings map 52 | */ 53 | Map getSettings(); 54 | } 55 | -------------------------------------------------------------------------------- /artemis-configuration/src/main/java/org/jnosql/artemis/configuration/ConfigurableReader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.configuration; 16 | 17 | import org.jnosql.artemis.ConfigurationUnit; 18 | 19 | import java.io.InputStream; 20 | import java.util.List; 21 | import java.util.function.Supplier; 22 | 23 | /** 24 | * The reader of configurations 25 | */ 26 | public interface ConfigurableReader { 27 | 28 | /** 29 | * That reads the configurations and than returns {@link Configurable} 30 | * @param stream the stream 31 | * @param annotation the annotation 32 | * @return the configurations list 33 | * @throws NullPointerException when either stream or annotation are null 34 | * @throws ConfigurationException when has configuration problem 35 | */ 36 | List read(Supplier stream, ConfigurationUnit annotation); 37 | } 38 | -------------------------------------------------------------------------------- /artemis-configuration/src/main/java/org/jnosql/artemis/configuration/ConfigurationException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.configuration; 16 | 17 | import org.jnosql.artemis.ArtemisException; 18 | 19 | /** 20 | * The exception to read Configuration 21 | */ 22 | public class ConfigurationException extends ArtemisException { 23 | 24 | public ConfigurationException(String message) { 25 | super(message); 26 | } 27 | 28 | public ConfigurationException(String message, Throwable exception) { 29 | super(message, exception); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /artemis-configuration/src/main/java/org/jnosql/artemis/configuration/NamedLiteral.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.configuration; 16 | 17 | import javax.enterprise.util.AnnotationLiteral; 18 | import javax.inject.Named; 19 | 20 | class NamedLiteral extends AnnotationLiteral implements Named { 21 | 22 | private final String value; 23 | 24 | NamedLiteral(String value) { 25 | this.value = value; 26 | } 27 | 28 | @Override 29 | public String value() { 30 | return value; 31 | } 32 | 33 | @Override 34 | public String toString() { 35 | final StringBuilder sb = new StringBuilder("NamedLiteral{"); 36 | sb.append("value='").append(value).append('\''); 37 | sb.append('}'); 38 | return sb.toString(); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /artemis-configuration/src/main/java/org/jnosql/artemis/configuration/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | /** 16 | * This package has the classes to read configuration from file, json recommended, that is normally activated from 17 | * {@link org.jnosql.artemis.ConfigurationUnit} annotation. 18 | */ 19 | package org.jnosql.artemis.configuration; -------------------------------------------------------------------------------- /artemis-configuration/src/main/java/org/jnosql/artemis/configuration/yaml/ConfigurablesYAML.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Daniel Cunha 14 | */ 15 | package org.jnosql.artemis.configuration.yaml; 16 | 17 | import org.jnosql.artemis.configuration.ConfigurableImpl; 18 | 19 | import java.util.List; 20 | 21 | class ConfigurablesYAML { 22 | private List configurations; 23 | 24 | public List getConfigurations() { 25 | return configurations; 26 | } 27 | 28 | public void setConfigurations(List configurations) { 29 | this.configurations = configurations; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /artemis-configuration/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 15 | 16 | 21 | -------------------------------------------------------------------------------- /artemis-configuration/src/test/java/org/jnosql/artemis/configuration/DefaultMockConfiguration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.configuration; 16 | 17 | public class DefaultMockConfiguration implements MockConfiguration { 18 | } 19 | -------------------------------------------------------------------------------- /artemis-configuration/src/test/java/org/jnosql/artemis/configuration/InvalidConfiguration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.configuration; 16 | 17 | public class InvalidConfiguration implements MockConfiguration { 18 | 19 | private InvalidConfiguration(String configuration) { 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /artemis-configuration/src/test/java/org/jnosql/artemis/configuration/MockConfiguration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.configuration; 16 | 17 | public interface MockConfiguration { 18 | } 19 | -------------------------------------------------------------------------------- /artemis-configuration/src/test/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 15 | 16 | 21 | -------------------------------------------------------------------------------- /artemis-configuration/src/test/resources/META-INF/column.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "description":"that is the description", 4 | "name":"name", 5 | "provider":"org.jnosql.artemis.column.ColumnFamilyManagerMock", 6 | "settings":{ 7 | "key":"value", 8 | "key2":"value2" 9 | 10 | } 11 | }, 12 | { 13 | "description":"that is the description", 14 | "name":"name-2", 15 | "provider":"org.jnosql.artemis.column.ColumnFamilyManagerMock", 16 | "settings":{ 17 | "key":"value", 18 | "key2":"value2", 19 | "key3":"value3" 20 | } 21 | } 22 | ] -------------------------------------------------------------------------------- /artemis-configuration/src/test/resources/META-INF/document.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "description":"that is the description", 4 | "name":"name", 5 | "provider":"org.jnosql.artemis.document.DocumentCollectionManagerMock", 6 | "settings":{ 7 | "key":"value", 8 | "key2":"value2" 9 | 10 | } 11 | }, 12 | { 13 | "description":"that is the description", 14 | "name":"name-2", 15 | "provider":"org.jnosql.artemis.document.DocumentCollectionManagerMock", 16 | "settings":{ 17 | "key":"value", 18 | "key2":"value2", 19 | "key3":"value3" 20 | } 21 | } 22 | ] -------------------------------------------------------------------------------- /artemis-configuration/src/test/resources/META-INF/invalid-class.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "name", 4 | "description": "that is the description", 5 | "provider": "java.util.Collection", 6 | "settings": { 7 | "key": "value" 8 | } 9 | }, 10 | { 11 | "name": "name-1", 12 | "description": "that is the description", 13 | "provider": "java.invalid.Collection", 14 | "settings": { 15 | "key": "value" 16 | } 17 | }, 18 | { 19 | "name": "name-2", 20 | "description": "that is the description", 21 | "provider": "org.jnosql.artemis.configuration.InvalidConfiguration", 22 | "settings": { 23 | "key": "value" 24 | } 25 | } 26 | ] -------------------------------------------------------------------------------- /artemis-configuration/src/test/resources/META-INF/invalid.json: -------------------------------------------------------------------------------- 1 | invalid-json -------------------------------------------------------------------------------- /artemis-configuration/src/test/resources/META-INF/invalid.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | -------------------------------------------------------------------------------- /artemis-configuration/src/test/resources/META-INF/invalid.yaml: -------------------------------------------------------------------------------- 1 | configurations: 2 | - description: that is the description 3 | name: name 4 | provider: org.jnosql.artemis.configuration.DefaultMockConfiguration 5 | settings: 6 | - key 7 | value 8 | 9 | - key2 10 | value -------------------------------------------------------------------------------- /artemis-configuration/src/test/resources/META-INF/jnosql-2.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "description": "that is the description", 4 | "name": "name", 5 | "provider": "org.jnosql.artemis.configuration.DefaultMockConfiguration", 6 | "settings": { 7 | "key": "value", 8 | "key2": "value2" 9 | } 10 | } 11 | ] -------------------------------------------------------------------------------- /artemis-configuration/src/test/resources/META-INF/jnosql.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "description":"that is the description", 4 | "name":"name", 5 | "provider":"org.jnosql.artemis.configuration.DefaultMockConfiguration", 6 | "settings":{ 7 | "key":"value", 8 | "key2":"value2" 9 | 10 | } 11 | }, 12 | { 13 | "description":"that is the description", 14 | "name":"name-2", 15 | "provider":"org.jnosql.artemis.configuration.DefaultMockConfiguration", 16 | "settings":{ 17 | "key":"value", 18 | "key2":"value2", 19 | "key3":"value3" 20 | } 21 | } 22 | ] -------------------------------------------------------------------------------- /artemis-configuration/src/test/resources/META-INF/jnosql.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | that is the description 19 | name 20 | org.jnosql.artemis.configuration.DefaultMockConfiguration 21 | 22 | 23 | key2 24 | value2 25 | 26 | 27 | key 28 | value 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /artemis-configuration/src/test/resources/META-INF/jnosql.yaml: -------------------------------------------------------------------------------- 1 | configurations: 2 | - description: that is the description 3 | name: name 4 | provider: org.jnosql.artemis.configuration.DefaultMockConfiguration 5 | settings: 6 | key: value 7 | key2: value2 8 | 9 | - description: that is the description 10 | name: name2 11 | provider: org.jnosql.artemis.configuration.DefaultMockConfiguration 12 | settings: 13 | key: value 14 | key2: value2 -------------------------------------------------------------------------------- /artemis-configuration/src/test/resources/META-INF/key-value.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "description":"that is the description", 4 | "name":"name", 5 | "provider":"org.jnosql.artemis.key.KeyValueConfigurationMock", 6 | "settings":{ 7 | "key":"value", 8 | "key2":"value2" 9 | 10 | } 11 | }, 12 | { 13 | "description":"that is the description", 14 | "name":"name-2", 15 | "provider":"org.jnosql.artemis.key.KeyValueConfigurationMock", 16 | "settings":{ 17 | "key":"value", 18 | "key2":"value2", 19 | "key3":"value3" 20 | } 21 | } 22 | ] -------------------------------------------------------------------------------- /artemis-core/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | pom.xml.tag 3 | pom.xml.releaseBackup 4 | pom.xml.versionsBackup 5 | pom.xml.next 6 | test-output/ 7 | /doc 8 | *.iml 9 | *.log 10 | .classpath 11 | -project 12 | /.resourceCache 13 | /.project 14 | /.idea 15 | .settings/ 16 | -------------------------------------------------------------------------------- /artemis-core/src/main/java/org/jnosql/artemis/Column.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis; 16 | 17 | 18 | import java.lang.annotation.ElementType; 19 | import java.lang.annotation.Retention; 20 | import java.lang.annotation.RetentionPolicy; 21 | import java.lang.annotation.Target; 22 | 23 | /** 24 | * Is used to specify a mapped column for a persistent property or field. 25 | */ 26 | @Retention(RetentionPolicy.RUNTIME) 27 | @Target(ElementType.FIELD) 28 | public @interface Column { 29 | /** 30 | * (Optional) The name of the column. Defaults to the property or field name. 31 | * @return the name 32 | */ 33 | String value() default ""; 34 | } 35 | -------------------------------------------------------------------------------- /artemis-core/src/main/java/org/jnosql/artemis/ConfigurationException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis; 16 | 17 | /** 18 | * The exception to read Configuration 19 | */ 20 | public class ConfigurationException extends ArtemisException { 21 | 22 | public ConfigurationException(String message) { 23 | super(message); 24 | } 25 | 26 | public ConfigurationException(String message, Throwable exception) { 27 | super(message, exception); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /artemis-core/src/main/java/org/jnosql/artemis/Convert.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis; 16 | 17 | 18 | import java.lang.annotation.ElementType; 19 | import java.lang.annotation.Retention; 20 | import java.lang.annotation.RetentionPolicy; 21 | import java.lang.annotation.Target; 22 | 23 | /** 24 | * This annotation enables the converter resource. 25 | * On the field say the converted to be used, must implement AttributeConverter interface. 26 | */ 27 | @Retention(RetentionPolicy.RUNTIME) 28 | @Target(ElementType.FIELD) 29 | public @interface Convert { 30 | /** 31 | * The converter 32 | * 33 | * @return the converter type 34 | */ 35 | Class value(); 36 | } 37 | -------------------------------------------------------------------------------- /artemis-core/src/main/java/org/jnosql/artemis/Converters.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis; 16 | 17 | /** 18 | * The Converter storage 19 | */ 20 | public interface Converters { 21 | 22 | /** 23 | * Return a new instance from the converter 24 | * 25 | * @param converterClass the converter class 26 | * @return a converter instance 27 | * @throws NullPointerException when converter is null 28 | */ 29 | AttributeConverter get(Class converterClass); 30 | } 31 | -------------------------------------------------------------------------------- /artemis-core/src/main/java/org/jnosql/artemis/DatabaseType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis; 16 | 17 | 18 | /** 19 | * Defines the database type supported on Artemis. 20 | */ 21 | public enum DatabaseType { 22 | DOCUMENT, COLUMN, KEY_VALUE, GRAPH 23 | } 24 | -------------------------------------------------------------------------------- /artemis-core/src/main/java/org/jnosql/artemis/DynamicQueryException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis; 16 | 17 | 18 | /** 19 | * The root exception to dynamic query on {@link Repository} 20 | */ 21 | public class DynamicQueryException extends ArtemisException { 22 | 23 | /** 24 | * Constructs a new runtime exception with the specified detail message. 25 | * 26 | * @param message the message 27 | */ 28 | public DynamicQueryException(String message) { 29 | super(message); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /artemis-core/src/main/java/org/jnosql/artemis/Embeddable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis; 16 | 17 | 18 | import javax.enterprise.inject.Stereotype; 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | 24 | /** 25 | * Defines an embedded field, that means all elements fields in the class will as converted as one. 26 | * E.g., In a document NoSQL database that class will translate to a subdocument. 27 | */ 28 | @Retention(RetentionPolicy.RUNTIME) 29 | @Target(ElementType.TYPE) 30 | @Stereotype 31 | public @interface Embeddable { 32 | } 33 | -------------------------------------------------------------------------------- /artemis-core/src/main/java/org/jnosql/artemis/Entity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis; 16 | 17 | 18 | import javax.enterprise.inject.Stereotype; 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | 24 | /** 25 | * Specifies that the class is an entity. This annotation is applied to the entity class. 26 | */ 27 | @Retention(RetentionPolicy.RUNTIME) 28 | @Target(ElementType.TYPE) 29 | @Stereotype 30 | public @interface Entity { 31 | /** 32 | * The name of an entity. Defaults to the unqualified name of the entity class. 33 | * @return the entity name (Optional) 34 | */ 35 | String value() default ""; 36 | } 37 | -------------------------------------------------------------------------------- /artemis-core/src/main/java/org/jnosql/artemis/EntityNotFoundException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis; 16 | 17 | /** 18 | * Thrown by the persistence provider when an entity does not exist. 19 | */ 20 | public class EntityNotFoundException extends ArtemisException { 21 | 22 | /** 23 | * Constructs a new EntityNotFoundException exception with the specified detail message. 24 | * 25 | * @param message the message 26 | */ 27 | public EntityNotFoundException(String message) { 28 | super(message); 29 | } 30 | 31 | /** 32 | * Constructs a new EntityNotFoundException exception with null as its detail message. 33 | */ 34 | public EntityNotFoundException() { 35 | super(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /artemis-core/src/main/java/org/jnosql/artemis/Id.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis; 16 | 17 | 18 | import java.lang.annotation.ElementType; 19 | import java.lang.annotation.Retention; 20 | import java.lang.annotation.RetentionPolicy; 21 | import java.lang.annotation.Target; 22 | 23 | /** 24 | *This isn't a mandatory field, but when it define this field is a key. 25 | * That gonna be used mainly for key-value operations. 26 | * @see Entity 27 | */ 28 | @Retention(RetentionPolicy.RUNTIME) 29 | @Target(ElementType.FIELD) 30 | public @interface Id { 31 | 32 | String value() default "_id"; 33 | } 34 | -------------------------------------------------------------------------------- /artemis-core/src/main/java/org/jnosql/artemis/MappedSuperclass.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis; 16 | 17 | 18 | import java.lang.annotation.ElementType; 19 | import java.lang.annotation.Retention; 20 | import java.lang.annotation.RetentionPolicy; 21 | import java.lang.annotation.Target; 22 | 23 | /** 24 | * Designates a class whose mapping information is applied to the entities that inherit from it. 25 | * A mapped superclass has no separate table defined for it. 26 | */ 27 | @Retention(RetentionPolicy.RUNTIME) 28 | @Target(ElementType.TYPE) 29 | public @interface MappedSuperclass { 30 | 31 | } 32 | -------------------------------------------------------------------------------- /artemis-core/src/main/java/org/jnosql/artemis/Pagination.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis; 16 | 17 | /** 18 | * Interface for pagination information. 19 | */ 20 | public interface Pagination { 21 | 22 | /** 23 | * Returns the max number of row in a query 24 | * 25 | * @return the limit to be used in a query 26 | */ 27 | long getLimit(); 28 | 29 | /** 30 | * Gets when the result starts 31 | * 32 | * @return the start 33 | */ 34 | long getSkip(); 35 | 36 | /** 37 | * Creates a default pagination 38 | * 39 | * @param start the start 40 | * @param limit the limit 41 | * @return the pagination instance 42 | */ 43 | static Pagination of(long start, long limit) { 44 | return new DefaultPagination(limit, start); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /artemis-core/src/main/java/org/jnosql/artemis/Param.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis; 16 | 17 | import java.lang.annotation.ElementType; 18 | import java.lang.annotation.Retention; 19 | import java.lang.annotation.RetentionPolicy; 20 | import java.lang.annotation.Target; 21 | 22 | 23 | /** 24 | * Defines a param to a {@link Query} query. 25 | */ 26 | @Retention(RetentionPolicy.RUNTIME) 27 | @Target(ElementType.PARAMETER) 28 | public @interface Param { 29 | 30 | String value(); 31 | } 32 | -------------------------------------------------------------------------------- /artemis-core/src/main/java/org/jnosql/artemis/Query.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis; 16 | 17 | 18 | import java.lang.annotation.ElementType; 19 | import java.lang.annotation.Retention; 20 | import java.lang.annotation.RetentionPolicy; 21 | import java.lang.annotation.Target; 22 | 23 | /** 24 | * To run Query in Repository interface 25 | */ 26 | @Retention(RetentionPolicy.RUNTIME) 27 | @Target(ElementType.METHOD) 28 | public @interface Query { 29 | 30 | String value(); 31 | } 32 | 33 | -------------------------------------------------------------------------------- /artemis-core/src/main/java/org/jnosql/artemis/reflection/ClassInformationNotFoundException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.reflection; 16 | 17 | 18 | import org.jnosql.artemis.ArtemisException; 19 | 20 | /** 21 | * Exception when a class is not loaded to the cached way 22 | */ 23 | public class ClassInformationNotFoundException extends ArtemisException { 24 | 25 | 26 | /** 27 | * Creates the exception instance 28 | * 29 | * @param message the message in the exception 30 | */ 31 | public ClassInformationNotFoundException(String message) { 32 | super(message); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /artemis-core/src/main/java/org/jnosql/artemis/reflection/ConstructorException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.reflection; 16 | 17 | import org.jnosql.artemis.ArtemisException; 18 | 19 | 20 | /** 21 | * Get the exception when a class has a no arg constructor either public or default 22 | */ 23 | public class ConstructorException extends ArtemisException { 24 | 25 | public ConstructorException(Class clazz) { 26 | super("This class must have a no arg with either public and default visibility: " + clazz.getName()); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /artemis-core/src/main/java/org/jnosql/artemis/reflection/FieldReader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.reflection; 16 | 17 | 18 | /** 19 | * A piece of operations within a class. 20 | * This class does the getter operation in a {@link java.lang.reflect.Field} in a class from a Field. 21 | */ 22 | public interface FieldReader { 23 | 24 | /** 25 | * Reads the entity bean, it will read the respective field and return the value. 26 | * 27 | * @param bean the entity that has the field 28 | * @return the field value from the entity 29 | * @throws NullPointerException when bean is null 30 | */ 31 | Object read(Object bean); 32 | } 33 | -------------------------------------------------------------------------------- /artemis-core/src/main/java/org/jnosql/artemis/reflection/FieldReaderFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.reflection; 16 | 17 | import java.lang.reflect.Field; 18 | import java.util.function.Function; 19 | 20 | /** 21 | * A {@link FieldReader} factory 22 | */ 23 | public interface FieldReaderFactory extends Function { 24 | } 25 | -------------------------------------------------------------------------------- /artemis-core/src/main/java/org/jnosql/artemis/reflection/FieldWriter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.reflection; 16 | 17 | 18 | /** 19 | * A piece of operations within a class. 20 | * This class does the setter operation in a {@link java.lang.reflect.Field} in a class from a Field. 21 | */ 22 | public interface FieldWriter { 23 | 24 | /** 25 | * From the entity bean, it will write the respective field and return the value. 26 | * 27 | * @param bean the entity that has the field 28 | * @param value the value to the field 29 | * @throws NullPointerException when there is null parameter 30 | */ 31 | void write(Object bean, Object value); 32 | } 33 | -------------------------------------------------------------------------------- /artemis-core/src/main/java/org/jnosql/artemis/reflection/FieldWriterFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.reflection; 16 | 17 | import java.lang.reflect.Field; 18 | import java.util.function.Function; 19 | 20 | /** 21 | * A factory of {@link FieldWriter} 22 | */ 23 | public interface FieldWriterFactory extends Function { 24 | } 25 | -------------------------------------------------------------------------------- /artemis-core/src/main/java/org/jnosql/artemis/reflection/InstanceSupplier.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.reflection; 16 | 17 | import java.util.function.Supplier; 18 | 19 | /** 20 | * A piece of operations within a class. This class does the new instance creation. 21 | */ 22 | public interface InstanceSupplier extends Supplier { 23 | 24 | } 25 | -------------------------------------------------------------------------------- /artemis-core/src/main/java/org/jnosql/artemis/reflection/InstanceSupplierFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.reflection; 16 | 17 | import java.lang.reflect.Constructor; 18 | import java.util.function.Function; 19 | 20 | /** 21 | * A {@link InstanceSupplier} factory 22 | */ 23 | public interface InstanceSupplierFactory extends Function, InstanceSupplier> { 24 | } 25 | -------------------------------------------------------------------------------- /artemis-core/src/main/java/org/jnosql/artemis/reflection/JavaFileObject.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.reflection; 16 | 17 | 18 | import java.net.URI; 19 | import javax.tools.SimpleJavaFileObject; 20 | 21 | final class JavaFileObject extends SimpleJavaFileObject { 22 | 23 | private final String javaSource; 24 | 25 | public JavaFileObject(String fullClassName, String javaSource) { 26 | super(URI.create("string:///" + fullClassName.replace('.', '/') + Kind.SOURCE.extension), Kind.SOURCE); 27 | this.javaSource = javaSource; 28 | } 29 | 30 | @Override 31 | public String getCharContent(boolean ignoreEncodingErrors) { 32 | return javaSource; 33 | } 34 | 35 | } -------------------------------------------------------------------------------- /artemis-core/src/main/java/org/jnosql/artemis/reflection/ReflectionFieldReaderFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.reflection; 16 | 17 | import javax.inject.Inject; 18 | import java.lang.reflect.Field; 19 | import java.util.Objects; 20 | 21 | class ReflectionFieldReaderFactory implements FieldReaderFactory { 22 | 23 | private Reflections reflections; 24 | 25 | @Inject 26 | ReflectionFieldReaderFactory(Reflections reflections) { 27 | this.reflections = reflections; 28 | } 29 | 30 | ReflectionFieldReaderFactory() { 31 | } 32 | 33 | @Override 34 | public FieldReader apply(Field field) { 35 | Objects.requireNonNull(field, "field is required"); 36 | return bean -> reflections.getValue(bean, field); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /artemis-core/src/main/java/org/jnosql/artemis/reflection/ReflectionFieldWriterFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.reflection; 16 | 17 | import javax.inject.Inject; 18 | import java.lang.reflect.Field; 19 | 20 | class ReflectionFieldWriterFactory implements FieldWriterFactory { 21 | 22 | 23 | private Reflections reflections; 24 | 25 | @Inject 26 | public ReflectionFieldWriterFactory(Reflections reflections) { 27 | this.reflections = reflections; 28 | } 29 | 30 | ReflectionFieldWriterFactory() { 31 | } 32 | 33 | @Override 34 | public FieldWriter apply(Field field) { 35 | return (bean, value) -> reflections.setValue(bean, field, value); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /artemis-core/src/main/java/org/jnosql/artemis/reflection/ReflectionInstanceSupplier.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.reflection; 16 | 17 | import java.lang.reflect.Constructor; 18 | 19 | class ReflectionInstanceSupplier implements InstanceSupplier { 20 | 21 | private final Reflections reflections; 22 | 23 | private final Constructor constructor; 24 | 25 | public ReflectionInstanceSupplier(Reflections reflections, Constructor constructor) { 26 | this.reflections = reflections; 27 | this.constructor = constructor; 28 | } 29 | 30 | @Override 31 | public Object get() { 32 | return reflections.newInstance(constructor); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /artemis-core/src/main/java/org/jnosql/artemis/reflection/ReflectionInstanceSupplierFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.reflection; 16 | 17 | import javax.inject.Inject; 18 | import java.lang.reflect.Constructor; 19 | 20 | class ReflectionInstanceSupplierFactory implements InstanceSupplierFactory { 21 | 22 | private Reflections reflections; 23 | 24 | @Inject 25 | ReflectionInstanceSupplierFactory(Reflections reflections) { 26 | this.reflections = reflections; 27 | } 28 | 29 | ReflectionInstanceSupplierFactory() { 30 | } 31 | 32 | @Override 33 | public InstanceSupplier apply(Constructor constructor) { 34 | return () -> reflections.newInstance(constructor); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /artemis-core/src/main/java/org/jnosql/artemis/reflection/StringFormatter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.reflection; 16 | 17 | 18 | import java.text.MessageFormat; 19 | 20 | enum StringFormatter { 21 | 22 | INSTANCE; 23 | 24 | 25 | public String format(String template, Object... params) { 26 | return MessageFormat.format(template, params); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /artemis-core/src/main/java/org/jnosql/artemis/reflection/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | /** 16 | * This package contains all reflections utils, the 17 | * mapping of Field and class and also the extension to load all entity. 18 | */ 19 | package org.jnosql.artemis.reflection; -------------------------------------------------------------------------------- /artemis-core/src/main/java/org/jnosql/artemis/util/AnnotationLiteralUtil.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.util; 16 | 17 | import javax.enterprise.inject.Default; 18 | import javax.enterprise.util.AnnotationLiteral; 19 | 20 | /** 21 | * Utilitarian class to Annotation Literal 22 | */ 23 | public final class AnnotationLiteralUtil { 24 | 25 | /** 26 | * Annotaion literal default 27 | */ 28 | public static final AnnotationLiteral DEFAULT_ANNOTATION = new AnnotationLiteral() { 29 | }; 30 | 31 | private AnnotationLiteralUtil() { 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /artemis-core/src/main/java/org/jnosql/artemis/util/StringUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.util; 16 | 17 | public final class StringUtils { 18 | 19 | private StringUtils() { 20 | } 21 | 22 | public static boolean isBlank(final CharSequence cs) { 23 | if (cs == null || cs.length() == 0) { 24 | return true; 25 | } 26 | 27 | for (int i = 0; i < cs.length(); i++) { 28 | if (!Character.isWhitespace(cs.charAt(i))) { 29 | return false; 30 | } 31 | } 32 | return true; 33 | } 34 | 35 | public static boolean isNotBlank(final CharSequence cs) { 36 | return !isBlank(cs); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /artemis-core/src/main/resources/FieldReader.tempalte: -------------------------------------------------------------------------------- 1 | package {0}; 2 | 3 | import org.jnosql.artemis.reflection.FieldReader; 4 | 5 | public class {1} implements FieldReader '{' 6 | @Override 7 | public Object read(Object bean) '{' 8 | return {2}.class.cast(bean).{3}(); 9 | '}' 10 | '}' -------------------------------------------------------------------------------- /artemis-core/src/main/resources/FieldWriter.template: -------------------------------------------------------------------------------- 1 | package {0}; 2 | 3 | import org.jnosql.artemis.reflection.FieldWriter; 4 | 5 | public class {1} implements FieldWriter '{' 6 | 7 | @Override 8 | public void write(Object bean, Object value) '{' 9 | {2}.class.cast(bean).{3}(({4}) value); 10 | 11 | '}' 12 | '}' -------------------------------------------------------------------------------- /artemis-core/src/main/resources/InstanceSupplier.template: -------------------------------------------------------------------------------- 1 | package {0}; 2 | 3 | import org.jnosql.artemis.reflection.InstanceSupplier; 4 | 5 | public class {1} implements InstanceSupplier '{' 6 | @Override 7 | public Object get() '{' 8 | return new {2}(); 9 | '}' 10 | } -------------------------------------------------------------------------------- /artemis-core/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 15 | 16 | 21 | -------------------------------------------------------------------------------- /artemis-core/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017 Otávio Santana and others 3 | # All rights reserved. This program and the accompanying materials 4 | # are made available under the terms of the Eclipse Public License v1.0 5 | # and Apache License v2.0 which accompanies this distribution. 6 | # The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | # and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | # 9 | # You may elect to redistribute this code under either of these licenses. 10 | # 11 | # Contributors: 12 | # 13 | # Otavio Santana 14 | # 15 | 16 | org.jnosql.artemis.reflection.ClassMappingExtension -------------------------------------------------------------------------------- /artemis-core/src/test/java/org/jnosql/artemis/model/ContactType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.model; 16 | 17 | public enum ContactType { 18 | MOBILE, PHONE, EMAIL 19 | } 20 | -------------------------------------------------------------------------------- /artemis-core/src/test/java/org/jnosql/artemis/model/Machine.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.model; 16 | 17 | 18 | import org.jnosql.artemis.Column; 19 | 20 | public class Machine { 21 | 22 | @Column 23 | private String name; 24 | 25 | public String getName() { 26 | return name; 27 | } 28 | 29 | public void setName(String name) { 30 | this.name = name; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /artemis-core/src/test/java/org/jnosql/artemis/model/MoneyConverter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.model; 16 | 17 | 18 | import org.jnosql.artemis.AttributeConverter; 19 | 20 | public class MoneyConverter implements AttributeConverter{ 21 | 22 | 23 | @Override 24 | public String convertToDatabaseColumn(Money attribute) { 25 | return attribute.toString(); 26 | } 27 | 28 | @Override 29 | public Money convertToEntityAttribute(String dbData) { 30 | return Money.parse(dbData); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /artemis-core/src/test/java/org/jnosql/artemis/reflection/Faa.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.reflection; 16 | 17 | public class Faa { 18 | 19 | Faa() { 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /artemis-core/src/test/java/org/jnosql/artemis/reflection/Foo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.reflection; 16 | 17 | public class Foo { 18 | 19 | private String bar; 20 | 21 | private String bar2 = "bar2"; 22 | 23 | private String bar3 = "bar3"; 24 | 25 | public String getBar() { 26 | return bar; 27 | } 28 | 29 | public void setBar(String bar) { 30 | this.bar = bar; 31 | } 32 | 33 | String getBar2() { 34 | return bar2; 35 | } 36 | 37 | void setBar2(String bar2) { 38 | this.bar2 = bar2; 39 | } 40 | 41 | String getBar3() { 42 | return bar3; 43 | } 44 | 45 | void setBar3(String bar3) { 46 | this.bar3 = bar3; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /artemis-core/src/test/java/org/jnosql/artemis/reflection/JavaCompilerFacadeTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.reflection; 16 | 17 | import org.junit.jupiter.api.Assertions; 18 | import org.junit.jupiter.api.Test; 19 | 20 | import java.util.stream.Stream; 21 | 22 | public class JavaCompilerFacadeTest { 23 | 24 | @Test 25 | public void shouldCreateGetterClass() { 26 | Stream.of(Foo.class.getDeclaredConstructors()).forEach(c -> c.setAccessible(true)); 27 | Foo foo = new Foo(); 28 | foo.setBar("bar"); 29 | JavaCompilerBeanPropertyReaderFactory factory = new JavaCompilerBeanPropertyReaderFactory(); 30 | ReadFromGetterMethod propertyReader = factory.generate(Foo.class, "bar"); 31 | Object bar = propertyReader.apply(foo); 32 | Assertions.assertEquals("bar", bar); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /artemis-core/src/test/java/org/jnosql/artemis/reflection/ReadFromGetterMethod.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.reflection; 16 | 17 | import java.util.function.Function; 18 | 19 | public interface ReadFromGetterMethod extends Function { 20 | 21 | } 22 | -------------------------------------------------------------------------------- /artemis-core/src/test/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 15 | 16 | 21 | -------------------------------------------------------------------------------- /artemis-core/src/test/resources/META-INF/column.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "description":"that is the description", 4 | "name":"name", 5 | "provider":"org.jnosql.artemis.column.ColumnFamilyManagerMock", 6 | "settings":{ 7 | "key":"value", 8 | "key2":"value2" 9 | 10 | } 11 | }, 12 | { 13 | "description":"that is the description", 14 | "name":"name-2", 15 | "provider":"org.jnosql.artemis.column.ColumnFamilyManagerMock", 16 | "settings":{ 17 | "key":"value", 18 | "key2":"value2", 19 | "key3":"value3" 20 | } 21 | } 22 | ] -------------------------------------------------------------------------------- /artemis-core/src/test/resources/META-INF/document.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "description":"that is the description", 4 | "name":"name", 5 | "provider":"org.jnosql.artemis.document.DocumentCollectionManagerMock", 6 | "settings":{ 7 | "key":"value", 8 | "key2":"value2" 9 | 10 | } 11 | }, 12 | { 13 | "description":"that is the description", 14 | "name":"name-2", 15 | "provider":"org.jnosql.artemis.document.DocumentCollectionManagerMock", 16 | "settings":{ 17 | "key":"value", 18 | "key2":"value2", 19 | "key3":"value3" 20 | } 21 | } 22 | ] -------------------------------------------------------------------------------- /artemis-core/src/test/resources/META-INF/invalid-class.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "name", 4 | "description": "that is the description", 5 | "provider": "java.util.Collection", 6 | "settings": { 7 | "key": "value" 8 | } 9 | }, 10 | { 11 | "name": "name-1", 12 | "description": "that is the description", 13 | "provider": "java.invalid.Collection", 14 | "settings": { 15 | "key": "value" 16 | } 17 | }, 18 | { 19 | "name": "name-2", 20 | "description": "that is the description", 21 | "provider": "org.jnosql.artemis.configuration.InvalidConfiguration", 22 | "settings": { 23 | "key": "value" 24 | } 25 | } 26 | ] -------------------------------------------------------------------------------- /artemis-core/src/test/resources/META-INF/invalid.json: -------------------------------------------------------------------------------- 1 | invalid-json -------------------------------------------------------------------------------- /artemis-core/src/test/resources/META-INF/jnosql-2.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "description": "that is the description", 4 | "name": "name", 5 | "provider": "org.jnosql.artemis.configuration.DefaultMockConfiguration", 6 | "settings": { 7 | "key": "value", 8 | "key2": "value2" 9 | } 10 | } 11 | ] -------------------------------------------------------------------------------- /artemis-core/src/test/resources/META-INF/jnosql.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "description":"that is the description", 4 | "name":"name", 5 | "provider":"org.jnosql.artemis.configuration.DefaultMockConfiguration", 6 | "settings":{ 7 | "key":"value", 8 | "key2":"value2" 9 | 10 | } 11 | }, 12 | { 13 | "description":"that is the description", 14 | "name":"name-2", 15 | "provider":"org.jnosql.artemis.configuration.DefaultMockConfiguration", 16 | "settings":{ 17 | "key":"value", 18 | "key2":"value2", 19 | "key3":"value3" 20 | } 21 | } 22 | ] -------------------------------------------------------------------------------- /artemis-core/src/test/resources/META-INF/jnosql.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | that is the description 19 | name 20 | org.jnosql.artemis.configuration.DefaultMockConfiguration 21 | 22 | 23 | key2 24 | value2 25 | 26 | 27 | key 28 | value 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /artemis-core/src/test/resources/META-INF/key-value.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "description":"that is the description", 4 | "name":"name", 5 | "provider":"org.jnosql.artemis.key.KeyValueConfigurationMock", 6 | "settings":{ 7 | "key":"value", 8 | "key2":"value2" 9 | 10 | } 11 | }, 12 | { 13 | "description":"that is the description", 14 | "name":"name-2", 15 | "provider":"org.jnosql.artemis.key.KeyValueConfigurationMock", 16 | "settings":{ 17 | "key":"value", 18 | "key2":"value2", 19 | "key3":"value3" 20 | } 21 | } 22 | ] -------------------------------------------------------------------------------- /artemis-document/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | pom.xml.tag 3 | pom.xml.releaseBackup 4 | pom.xml.versionsBackup 5 | pom.xml.next 6 | test-output/ 7 | /doc 8 | *.iml 9 | *.log 10 | .classpath 11 | -project 12 | /.resourceCache 13 | /.project 14 | /.idea 15 | .settings/ 16 | -------------------------------------------------------------------------------- /artemis-document/src/main/java/org/jnosql/artemis/document/DocumentDeleteQueryExecute.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.document; 16 | 17 | 18 | import org.jnosql.diana.api.document.DocumentDeleteQuery; 19 | 20 | /** 21 | * When a document delete query is executed this event if fired 22 | */ 23 | public interface DocumentDeleteQueryExecute { 24 | 25 | /** 26 | * The DocumentQuery before executed 27 | * 28 | * @return the {@link DocumentDeleteQuery} 29 | */ 30 | DocumentDeleteQuery getQuery(); 31 | 32 | 33 | /** 34 | * Returns a DocumentDeleteQuery instance 35 | * 36 | * @param query the query 37 | * @return a DocumentDeleteQuery instance 38 | */ 39 | static DocumentDeleteQueryExecute of(DocumentDeleteQuery query) { 40 | return new DefaultDocumentDeleteQueryExecute(query); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /artemis-document/src/main/java/org/jnosql/artemis/document/DocumentFieldConverter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.document; 16 | 17 | import org.jnosql.artemis.reflection.FieldMapping; 18 | import org.jnosql.diana.api.document.Document; 19 | 20 | import java.util.List; 21 | import java.util.Optional; 22 | 23 | interface DocumentFieldConverter { 24 | 25 | void convert(T instance, List documents, Optional document, FieldMapping field, 26 | AbstractDocumentEntityConverter converter); 27 | } 28 | -------------------------------------------------------------------------------- /artemis-document/src/main/java/org/jnosql/artemis/document/DocumentFieldValue.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.document; 16 | 17 | import org.jnosql.artemis.Converters; 18 | import org.jnosql.artemis.reflection.FieldValue; 19 | import org.jnosql.diana.api.document.Document; 20 | 21 | import java.util.List; 22 | 23 | /** 24 | * The specialist {@link FieldValue} to document 25 | */ 26 | public interface DocumentFieldValue extends FieldValue { 27 | 28 | List toDocument(DocumentEntityConverter converter, Converters converters); 29 | } 30 | -------------------------------------------------------------------------------- /artemis-document/src/main/java/org/jnosql/artemis/document/DocumentQueryExecute.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.document; 16 | 17 | 18 | import org.jnosql.diana.api.document.DocumentQuery; 19 | 20 | /** 21 | * When a document query is executed this event if fired 22 | */ 23 | public interface DocumentQueryExecute { 24 | 25 | 26 | /** 27 | * The ColumnQuery before executed 28 | * 29 | * @return the {@link DocumentQuery} 30 | */ 31 | DocumentQuery getQuery(); 32 | 33 | 34 | /** 35 | * Returns a DocumentQueryExecute instance 36 | * 37 | * @param query the query 38 | * @return a DocumentQueryExecute instance 39 | */ 40 | static DocumentQueryExecute of(DocumentQuery query) { 41 | return new DefaultDocumentQueryExecute(query); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /artemis-document/src/main/java/org/jnosql/artemis/document/DocumentRepositoryAsyncSupplier.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.document; 16 | 17 | import org.jnosql.artemis.RepositoryAsync; 18 | 19 | import java.util.function.Supplier; 20 | 21 | /** 22 | * A supplier to {@link RepositoryAsync} that implements document, that injects from {@link org.jnosql.artemis.ConfigurationUnit} 23 | * 24 | * @param a repository type 25 | */ 26 | public interface DocumentRepositoryAsyncSupplier> extends Supplier { 27 | } 28 | -------------------------------------------------------------------------------- /artemis-document/src/main/java/org/jnosql/artemis/document/DocumentRepositorySupplier.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.document; 16 | 17 | import org.jnosql.artemis.Repository; 18 | 19 | import java.util.function.Supplier; 20 | 21 | /** 22 | * A supplier to {@link Repository} that implements document, that injects from {@link org.jnosql.artemis.ConfigurationUnit} 23 | * 24 | * @param a repository type 25 | */ 26 | public interface DocumentRepositorySupplier > extends Supplier { 27 | } 28 | -------------------------------------------------------------------------------- /artemis-document/src/main/java/org/jnosql/artemis/document/DocumentTemplateAsyncProducer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.document; 16 | 17 | 18 | import org.jnosql.diana.api.document.DocumentCollectionManagerAsync; 19 | 20 | 21 | /** 22 | * The producer of {@link DocumentTemplateAsync} 23 | */ 24 | public interface DocumentTemplateAsyncProducer { 25 | 26 | /** 27 | * creates a {@link DocumentTemplate} 28 | * 29 | * @param the DocumentTemplateAsync instance 30 | * @param collectionManager the collectionManager 31 | * @return a new instance 32 | * @throws NullPointerException when collectionManager is null 33 | */ 34 | T get(DocumentCollectionManagerAsync collectionManager); 35 | 36 | } 37 | -------------------------------------------------------------------------------- /artemis-document/src/main/java/org/jnosql/artemis/document/DocumentTemplateProducer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.document; 16 | 17 | 18 | import org.jnosql.diana.api.document.DocumentCollectionManager; 19 | 20 | 21 | /** 22 | * The producer of {@link DocumentTemplate} 23 | */ 24 | public interface DocumentTemplateProducer { 25 | 26 | /** 27 | * creates a {@link DocumentTemplate} 28 | * 29 | * @param the DocumentTemplate instance 30 | * @param collectionManager the collectionManager 31 | * @return a new instance 32 | * @throws NullPointerException when collectionManager is null 33 | */ 34 | T get(DocumentCollectionManager collectionManager); 35 | 36 | } 37 | -------------------------------------------------------------------------------- /artemis-document/src/main/java/org/jnosql/artemis/document/query/DocumentMapperDeleteFrom.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (c) 2017 Otávio Santana and others 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Apache License v2.0 which accompanies this distribution. 7 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 8 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 9 | * 10 | * You may elect to redistribute this code under either of these licenses. 11 | * 12 | * Contributors: 13 | * 14 | * Otavio Santana 15 | * 16 | */ 17 | package org.jnosql.artemis.document.query; 18 | 19 | 20 | /** 21 | * The Document Delete Query 22 | */ 23 | public interface DocumentMapperDeleteFrom extends DocumentMapperDeleteQueryBuild { 24 | /** 25 | * Starts a new condition defining the column name 26 | * 27 | * @param name the column name 28 | * @return a new {@link DocumentMapperDeleteNameCondition} 29 | * @throws NullPointerException when name is null 30 | */ 31 | DocumentMapperDeleteNameCondition where(String name); 32 | } 33 | -------------------------------------------------------------------------------- /artemis-document/src/main/java/org/jnosql/artemis/document/query/DocumentMapperDeleteNotCondition.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.document.query; 16 | 17 | 18 | /** 19 | * The document not condition 20 | */ 21 | public interface DocumentMapperDeleteNotCondition extends DocumentMapperDeleteNameCondition { 22 | } 23 | -------------------------------------------------------------------------------- /artemis-document/src/main/java/org/jnosql/artemis/document/query/DocumentMapperLimit.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (c) 2017 Otávio Santana and others 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Apache License v2.0 which accompanies this distribution. 7 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 8 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 9 | * 10 | * You may elect to redistribute this code under either of these licenses. 11 | * 12 | * Contributors: 13 | * 14 | * Otavio Santana 15 | * 16 | */ 17 | package org.jnosql.artemis.document.query; 18 | 19 | /** 20 | * The Document Order whose define the the maximum number of results to retrieve. 21 | */ 22 | public interface DocumentMapperLimit extends DocumentMapperQueryBuild { 23 | 24 | /** 25 | * Defines the position of the first result to retrieve. 26 | * 27 | * @param skip the first result to retrive 28 | * @return a query with first result defined 29 | */ 30 | DocumentMapperSkip skip(long skip); 31 | } 32 | -------------------------------------------------------------------------------- /artemis-document/src/main/java/org/jnosql/artemis/document/query/DocumentMapperNotCondition.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (c) 2017 Otávio Santana and others 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Apache License v2.0 which accompanies this distribution. 7 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 8 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 9 | * 10 | * You may elect to redistribute this code under either of these licenses. 11 | * 12 | * Contributors: 13 | * 14 | * Otavio Santana 15 | * 16 | */ 17 | package org.jnosql.artemis.document.query; 18 | 19 | /** 20 | * The column not condition 21 | */ 22 | public interface DocumentMapperNotCondition extends DocumentMapperNameCondition { 23 | } 24 | -------------------------------------------------------------------------------- /artemis-document/src/main/java/org/jnosql/artemis/document/query/DocumentMapperOrder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (c) 2017 Otávio Santana and others 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Apache License v2.0 which accompanies this distribution. 7 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 8 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 9 | * 10 | * You may elect to redistribute this code under either of these licenses. 11 | * 12 | * Contributors: 13 | * 14 | * Otavio Santana 15 | * 16 | */ 17 | package org.jnosql.artemis.document.query; 18 | 19 | 20 | /** 21 | * The Document Order whose define the sort in the query. 22 | */ 23 | public interface DocumentMapperOrder { 24 | 25 | /** 26 | * Defines the order as {@link org.jnosql.diana.api.Sort.SortType#ASC} 27 | * @return the {@link DocumentMapperNameOrder} instance 28 | */ 29 | DocumentMapperNameOrder asc(); 30 | 31 | /** 32 | * Defines the order as {@link org.jnosql.diana.api.Sort.SortType#DESC} 33 | * @return the {@link DocumentMapperNameOrder} instance 34 | */ 35 | DocumentMapperNameOrder desc(); 36 | } 37 | -------------------------------------------------------------------------------- /artemis-document/src/main/java/org/jnosql/artemis/document/query/DocumentMapperSkip.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (c) 2017 Otávio Santana and others 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License v1.0 6 | * and Apache License v2.0 which accompanies this distribution. 7 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 8 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 9 | * 10 | * You may elect to redistribute this code under either of these licenses. 11 | * 12 | * Contributors: 13 | * 14 | * Otavio Santana 15 | * 16 | */ 17 | package org.jnosql.artemis.document.query; 18 | 19 | /** 20 | * The Document Order whose define the position of the first result to retrieve. 21 | */ 22 | public interface DocumentMapperSkip extends DocumentMapperQueryBuild { 23 | 24 | /** 25 | * Defines the maximum number of results to retrieve. 26 | * 27 | * @param limit the limit 28 | * @return a query with the limit defined 29 | */ 30 | DocumentMapperLimit limit(long limit); 31 | } 32 | -------------------------------------------------------------------------------- /artemis-document/src/main/java/org/jnosql/artemis/document/query/DocumentTokenProcessor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.document.query; 16 | 17 | import org.jnosql.artemis.Converters; 18 | import org.jnosql.artemis.reflection.ClassMapping; 19 | import org.jnosql.diana.api.document.DocumentCondition; 20 | 21 | interface DocumentTokenProcessor { 22 | 23 | DocumentCondition process(String token, 24 | int index, 25 | Object[] args, 26 | String methodName, 27 | ClassMapping mapping, 28 | Converters converters); 29 | } 30 | -------------------------------------------------------------------------------- /artemis-document/src/main/java/org/jnosql/artemis/document/query/RepositoryDocumentObserverParser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.document.query; 16 | 17 | import org.jnosql.artemis.reflection.ClassMapping; 18 | import org.jnosql.diana.api.document.DocumentObserverParser; 19 | 20 | import java.util.Optional; 21 | 22 | public class RepositoryDocumentObserverParser implements DocumentObserverParser { 23 | 24 | private final ClassMapping classMapping; 25 | 26 | RepositoryDocumentObserverParser(ClassMapping classMapping) { 27 | this.classMapping = classMapping; 28 | } 29 | 30 | @Override 31 | public String fireEntity(String entity) { 32 | return classMapping.getName(); 33 | } 34 | 35 | @Override 36 | public String fireField(String entity, String field) { 37 | return Optional.ofNullable(classMapping.getColumnField(field)).orElse(field); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /artemis-document/src/main/java/org/jnosql/artemis/document/query/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | 16 | /** 17 | * This package has the implementation to dynamic query to both {@link org.jnosql.artemis.Repository} 18 | * and {@link org.jnosql.artemis.RepositoryAsync} on document database. 19 | */ 20 | package org.jnosql.artemis.document.query; -------------------------------------------------------------------------------- /artemis-document/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 15 | 16 | 21 | -------------------------------------------------------------------------------- /artemis-document/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017 Otávio Santana and others 3 | # All rights reserved. This program and the accompanying materials 4 | # are made available under the terms of the Eclipse Public License v1.0 5 | # and Apache License v2.0 which accompanies this distribution. 6 | # The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | # and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | # 9 | # You may elect to redistribute this code under either of these licenses. 10 | # 11 | # Contributors: 12 | # 13 | # Otavio Santana 14 | # 15 | org.jnosql.artemis.document.spi.DocumentCollectionProducerExtension -------------------------------------------------------------------------------- /artemis-document/src/test/java/org/jnosql/artemis/IgnoreRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis; 16 | 17 | 18 | public interface IgnoreRepository extends Repository { 19 | } 20 | -------------------------------------------------------------------------------- /artemis-document/src/test/java/org/jnosql/artemis/IgnoreRepositoryAsync.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis; 16 | 17 | 18 | public interface IgnoreRepositoryAsync extends RepositoryAsync { 19 | } 20 | -------------------------------------------------------------------------------- /artemis-document/src/test/java/org/jnosql/artemis/PersonIgnoreRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis; 16 | 17 | import org.jnosql.artemis.model.Person; 18 | 19 | 20 | public interface PersonIgnoreRepository extends IgnoreRepository{ 21 | } 22 | -------------------------------------------------------------------------------- /artemis-document/src/test/java/org/jnosql/artemis/PersonRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis; 16 | 17 | 18 | import org.jnosql.artemis.model.Person; 19 | 20 | public interface PersonRepository extends Repository { 21 | } 22 | -------------------------------------------------------------------------------- /artemis-document/src/test/java/org/jnosql/artemis/PersonRepositoryAsync.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis; 16 | 17 | 18 | import org.jnosql.artemis.model.Person; 19 | 20 | public interface PersonRepositoryAsync extends RepositoryAsync { 21 | } 22 | -------------------------------------------------------------------------------- /artemis-document/src/test/java/org/jnosql/artemis/UserRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis; 16 | 17 | 18 | import org.jnosql.artemis.model.User; 19 | 20 | public interface UserRepository extends Repository { 21 | } 22 | -------------------------------------------------------------------------------- /artemis-document/src/test/java/org/jnosql/artemis/document/DocumentEntityPostPersistTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.document; 16 | 17 | import org.jnosql.diana.api.document.DocumentEntity; 18 | import org.junit.jupiter.api.Assertions; 19 | import org.junit.jupiter.api.Test; 20 | 21 | import static org.junit.jupiter.api.Assertions.assertEquals; 22 | 23 | 24 | public class DocumentEntityPostPersistTest { 25 | 26 | @Test 27 | public void shouldReturnNPEWhenEntityIsNull() { 28 | Assertions.assertThrows(NullPointerException.class, () -> DocumentEntityPostPersist.of(null)); 29 | } 30 | 31 | @Test 32 | public void shouldReturnInstance() { 33 | DocumentEntity entity = DocumentEntity.of("collection"); 34 | DocumentEntityPostPersist postPersist = DocumentEntityPostPersist.of(entity); 35 | assertEquals(entity, postPersist.getEntity()); 36 | } 37 | } -------------------------------------------------------------------------------- /artemis-document/src/test/java/org/jnosql/artemis/document/DocumentEntityPrePersistTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.document; 16 | 17 | import org.jnosql.diana.api.document.DocumentEntity; 18 | import org.junit.jupiter.api.Assertions; 19 | import org.junit.jupiter.api.Test; 20 | 21 | import static org.junit.jupiter.api.Assertions.assertEquals; 22 | 23 | 24 | public class DocumentEntityPrePersistTest { 25 | 26 | @Test 27 | public void shouldReturnNPEWhenEntityIsNull() { 28 | Assertions.assertThrows(NullPointerException.class, () -> DocumentEntityPrePersist.of(null)); 29 | } 30 | 31 | @Test 32 | public void shouldReturnInstance() { 33 | DocumentEntity entity = DocumentEntity.of("collection"); 34 | DocumentEntityPrePersist prePersist = DocumentEntityPrePersist.of(entity); 35 | assertEquals(entity, prePersist.getEntity()); 36 | } 37 | } -------------------------------------------------------------------------------- /artemis-document/src/test/java/org/jnosql/artemis/model/ContactType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.model; 16 | 17 | public enum ContactType { 18 | MOBILE, PHONE, EMAIL 19 | } 20 | -------------------------------------------------------------------------------- /artemis-document/src/test/java/org/jnosql/artemis/model/Machine.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.model; 16 | 17 | 18 | import org.jnosql.artemis.Column; 19 | 20 | public class Machine { 21 | 22 | @Column 23 | private String name; 24 | 25 | public String getName() { 26 | return name; 27 | } 28 | 29 | public void setName(String name) { 30 | this.name = name; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /artemis-document/src/test/java/org/jnosql/artemis/model/MoneyConverter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.model; 16 | 17 | 18 | import org.jnosql.artemis.AttributeConverter; 19 | 20 | public class MoneyConverter implements AttributeConverter{ 21 | 22 | 23 | @Override 24 | public String convertToDatabaseColumn(Money attribute) { 25 | return attribute.toString(); 26 | } 27 | 28 | @Override 29 | public Money convertToEntityAttribute(String dbData) { 30 | return Money.parse(dbData); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /artemis-document/src/test/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 15 | 16 | 21 | -------------------------------------------------------------------------------- /artemis-document/src/test/resources/META-INF/document.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "description":"that is the description", 4 | "name":"name", 5 | "provider":"org.jnosql.artemis.document.DocumentCollectionManagerMock", 6 | "settings":{ 7 | "key":"value", 8 | "key2":"value2" 9 | 10 | } 11 | }, 12 | { 13 | "description":"that is the description", 14 | "name":"name-2", 15 | "provider":"org.jnosql.artemis.document.DocumentCollectionManagerMock", 16 | "settings":{ 17 | "key":"value", 18 | "key2":"value2", 19 | "key3":"value3" 20 | } 21 | } 22 | ] -------------------------------------------------------------------------------- /artemis-graph/src/main/java/org/jnosql/artemis/graph/EdgeRepeatStepTraversal.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.graph; 16 | 17 | /** 18 | * After the {@link EdgeRepeatTraversal} condition the next step is 19 | * {@link EdgeRepeatStepTraversal#times(int)} and {@link EdgeRepeatStepTraversal#until()} 20 | */ 21 | public interface EdgeRepeatStepTraversal { 22 | 23 | /** 24 | * Starts a loop traversal n times 25 | * @param times the repeat times that is required 26 | * @return a {@link EdgeTraversal} instance 27 | */ 28 | EdgeTraversal times(int times); 29 | 30 | /** 31 | * Define the loop traversal until a defined condition 32 | * @return {@link EdgeUntilTraversal} 33 | */ 34 | EdgeUntilTraversal until(); 35 | 36 | } 37 | -------------------------------------------------------------------------------- /artemis-graph/src/main/java/org/jnosql/artemis/graph/EdgeTraversalOrder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.graph; 16 | 17 | /** 18 | * The traversal order to Edge 19 | */ 20 | public interface EdgeTraversalOrder { 21 | 22 | /** 23 | * Defines the ascending order 24 | * @return the {@link EdgeTraversal} ordered ascending 25 | */ 26 | EdgeTraversal asc(); 27 | 28 | /** 29 | * Defines the descending order 30 | * @return the {@link EdgeTraversal} ordered descending 31 | */ 32 | EdgeTraversal desc(); 33 | } 34 | -------------------------------------------------------------------------------- /artemis-graph/src/main/java/org/jnosql/artemis/graph/EdgeUntilTraversal.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.graph; 16 | 17 | 18 | /** 19 | * The Edge until wrapper of 20 | * {@link org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal#until(java.util.function.Predicate)} 21 | */ 22 | public interface EdgeUntilTraversal extends EdgeConditionTraversal { 23 | } 24 | -------------------------------------------------------------------------------- /artemis-graph/src/main/java/org/jnosql/artemis/graph/GraphProducer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.graph; 16 | 17 | import org.apache.tinkerpop.gremlin.structure.Graph; 18 | import org.jnosql.diana.api.Settings; 19 | 20 | import java.util.function.Function; 21 | 22 | /** 23 | * The Producer of {@link Graph} that given a {@link Settings} make an {@link Graph} instance. 24 | */ 25 | public interface GraphProducer extends Function { 26 | } 27 | -------------------------------------------------------------------------------- /artemis-graph/src/main/java/org/jnosql/artemis/graph/GraphRepositoryProducer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.graph; 16 | 17 | import org.apache.tinkerpop.gremlin.structure.Graph; 18 | import org.jnosql.artemis.Repository; 19 | 20 | 21 | /** 22 | * The producer of {@link Repository} 23 | * 24 | */ 25 | public interface GraphRepositoryProducer { 26 | 27 | /** 28 | * Produces a Repository class from repository class and {@link Graph} 29 | * @param repositoryClass the repository class 30 | * @param graph the graph 31 | * @param the entity of repository 32 | * @param the ID of the entity 33 | * @param the repository type 34 | * @return a {@link Repository} interface 35 | * @throws NullPointerException when there is null parameter 36 | */ 37 | > T get(Class repositoryClass, Graph graph); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /artemis-graph/src/main/java/org/jnosql/artemis/graph/GraphRepositorySupplier.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.graph; 16 | 17 | import org.jnosql.artemis.Repository; 18 | 19 | import java.util.function.Supplier; 20 | 21 | /** 22 | * A supplier to {@link Repository} that implements graph, that injects from {@link org.jnosql.artemis.ConfigurationUnit} 23 | * 24 | * @param a repository type 25 | */ 26 | public interface GraphRepositorySupplier > extends Supplier { 27 | } 28 | -------------------------------------------------------------------------------- /artemis-graph/src/main/java/org/jnosql/artemis/graph/GraphTraversalSourceOperation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.graph; 16 | 17 | import javax.inject.Qualifier; 18 | import java.lang.annotation.Retention; 19 | import java.lang.annotation.Target; 20 | 21 | import static java.lang.annotation.ElementType.FIELD; 22 | import static java.lang.annotation.ElementType.PARAMETER; 23 | import static java.lang.annotation.ElementType.TYPE; 24 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 25 | 26 | /** 27 | * All Graph operation go through the Graph traversal e.g. the GraphConverter and GraphTemplate implementation will use 28 | * {@link org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource} in all operations. 29 | */ 30 | @Target({FIELD, TYPE, PARAMETER}) 31 | @Retention(RUNTIME) 32 | @Qualifier 33 | public @interface GraphTraversalSourceOperation { 34 | } 35 | -------------------------------------------------------------------------------- /artemis-graph/src/main/java/org/jnosql/artemis/graph/GraphTraversalSourceSupplier.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.graph; 16 | 17 | import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource; 18 | 19 | import java.util.function.Supplier; 20 | 21 | /** 22 | * A {@link Supplier} to {@link GraphTraversalSource} 23 | */ 24 | public interface GraphTraversalSourceSupplier extends Supplier { 25 | 26 | } 27 | -------------------------------------------------------------------------------- /artemis-graph/src/main/java/org/jnosql/artemis/graph/GremlinQueryException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.graph; 16 | 17 | import org.jnosql.diana.api.JNoSQLException; 18 | 19 | /** 20 | * An exception that provides information when executing Gremlin in the database. 21 | */ 22 | public class GremlinQueryException extends JNoSQLException { 23 | 24 | /** 25 | * A new instance with both the cause of the error and a message 26 | * 27 | * @param message the message 28 | * @param cause the cause 29 | */ 30 | public GremlinQueryException(String message, Throwable cause) { 31 | super(message, cause); 32 | } 33 | 34 | /** 35 | * A new instance with the message 36 | * 37 | * @param message the message 38 | */ 39 | public GremlinQueryException(String message) { 40 | super(message); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /artemis-graph/src/main/java/org/jnosql/artemis/graph/Transactional.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.graph; 16 | 17 | 18 | import javax.interceptor.InterceptorBinding; 19 | import java.lang.annotation.Retention; 20 | import java.lang.annotation.Target; 21 | 22 | import static java.lang.annotation.ElementType.METHOD; 23 | import static java.lang.annotation.ElementType.TYPE; 24 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 25 | 26 | /** 27 | * The Transactional annotation provides the application the ability to declaratively 28 | * control transaction boundaries on CDI managed beans. {@link org.apache.tinkerpop.gremlin.structure.Transaction} 29 | */ 30 | @InterceptorBinding 31 | @Target({METHOD, TYPE}) 32 | @Retention(RUNTIME) 33 | public @interface Transactional { 34 | } -------------------------------------------------------------------------------- /artemis-graph/src/main/java/org/jnosql/artemis/graph/VertexRepeatStepTraversal.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.graph; 16 | 17 | /** 18 | * After the {@link VertexRepeatTraversal} condition the next step is 19 | * {@link VertexRepeatStepTraversal#times(int)} and {@link VertexRepeatStepTraversal#until()} 20 | */ 21 | public interface VertexRepeatStepTraversal { 22 | 23 | /** 24 | * Starts a loop traversal n times 25 | * @param times the repeat times that is required 26 | * @return a {@link VertexTraversal} instance 27 | */ 28 | VertexTraversal times(int times); 29 | 30 | /** 31 | * Define the loop traversal until a defined condition 32 | * @return {@link VertexUntilTraversal} 33 | */ 34 | VertexUntilTraversal until(); 35 | } 36 | -------------------------------------------------------------------------------- /artemis-graph/src/main/java/org/jnosql/artemis/graph/VertexTraversalOrder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.graph; 16 | 17 | /** 18 | * The traversal order to Vertex 19 | */ 20 | public interface VertexTraversalOrder { 21 | 22 | /** 23 | * Defines the ascending order 24 | * @return the {@link VertexTraversal} ordered ascending 25 | */ 26 | VertexTraversal asc(); 27 | 28 | /** 29 | * Defines the descending order 30 | * @return the {@link VertexTraversal} ordered descending 31 | */ 32 | VertexTraversal desc(); 33 | } 34 | -------------------------------------------------------------------------------- /artemis-graph/src/main/java/org/jnosql/artemis/graph/VertexUntilTraversal.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.graph; 16 | 17 | /** 18 | * The Vertex until wrapper of 19 | * {@link org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal#until(java.util.function.Predicate)} 20 | */ 21 | public interface VertexUntilTraversal extends VertexConditionTraversal { 22 | } 23 | -------------------------------------------------------------------------------- /artemis-graph/src/main/java/org/jnosql/artemis/graph/query/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | 16 | /** 17 | * This package has the implementation to dynamic query to both {@link org.jnosql.artemis.Repository} 18 | * on Graph database. 19 | */ 20 | package org.jnosql.artemis.graph.query; -------------------------------------------------------------------------------- /artemis-graph/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 15 | 16 | 21 | -------------------------------------------------------------------------------- /artemis-graph/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017 Otávio Santana and others 3 | # All rights reserved. This program and the accompanying materials 4 | # are made available under the terms of the Eclipse Public License v1.0 5 | # and Apache License v2.0 which accompanies this distribution. 6 | # The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | # and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | # 9 | # You may elect to redistribute this code under either of these licenses. 10 | # 11 | # Contributors: 12 | # 13 | # Otavio Santana 14 | # 15 | org.jnosql.artemis.graph.spi.GraphProducerExtension -------------------------------------------------------------------------------- /artemis-graph/src/test/java/org/jnosql/artemis/graph/BookRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.graph; 16 | 17 | 18 | import org.jnosql.artemis.Repository; 19 | import org.jnosql.artemis.graph.model.Book; 20 | 21 | public interface BookRepository extends Repository { 22 | } 23 | -------------------------------------------------------------------------------- /artemis-graph/src/test/java/org/jnosql/artemis/graph/DefaultGraphConverterTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.graph; 16 | 17 | import org.apache.tinkerpop.gremlin.structure.Graph; 18 | import org.jnosql.artemis.graph.cdi.CDIExtension; 19 | import org.junit.jupiter.api.extension.ExtendWith; 20 | 21 | import javax.inject.Inject; 22 | 23 | 24 | @ExtendWith(CDIExtension.class) 25 | class DefaultGraphConverterTest extends AbstractGraphConverterTest{ 26 | 27 | @Inject 28 | private GraphConverter converter; 29 | 30 | @Inject 31 | private Graph graph; 32 | 33 | 34 | @Override 35 | protected Graph getGraph() { 36 | return graph; 37 | } 38 | 39 | @Override 40 | protected GraphConverter getConverter() { 41 | return converter; 42 | } 43 | } -------------------------------------------------------------------------------- /artemis-graph/src/test/java/org/jnosql/artemis/graph/DefaultGraphTraversalSourceConverterTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.graph; 16 | 17 | import org.apache.tinkerpop.gremlin.structure.Graph; 18 | import org.jnosql.artemis.graph.cdi.CDIExtension; 19 | import org.junit.jupiter.api.extension.ExtendWith; 20 | 21 | import javax.inject.Inject; 22 | 23 | @ExtendWith(CDIExtension.class) 24 | class DefaultGraphTraversalSourceConverterTest extends AbstractGraphConverterTest { 25 | 26 | @Inject 27 | @GraphTraversalSourceOperation 28 | private GraphConverter converter; 29 | 30 | @Inject 31 | private Graph graph; 32 | 33 | @Override 34 | protected Graph getGraph() { 35 | return graph; 36 | } 37 | 38 | @Override 39 | protected GraphConverter getConverter() { 40 | return converter; 41 | } 42 | } -------------------------------------------------------------------------------- /artemis-graph/src/test/java/org/jnosql/artemis/graph/DefaultGraphTraversalSourceTemplateTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.graph; 16 | 17 | import org.apache.tinkerpop.gremlin.structure.Graph; 18 | import org.jnosql.artemis.graph.cdi.CDIExtension; 19 | import org.junit.jupiter.api.extension.ExtendWith; 20 | 21 | import javax.inject.Inject; 22 | 23 | @ExtendWith(CDIExtension.class) 24 | class DefaultGraphTraversalSourceTemplateTest extends AbstractGraphTemplateTest { 25 | 26 | @Inject 27 | private GraphTemplate graphTemplate; 28 | 29 | @Inject 30 | private Graph graph; 31 | 32 | @Override 33 | protected Graph getGraph() { 34 | return graph; 35 | } 36 | 37 | @Override 38 | protected GraphTemplate getGraphTemplate() { 39 | return graphTemplate; 40 | } 41 | } -------------------------------------------------------------------------------- /artemis-graph/src/test/java/org/jnosql/artemis/graph/GraphRepositoryConfigurationTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.graph; 16 | 17 | 18 | import org.jnosql.artemis.graph.cdi.CDIExtension; 19 | import org.junit.jupiter.api.Test; 20 | import org.junit.jupiter.api.extension.ExtendWith; 21 | 22 | import javax.inject.Inject; 23 | 24 | import static org.junit.jupiter.api.Assertions.assertNotNull; 25 | 26 | @ExtendWith(CDIExtension.class) 27 | public class GraphRepositoryConfigurationTest { 28 | 29 | 30 | @Inject 31 | private RepositoryService services; 32 | 33 | @Test 34 | public void shouldRepository() { 35 | GraphRepositorySupplier supplier = services.getRepository(); 36 | assertNotNull(supplier); 37 | BookRepository repository = supplier.get(); 38 | assertNotNull(repository); 39 | 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /artemis-graph/src/test/java/org/jnosql/artemis/graph/GraphTemplateTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.graph; 16 | 17 | import org.apache.tinkerpop.gremlin.structure.Graph; 18 | import org.jnosql.artemis.graph.cdi.CDIExtension; 19 | import org.junit.jupiter.api.extension.ExtendWith; 20 | 21 | import javax.inject.Inject; 22 | 23 | @ExtendWith(CDIExtension.class) 24 | public class GraphTemplateTest extends AbstractGraphTemplateTest{ 25 | 26 | @Inject 27 | private GraphTemplate graphTemplate; 28 | 29 | @Inject 30 | private Graph graph; 31 | 32 | @Override 33 | protected Graph getGraph() { 34 | return graph; 35 | } 36 | 37 | @Override 38 | protected GraphTemplate getGraphTemplate() { 39 | return graphTemplate; 40 | } 41 | } -------------------------------------------------------------------------------- /artemis-graph/src/test/java/org/jnosql/artemis/graph/RepositoryService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.graph; 16 | 17 | import org.jnosql.artemis.ConfigurationUnit; 18 | 19 | import javax.enterprise.context.ApplicationScoped; 20 | import javax.inject.Inject; 21 | 22 | @ApplicationScoped 23 | public class RepositoryService { 24 | 25 | @Inject 26 | @ConfigurationUnit(fileName = "graph.json", name = "graphA", database = "database") 27 | private GraphRepositorySupplier repository; 28 | 29 | public GraphRepositorySupplier getRepository() { 30 | return repository; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /artemis-graph/src/test/java/org/jnosql/artemis/graph/model/BookTemplate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.graph.model; 16 | 17 | import org.jnosql.artemis.graph.GraphTemplate; 18 | import org.jnosql.artemis.graph.Transactional; 19 | 20 | import javax.inject.Inject; 21 | 22 | public class BookTemplate { 23 | 24 | @Inject 25 | private GraphTemplate graphTemplate; 26 | 27 | @Transactional 28 | public void insert(Book actor) { 29 | graphTemplate.insert(actor); 30 | } 31 | 32 | @Transactional 33 | public void insertException(Book actor) { 34 | graphTemplate.insert(actor); 35 | throw new NullPointerException("should get a rollback"); 36 | } 37 | 38 | public void normalInsertion(Book actor) { 39 | graphTemplate.insert(actor); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /artemis-graph/src/test/java/org/jnosql/artemis/graph/model/MoneyConverter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.graph.model; 16 | 17 | 18 | import org.jnosql.artemis.AttributeConverter; 19 | 20 | public class MoneyConverter implements AttributeConverter { 21 | 22 | 23 | @Override 24 | public String convertToDatabaseColumn(Money attribute) { 25 | return attribute.toString(); 26 | } 27 | 28 | @Override 29 | public Money convertToEntityAttribute(String dbData) { 30 | return Money.parse(dbData); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /artemis-graph/src/test/java/org/jnosql/artemis/graph/producer/GraphMockA.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.graph.producer; 16 | 17 | import org.jnosql.diana.api.Settings; 18 | 19 | public class GraphMockA extends AbstractGraphMock { 20 | 21 | public GraphMockA(Settings settings) { 22 | super(settings); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /artemis-graph/src/test/java/org/jnosql/artemis/graph/producer/GraphMockB.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.graph.producer; 16 | 17 | import org.jnosql.diana.api.Settings; 18 | 19 | public class GraphMockB extends AbstractGraphMock { 20 | 21 | public GraphMockB(Settings settings) { 22 | super(settings); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /artemis-graph/src/test/java/org/jnosql/artemis/graph/producer/GraphProducerA.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.graph.producer; 16 | 17 | import org.apache.tinkerpop.gremlin.structure.Graph; 18 | import org.jnosql.artemis.graph.GraphProducer; 19 | import org.jnosql.diana.api.Settings; 20 | 21 | public class GraphProducerA implements GraphProducer { 22 | 23 | 24 | @Override 25 | public Graph apply(Settings settings) { 26 | return new GraphMockA(settings); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /artemis-graph/src/test/java/org/jnosql/artemis/graph/producer/GraphProducerB.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.graph.producer; 16 | 17 | import org.apache.tinkerpop.gremlin.structure.Graph; 18 | import org.jnosql.artemis.graph.GraphProducer; 19 | import org.jnosql.diana.api.Settings; 20 | 21 | public class GraphProducerB implements GraphProducer { 22 | 23 | 24 | @Override 25 | public Graph apply(Settings settings) { 26 | return new GraphMockB(settings); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /artemis-graph/src/test/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 15 | 16 | 21 | -------------------------------------------------------------------------------- /artemis-graph/src/test/resources/META-INF/graph.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "description":"that is the description", 4 | "name":"graphA", 5 | "provider":"org.jnosql.artemis.graph.producer.GraphProducerA", 6 | "settings":{ 7 | "key":"valueA", 8 | "key2":"value2A" 9 | 10 | } 11 | }, 12 | { 13 | "description":"that is the description", 14 | "name":"graphB", 15 | "provider":"org.jnosql.artemis.graph.producer.GraphProducerB", 16 | "settings":{ 17 | "key":"valueB", 18 | "key2":"value2B" 19 | } 20 | } 21 | ] -------------------------------------------------------------------------------- /artemis-key-value/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | pom.xml.tag 3 | pom.xml.releaseBackup 4 | pom.xml.versionsBackup 5 | pom.xml.next 6 | test-output/ 7 | /doc 8 | *.iml 9 | *.log 10 | .classpath 11 | -project 12 | /.resourceCache 13 | /.project 14 | /.idea 15 | .settings/ 16 | -------------------------------------------------------------------------------- /artemis-key-value/src/main/java/org/jnosql/artemis/key/DefaultKeyValueEntityConverter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.key; 16 | 17 | import org.jnosql.artemis.reflection.ClassMappings; 18 | 19 | import javax.inject.Inject; 20 | 21 | /** 22 | * The default implementation of {@link KeyValueEntityConverter} 23 | */ 24 | class DefaultKeyValueEntityConverter extends AbstractKeyValueEntityConverter implements KeyValueEntityConverter { 25 | 26 | @Inject 27 | private ClassMappings classMappings; 28 | 29 | @Override 30 | protected ClassMappings getClassMappings() { 31 | return classMappings; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /artemis-key-value/src/main/java/org/jnosql/artemis/key/KeyRepositorySupplier.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.key; 16 | 17 | import org.jnosql.artemis.Repository; 18 | 19 | import java.util.function.Supplier; 20 | 21 | /** 22 | * A supplier to Repository that implements key-value. 23 | * 24 | * @param a repository type 25 | */ 26 | public interface KeyRepositorySupplier> extends Supplier { 27 | } 28 | -------------------------------------------------------------------------------- /artemis-key-value/src/main/java/org/jnosql/artemis/key/KeyValueTemplateProducer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.key; 16 | 17 | 18 | import org.jnosql.diana.api.key.BucketManager; 19 | 20 | /** 21 | * The producer of {@link KeyValueTemplate} 22 | */ 23 | public interface KeyValueTemplateProducer { 24 | 25 | /** 26 | * creates a {@link KeyValueTemplate} 27 | * 28 | * @param the KeyValueTemplate instance 29 | * @param manager the manager 30 | * @return a new instance 31 | * @throws NullPointerException when manager is null 32 | */ 33 | T get(BucketManager manager); 34 | } 35 | -------------------------------------------------------------------------------- /artemis-key-value/src/main/java/org/jnosql/artemis/key/query/DefaultKeyValueRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.key.query; 16 | 17 | import org.jnosql.artemis.key.KeyValueTemplate; 18 | 19 | class DefaultKeyValueRepository extends AbstractKeyValueRepository { 20 | 21 | 22 | private final KeyValueTemplate repository; 23 | 24 | public DefaultKeyValueRepository(Class typeClass, KeyValueTemplate repository) { 25 | super(typeClass); 26 | this.repository = repository; 27 | } 28 | 29 | @Override 30 | protected KeyValueTemplate getTemplate() { 31 | return repository; 32 | } 33 | } -------------------------------------------------------------------------------- /artemis-key-value/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 15 | 16 | 21 | -------------------------------------------------------------------------------- /artemis-key-value/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017 Otávio Santana and others 3 | # All rights reserved. This program and the accompanying materials 4 | # are made available under the terms of the Eclipse Public License v1.0 5 | # and Apache License v2.0 which accompanies this distribution. 6 | # The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | # and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | # 9 | # You may elect to redistribute this code under either of these licenses. 10 | # 11 | # Contributors: 12 | # 13 | # Otavio Santana 14 | # 15 | org.jnosql.artemis.key.spi.BucketManagerProducerExtension 16 | org.jnosql.artemis.key.spi.KeyValueConfigurationUnitExtension -------------------------------------------------------------------------------- /artemis-key-value/src/test/java/org/jnosql/artemis/IgnoreRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis; 16 | 17 | 18 | public interface IgnoreRepository extends Repository { 19 | } 20 | -------------------------------------------------------------------------------- /artemis-key-value/src/test/java/org/jnosql/artemis/IgnoreRepositoryAsync.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis; 16 | 17 | 18 | public interface IgnoreRepositoryAsync extends RepositoryAsync { 19 | } 20 | -------------------------------------------------------------------------------- /artemis-key-value/src/test/java/org/jnosql/artemis/PersonIgnoreRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis; 16 | 17 | import org.jnosql.artemis.model.Person; 18 | 19 | 20 | public interface PersonIgnoreRepository extends IgnoreRepository{ 21 | } 22 | -------------------------------------------------------------------------------- /artemis-key-value/src/test/java/org/jnosql/artemis/PersonRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis; 16 | 17 | 18 | import org.jnosql.artemis.model.Person; 19 | 20 | public interface PersonRepository extends Repository { 21 | } 22 | -------------------------------------------------------------------------------- /artemis-key-value/src/test/java/org/jnosql/artemis/PersonRepositoryAsync.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis; 16 | 17 | 18 | import org.jnosql.artemis.model.Person; 19 | 20 | public interface PersonRepositoryAsync extends RepositoryAsync { 21 | } 22 | -------------------------------------------------------------------------------- /artemis-key-value/src/test/java/org/jnosql/artemis/UserRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis; 16 | 17 | 18 | import org.jnosql.artemis.model.User; 19 | 20 | public interface UserRepository extends Repository { 21 | } 22 | -------------------------------------------------------------------------------- /artemis-key-value/src/test/java/org/jnosql/artemis/key/KeyValueRepositoryConfigurationTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.key; 16 | 17 | import org.jnosql.artemis.CDIExtension; 18 | import org.jnosql.artemis.PersonRepository; 19 | import org.junit.jupiter.api.Test; 20 | import org.junit.jupiter.api.extension.ExtendWith; 21 | 22 | import javax.inject.Inject; 23 | 24 | import static org.junit.jupiter.api.Assertions.assertNotNull; 25 | 26 | @ExtendWith(CDIExtension.class) 27 | class KeyValueRepositoryConfigurationTest { 28 | 29 | 30 | @Inject 31 | private RepositoryService services; 32 | 33 | @Test 34 | public void shouldRepository() { 35 | KeyRepositorySupplier supplier = services.getRepository(); 36 | assertNotNull(supplier); 37 | PersonRepository repository = supplier.get(); 38 | assertNotNull(repository); 39 | 40 | } 41 | 42 | 43 | } -------------------------------------------------------------------------------- /artemis-key-value/src/test/java/org/jnosql/artemis/key/RepositoryService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.key; 16 | 17 | import org.jnosql.artemis.ConfigurationUnit; 18 | import org.jnosql.artemis.PersonRepository; 19 | 20 | import javax.enterprise.context.ApplicationScoped; 21 | import javax.inject.Inject; 22 | 23 | @ApplicationScoped 24 | public class RepositoryService { 25 | 26 | @Inject 27 | @ConfigurationUnit(fileName = "key-value.json", name = "name", database = "database") 28 | private KeyRepositorySupplier repository; 29 | 30 | 31 | public KeyRepositorySupplier getRepository() { 32 | return repository; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /artemis-key-value/src/test/java/org/jnosql/artemis/model/ContactType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.model; 16 | 17 | public enum ContactType { 18 | MOBILE, PHONE, EMAIL 19 | } 20 | -------------------------------------------------------------------------------- /artemis-key-value/src/test/java/org/jnosql/artemis/model/Machine.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.model; 16 | 17 | 18 | import org.jnosql.artemis.Column; 19 | 20 | public class Machine { 21 | 22 | @Column 23 | private String name; 24 | 25 | public String getName() { 26 | return name; 27 | } 28 | 29 | public void setName(String name) { 30 | this.name = name; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /artemis-key-value/src/test/java/org/jnosql/artemis/model/MoneyConverter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.model; 16 | 17 | 18 | import org.jnosql.artemis.AttributeConverter; 19 | 20 | public class MoneyConverter implements AttributeConverter{ 21 | 22 | 23 | @Override 24 | public String convertToDatabaseColumn(Money attribute) { 25 | return attribute.toString(); 26 | } 27 | 28 | @Override 29 | public Money convertToEntityAttribute(String dbData) { 30 | return Money.parse(dbData); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /artemis-key-value/src/test/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 15 | 16 | 21 | -------------------------------------------------------------------------------- /artemis-key-value/src/test/resources/META-INF/key-value.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "description":"that is the description", 4 | "name":"name", 5 | "provider":"org.jnosql.artemis.key.KeyValueConfigurationMock", 6 | "settings":{ 7 | "key":"value", 8 | "key2":"value2" 9 | 10 | } 11 | }, 12 | { 13 | "description":"that is the description", 14 | "name":"name-2", 15 | "provider":"org.jnosql.artemis.key.KeyValueConfigurationMock", 16 | "settings":{ 17 | "key":"value", 18 | "key2":"value2", 19 | "key3":"value3" 20 | } 21 | } 22 | ] -------------------------------------------------------------------------------- /artemis-validation/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | pom.xml.tag 3 | pom.xml.releaseBackup 4 | pom.xml.versionsBackup 5 | pom.xml.next 6 | test-output/ 7 | /doc 8 | *.iml 9 | *.log 10 | .classpath 11 | -project 12 | /.resourceCache 13 | /.project 14 | /.idea 15 | .settings/ 16 | -------------------------------------------------------------------------------- /artemis-validation/src/main/java/org/jnosql/artemis/validation/ArtemisValidator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.validation; 16 | 17 | 18 | /** 19 | * Validates bean instances. Implementations of this interface must be thread-safe. 20 | */ 21 | public interface ArtemisValidator { 22 | 23 | 24 | /** 25 | * Validate a bean using bean validation 26 | * 27 | * @param bean the be to be validated 28 | * @param the type 29 | * @throws NullPointerException when bean is null 30 | * @throws javax.validation.ConstraintViolationException when {@link javax.validation.Validator#validate(Object, Class[])} 31 | * returns a non empty collection 32 | */ 33 | void validate(T bean); 34 | } 35 | -------------------------------------------------------------------------------- /artemis-validation/src/main/java/org/jnosql/artemis/validation/EntityObserver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | package org.jnosql.artemis.validation; 16 | 17 | 18 | import org.jnosql.artemis.EntityPrePersist; 19 | 20 | import javax.enterprise.event.Observes; 21 | import javax.inject.Inject; 22 | 23 | class EntityObserver { 24 | 25 | @Inject 26 | private ArtemisValidator validator; 27 | 28 | void validate(@Observes EntityPrePersist entity) { 29 | validator.validate(entity.getValue()); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /artemis-validation/src/main/java/org/jnosql/artemis/validation/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Otávio Santana and others 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * and Apache License v2.0 which accompanies this distribution. 6 | * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html 7 | * and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php. 8 | * 9 | * You may elect to redistribute this code under either of these licenses. 10 | * 11 | * Contributors: 12 | * 13 | * Otavio Santana 14 | */ 15 | 16 | /** 17 | * The artemis-validation is a subproject of Artemis that has the goals to validate the data using bean validation. 18 | * It uses the Bean validation API to do this validation before the event is persist: 19 | * So, it listens: 20 | *

EntityPrePersist

21 | */ 22 | package org.jnosql.artemis.validation; -------------------------------------------------------------------------------- /artemis-validation/src/main/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 15 | 16 | 21 | -------------------------------------------------------------------------------- /artemis-validation/src/test/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 15 | 16 | 21 | --------------------------------------------------------------------------------