All Downloads are FREE. Search and download functionalities are using the official Maven repository.

codegen.spring.repository.vm Maven / Gradle / Ivy

/*
 * created by: Generated through velocity template (repository.vm)
 * created on: ----/--/-- (not filled with property 'time' to simplify version-diffs)
 * 
 * spring data rest repository
 *
 * ${copyright}
 */
package ${package};

#define($attKey) KEY_${util.toUpperCase(${att.Name})}#end
#define($attKeyTooltip) KEY_TOOLTIP_${util.toUpperCase(${att.Name})}#end
#define($attName) ATTR_${util.toUpperCase(${att.Name})}#end

import ${class.Clazz.CanonicalName};
import java.util.Set;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;

@RepositoryRestResource(collectionResourceRel = "${util.toLowerCase(${class.Name})}s", path = "${util.toLowerCase(${class.Name})}")
public interface ${class.Name}Repository extends PagingAndSortingRepository<${class.Name}, ${idType}> {
#foreach( $att in $class.Attributes)
#if(!${att.type.Name.equals($idType)} || !${att.name.toLowerCase().endsWith("id")})
    Set<${class.Name}> findBy${att.NameFU}(${att.type.name} ${att.Name});
#end
#end
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy