Search in sources :

Example 11 with FinderParameter

use of org.springframework.roo.addon.layers.repository.jpa.addon.finder.parser.FinderParameter in project spring-roo by spring-projects.

the class PartTreeUnitTest method assertEqualsParameters.

private void assertEqualsParameters(List<FinderParameter> parameters, List<FinderParameter> parameters2) {
    List<String> list1 = new ArrayList<String>();
    List<String> list2 = new ArrayList<String>();
    for (FinderParameter parameter : parameters) list1.add(parameter.toString());
    for (FinderParameter parameter : parameters2) list2.add(parameter.toString());
    assertEqualsList(list1, list2);
}
Also used : FinderParameter(org.springframework.roo.addon.layers.repository.jpa.addon.finder.parser.FinderParameter) ArrayList(java.util.ArrayList)

Example 12 with FinderParameter

use of org.springframework.roo.addon.layers.repository.jpa.addon.finder.parser.FinderParameter in project spring-roo by spring-projects.

the class PartTreeUnitTest method validateEmptyOperatorParameters.

@Test
public void validateEmptyOperatorParameters() throws Exception {
    List<FinderParameter> parameters = new ArrayList<FinderParameter>();
    parameters.add(new FinderParameter(JavaType.INT_OBJECT, new JavaSymbolName("number")));
    assertEqualsParameters(parameters, new PartTree("findByNumber", memberDetails).getParameters());
    parameters.add(new FinderParameter(JavaType.INT_OBJECT, new JavaSymbolName("number2")));
    assertEqualsParameters(parameters, new PartTree("findByNumberAndNumberOrderByNumber", memberDetails).getParameters());
}
Also used : JavaSymbolName(org.springframework.roo.model.JavaSymbolName) FinderParameter(org.springframework.roo.addon.layers.repository.jpa.addon.finder.parser.FinderParameter) ArrayList(java.util.ArrayList) PartTree(org.springframework.roo.addon.layers.repository.jpa.addon.finder.parser.PartTree) Test(org.junit.Test)

Aggregations

FinderParameter (org.springframework.roo.addon.layers.repository.jpa.addon.finder.parser.FinderParameter)12 ArrayList (java.util.ArrayList)9 JavaSymbolName (org.springframework.roo.model.JavaSymbolName)8 PartTree (org.springframework.roo.addon.layers.repository.jpa.addon.finder.parser.PartTree)6 JavaType (org.springframework.roo.model.JavaType)5 Test (org.junit.Test)4 RooJavaType (org.springframework.roo.model.RooJavaType)4 FieldMetadata (org.springframework.roo.classpath.details.FieldMetadata)3 List (java.util.List)2 ClassOrInterfaceTypeDetails (org.springframework.roo.classpath.details.ClassOrInterfaceTypeDetails)2 MethodMetadataBuilder (org.springframework.roo.classpath.details.MethodMetadataBuilder)2 AnnotatedJavaType (org.springframework.roo.classpath.details.annotations.AnnotatedJavaType)2 MemberDetails (org.springframework.roo.classpath.scanner.MemberDetails)2 Date (java.util.Date)1 HashMap (java.util.HashMap)1 LinkedHashMap (java.util.LinkedHashMap)1 Pair (org.apache.commons.lang3.tuple.Pair)1 JpaEntityMetadata (org.springframework.roo.addon.jpa.addon.entity.JpaEntityMetadata)1 FinderMethod (org.springframework.roo.addon.layers.repository.jpa.addon.finder.parser.FinderMethod)1 RooFinder (org.springframework.roo.addon.layers.repository.jpa.annotations.finder.RooFinder)1