private void checkN1ql() { if (!getCouchbaseClusterInfo().checkAvailable(CouchbaseFeature.N1QL)) { throw new UnsupportedCouchbaseFeatureException("Detected usage of N1QL in template, which is unsupported on this cluster", CouchbaseFeature.N1QL); } }
private void checkN1ql() { if (!getCouchbaseClusterInfo().checkAvailable(CouchbaseFeature.N1QL)) { throw new UnsupportedCouchbaseFeatureException("Detected usage of N1QL in template, which is unsupported on this cluster", CouchbaseFeature.N1QL); } }
private void checkFeatures(RepositoryInformation metadata, boolean isN1qlAvailable, N1qlPrimaryIndexed n1qlPrimaryIndexed, N1qlSecondaryIndexed n1qlSecondaryIndexed) { //paging repo will always need N1QL, also check if the repository requires a N1QL index boolean needsN1ql = metadata.isPagingRepository() || n1qlPrimaryIndexed != null || n1qlSecondaryIndexed != null; //for other repos, they might also need N1QL if they don't have only @View methods if (!needsN1ql) { for (Method method : metadata.getQueryMethods()) { boolean hasN1ql = AnnotationUtils.findAnnotation(method, Query.class) != null; boolean hasView = AnnotationUtils.findAnnotation(method, View.class) != null; if (hasN1ql || !hasView) { needsN1ql = true; break; } } } if (needsN1ql && !isN1qlAvailable) { throw new UnsupportedCouchbaseFeatureException("Repository uses N1QL", CouchbaseFeature.N1QL); } }
private void checkFeatures(RepositoryInformation metadata, boolean isN1qlAvailable, N1qlPrimaryIndexed n1qlPrimaryIndexed, N1qlSecondaryIndexed n1qlSecondaryIndexed) { //paging repo will always need N1QL, also check if the repository requires a N1QL index boolean needsN1ql = metadata.isPagingRepository() || n1qlPrimaryIndexed != null || n1qlSecondaryIndexed != null; //for other repos, they might also need N1QL if they don't have only @View methods if (!needsN1ql) { for (Method method : metadata.getQueryMethods()) { boolean hasN1ql = AnnotationUtils.findAnnotation(method, Query.class) != null; boolean hasView = AnnotationUtils.findAnnotation(method, View.class) != null; if (hasN1ql || !hasView) { needsN1ql = true; break; } } } if (needsN1ql && !isN1qlAvailable) { throw new UnsupportedCouchbaseFeatureException("Repository uses N1QL", CouchbaseFeature.N1QL); } }
private void checkFeatures(RepositoryInformation metadata, boolean isN1qlAvailable, N1qlPrimaryIndexed n1qlPrimaryIndexed, N1qlSecondaryIndexed n1qlSecondaryIndexed) { //paging repo will always need N1QL, also check if the repository requires a N1QL index boolean needsN1ql = metadata.isPagingRepository() || n1qlPrimaryIndexed != null || n1qlSecondaryIndexed != null; //for other repos, they might also need N1QL if they don't have only @View methods if (!needsN1ql) { for (Method method : metadata.getQueryMethods()) { boolean hasN1ql = AnnotationUtils.findAnnotation(method, Query.class) != null; boolean hasView = AnnotationUtils.findAnnotation(method, View.class) != null; if (hasN1ql || !hasView) { needsN1ql = true; break; } } } if (needsN1ql && !isN1qlAvailable) { throw new UnsupportedCouchbaseFeatureException("Repository uses N1QL", CouchbaseFeature.N1QL); } }
private void checkFeatures(RepositoryInformation metadata, boolean isN1qlAvailable, N1qlPrimaryIndexed n1qlPrimaryIndexed, N1qlSecondaryIndexed n1qlSecondaryIndexed) { //paging repo will always need N1QL, also check if the repository requires a N1QL index boolean needsN1ql = metadata.isPagingRepository() || n1qlPrimaryIndexed != null || n1qlSecondaryIndexed != null; //for other repos, they might also need N1QL if they don't have only @View methods if (!needsN1ql) { for (Method method : metadata.getQueryMethods()) { boolean hasN1ql = AnnotationUtils.findAnnotation(method, Query.class) != null; boolean hasView = AnnotationUtils.findAnnotation(method, View.class) != null; if (hasN1ql || !hasView) { needsN1ql = true; break; } } } if (needsN1ql && !isN1qlAvailable) { throw new UnsupportedCouchbaseFeatureException("Repository uses N1QL", CouchbaseFeature.N1QL); } }