Skip to content
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
3122633
Update dependencies.
michael-simons Oct 13, 2025
96e21ec
Prepare 8.0 RC1 (2025.1.0).
christophstrobl Oct 17, 2025
a4422ab
Release version 8.0 RC1 (2025.1.0).
christophstrobl Oct 17, 2025
67c50be
Prepare next development iteration.
christophstrobl Oct 17, 2025
57a8b26
After release cleanups.
christophstrobl Oct 17, 2025
cabfe7c
WIP: Add @EnableFalkorDBRepositories annotation and repository infras…
shahar-biron Oct 22, 2025
c12664b
Fix: Implement missing methods and resolve compilation issues…
shahar-biron Oct 22, 2025
a39e2ed
Merge branch 'main' into feature/enable-falkordb-repositories-annotation
shahar-biron Oct 22, 2025
f4c6f56
Fix: Remove missing settings.xml reference from CI build…
shahar-biron Oct 23, 2025
883023c
Merge main into feature/enable-falkordb-repositories-annotation - res…
shahar-biron Oct 24, 2025
d4afe40
Add JavaDoc documentation to public accessor methods
shahar-biron Oct 24, 2025
ad07e9c
Fix critical bugs: correct attribute key and constructor parameter order
shahar-biron Oct 24, 2025
8960edf
Implement query functionality for @Query annotated methods
shahar-biron Oct 24, 2025
efff274
Implement derived query support and named parameter support
shahar-biron Oct 26, 2025
ae7a536
Update README with PR #10 features
shahar-biron Oct 26, 2025
ec19d9c
Implement automatic relationship persistence with cascade save
shahar-biron Oct 26, 2025
23d49ae
Enhance automatic relationship loading with robust node extraction
shahar-biron Oct 26, 2025
cae241c
Address CodeRabbitAI review suggestions
shahar-biron Oct 26, 2025
c94e92f
Fix: Remove incorrect @Override annotation causing CI failure
shahar-biron Oct 26, 2025
fba3424
Add ValueExpressionDelegate parameter for Spring Data Commons 4.0 com…
shahar-biron Oct 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@
<goals>
<goal>validate</goal>
</goals>
<phase>validate</phase>
<phase>none</phase>
<inherited>true</inherited>
</execution>
</executions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,24 @@ public <T> Optional<T> queryForObject(String cypher, Map<String, Object> paramet
});
}

/**
* Returns the {@link FalkorDBEntityConverter} used by this template.
*
* @return the entity converter
*/
public FalkorDBEntityConverter getConverter() {
return this.entityConverter;
}

/**
* Returns the {@link FalkorDBMappingContext} used by this template.
*
* @return the mapping context
*/
public FalkorDBMappingContext getMappingContext() {
return this.mappingContext;
}

