use of org.apache.deltaspike.data.impl.meta.RepositoryMethodPrefix in project deltaspike by apache.
the class CdiQueryContextHolderTest method dummyRepoMethod.
private RepositoryMethodMetadata dummyRepoMethod(RepositoryMetadata metadata) {
RepositoryMethodMetadata methodMetadata = new RepositoryMethodMetadata(dummyMethod());
methodMetadata.setMethodPrefix(new RepositoryMethodPrefix(metadata.getRepositoryClass().getAnnotation(Repository.class).methodPrefix(), dummyMethod().getName()));
return methodMetadata;
}
use of org.apache.deltaspike.data.impl.meta.RepositoryMethodPrefix in project deltaspike by apache.
the class QueryRootTest method should_use_alternative_prefix.
@Test
public void should_use_alternative_prefix() {
// given
final String name = "fetchByName";
final String expected = "select e from Simple e " + "where e.name = ?1";
// when
String result = QueryRoot.create(name, repoFetchBy, new RepositoryMethodPrefix("fetchBy", name)).getJpqlQuery().trim();
// then
assertEquals(expected, result);
}
Aggregations