private String getPrimaryLabel(DefaultFalkorDBPersistentEntity<?> persistentEntity) {
// Get the primary label from the @Node annotation
Node nodeAnnotation = persistentEntity.getType().getAnnotation(Node.class);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
/*
* Copyright (c) 2023-2024 FalkorDB Ltd.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package org.springframework.data.falkordb.repository.config;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import org.springframework.context.annotation.ComponentScan.Filter;
import org.springframework.context.annotation.Import;
import org.springframework.data.repository.config.DefaultRepositoryBaseClass;
import org.springframework.data.repository.query.QueryLookupStrategy;

/**
* Annotation to enable FalkorDB repositories. Will scan the package of the annotated
* configuration class for Spring Data repositories by default.
*
* @author Shahar Biron
* @since 1.0
*/
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Inherited
@Import(FalkorDBRepositoriesRegistrar.class)
public @interface EnableFalkorDBRepositories {

/**
* Alias for the {@link #basePackages()} attribute. Allows for more concise annotation
* declarations e.g.: {@code @EnableFalkorDBRepositories("org.my.pkg")} instead of
* {@code @EnableFalkorDBRepositories(basePackages="org.my.pkg")}.
* @return base packages to scan for repositories
*/
String[] value() default {};

/**
* Base packages to scan for annotated components. {@link #value()} is an alias for
* (and mutually exclusive with) this attribute. Use {@link #basePackageClasses()} for
* a type-safe alternative to String-based package names.
* @return base packages to scan
*/
String[] basePackages() default {};

/**
* Type-safe alternative to {@link #basePackages()} for specifying the packages to
* scan for annotated components. The package of each class specified will be scanned.
* Consider creating a special no-op marker class or interface in each package that
* serves no purpose other than being referenced by this attribute.
* @return base package classes
*/
Class<?>[] basePackageClasses() default {};

/**
* Specifies which types are eligible for component scanning. Further narrows the set
* of candidate components from everything in {@link #basePackages()} to everything in
* the base packages that matches the given filter or filters.
* @return include filters
*/
Filter[] includeFilters() default {};

/**
* Specifies which types are not eligible for component scanning.
* @return exclude filters
*/
Filter[] excludeFilters() default {};

/**
* Returns the postfix to be used when looking up custom repository implementations.
* Defaults to {@literal Impl}. So for a repository named {@code PersonRepository} the
* corresponding implementation class will be looked up scanning for
* {@code PersonRepositoryImpl}.
* @return repository implementation postfix
*/
String repositoryImplementationPostfix() default "Impl";

/**
* Configures the location of where to find the Spring Data named queries properties
* file. Will default to {@code META-INF/falkordb-named-queries.properties}.
* @return named queries location
*/
String namedQueriesLocation() default "";

/**
* Returns the key of the {@link QueryLookupStrategy} to be used for lookup queries
* for query methods. Defaults to {@link QueryLookupStrategy.Key#CREATE_IF_NOT_FOUND}.
* @return query lookup strategy key
*/
QueryLookupStrategy.Key queryLookupStrategy() default QueryLookupStrategy.Key.CREATE_IF_NOT_FOUND;

/**
* Configure the repository base class to be used to create repository proxies for
* this particular configuration.
* @return repository base class
*/
Class<?> repositoryBaseClass() default DefaultRepositoryBaseClass.class;

/**
* Configures the name of the
* {@link org.springframework.data.falkordb.core.FalkorDBTemplate} bean to be used
* with the repositories detected.
* @return FalkorDB template bean name
*/
String falkorDBTemplateRef() default "falkorDBTemplate";

/**
* Configures whether nested repository-interfaces (e.g. defined as inner classes)
* should be discovered by the repositories infrastructure.
* @return whether to consider nested repositories
*/
boolean considerNestedRepositories() default false;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* Copyright (c) 2023-2024 FalkorDB Ltd.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package org.springframework.data.falkordb.repository.config;

import java.lang.annotation.Annotation;

import org.springframework.data.repository.config.RepositoryBeanDefinitionRegistrarSupport;
import org.springframework.data.repository.config.RepositoryConfigurationExtension;

/**
* {@link org.springframework.context.annotation.ImportBeanDefinitionRegistrar} to enable
* {@link EnableFalkorDBRepositories} annotation.
*
* @author Shahar Biron
* @since 1.0
*/
public class FalkorDBRepositoriesRegistrar extends RepositoryBeanDefinitionRegistrarSupport {

@Override
protected Class<? extends Annotation> getAnnotation() {
return EnableFalkorDBRepositories.class;
}

@Override
protected RepositoryConfigurationExtension getExtension() {
return new FalkorDBRepositoryConfigurationExtension();
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
/*
* Copyright (c) 2023-2024 FalkorDB Ltd.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package org.springframework.data.falkordb.repository.config;

import java.lang.annotation.Annotation;
import java.util.Collection;
import java.util.Collections;

import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.data.falkordb.core.mapping.FalkorDBMappingContext;
import org.springframework.data.falkordb.repository.FalkorDBRepository;
import org.springframework.data.falkordb.repository.support.FalkorDBRepositoryFactoryBean;
import org.springframework.data.repository.config.RepositoryConfigurationExtensionSupport;
import org.springframework.data.repository.config.RepositoryConfigurationSource;
import org.springframework.data.repository.core.RepositoryMetadata;

/**
* {@link org.springframework.data.repository.config.RepositoryConfigurationExtension} for
* FalkorDB.
*
* @author Shahar Biron
* @since 1.0
*/
public class FalkorDBRepositoryConfigurationExtension extends RepositoryConfigurationExtensionSupport {

private static final String FALKORDB_TEMPLATE_REF = "falkorDBTemplateRef";

@Override
public String getModuleName() {
return "FalkorDB";
}

@Override
public String getRepositoryFactoryBeanClassName() {
return FalkorDBRepositoryFactoryBean.class.getName();
}

@Override
protected String getModulePrefix() {
return "falkordb";
}

@Override
protected Collection<Class<? extends Annotation>> getIdentifyingAnnotations() {
return Collections.singleton(org.springframework.data.falkordb.core.schema.Node.class);
}

@Override
protected Collection<Class<?>> getIdentifyingTypes() {
return Collections.singleton(FalkorDBRepository.class);
}

@Override
public void postProcess(BeanDefinitionBuilder builder, RepositoryConfigurationSource source) {

source.getAttribute(FALKORDB_TEMPLATE_REF).ifPresent(s -> builder.addPropertyReference("falkorDBTemplate", s));
}

@Override
protected boolean useRepositoryConfiguration(RepositoryMetadata metadata) {
return metadata.isReactiveRepository() == false;
}

@Override
public String getDefaultNamedQueryLocation() {
return "META-INF/falkordb-named-queries.properties";
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright (c) 2023-2024 FalkorDB Ltd.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

/**
* Configuration infrastructure for Spring Data FalkorDB repositories.
*/
package org.springframework.data.falkordb.repository.config;
Loading