Search in sources :

Example 1 with DeleteMethodProvider

use of org.eclipse.jnosql.communication.query.method.DeleteMethodProvider in project jnosql-diana by eclipse.

the class DeleteQueryConverter method apply.

@Override
public List<Vertex> apply(GraphQueryMethod graphQuery) {
    DeleteMethodProvider provider = DeleteMethodProvider.get();
    DeleteQuery deleteQuery = provider.apply(graphQuery.getMethod(), graphQuery.getEntityName());
    ClassMapping mapping = graphQuery.getMapping();
    GraphTraversal<Vertex, Vertex> traversal = getGraphTraversal(graphQuery, deleteQuery::getWhere, mapping);
    traversal.hasLabel(mapping.getName());
    return traversal.toList();
}
Also used : ClassMapping(org.eclipse.jnosql.mapping.reflection.ClassMapping) Vertex(org.apache.tinkerpop.gremlin.structure.Vertex) DeleteMethodProvider(org.eclipse.jnosql.communication.query.method.DeleteMethodProvider) DeleteQuery(jakarta.nosql.query.DeleteQuery)

Example 2 with DeleteMethodProvider

use of org.eclipse.jnosql.communication.query.method.DeleteMethodProvider in project jnosql-diana by eclipse.

the class BaseColumnRepository method getDeleteQuery.

protected ColumnDeleteQuery getDeleteQuery(Method method, Object[] args) {
    DeleteMethodProvider deleteMethodFactory = DeleteMethodProvider.get();
    DeleteQuery deleteQuery = deleteMethodFactory.apply(method, getClassMapping().getName());
    ColumnDeleteQueryParams queryParams = DELETE_CONVERTER.apply(deleteQuery, getParser());
    ColumnDeleteQuery query = queryParams.getQuery();
    Params params = queryParams.getParams();
    getParamsBinder().bind(params, args, method);
    return query;
}
Also used : DeleteMethodProvider(org.eclipse.jnosql.communication.query.method.DeleteMethodProvider) ColumnQueryParams(jakarta.nosql.column.ColumnQueryParams) ColumnDeleteQueryParams(jakarta.nosql.column.ColumnDeleteQueryParams) Params(jakarta.nosql.Params) ColumnDeleteQuery(jakarta.nosql.column.ColumnDeleteQuery) DeleteQuery(jakarta.nosql.query.DeleteQuery) ColumnDeleteQueryParams(jakarta.nosql.column.ColumnDeleteQueryParams) ColumnDeleteQuery(jakarta.nosql.column.ColumnDeleteQuery)

Example 3 with DeleteMethodProvider

use of org.eclipse.jnosql.communication.query.method.DeleteMethodProvider in project jnosql-diana by eclipse.

the class BaseDocumentRepository method getDeleteQuery.

protected DocumentDeleteQuery getDeleteQuery(Method method, Object[] args) {
    DeleteMethodProvider methodProvider = DeleteMethodProvider.get();
    DeleteQuery deleteQuery = methodProvider.apply(method, getClassMapping().getName());
    DeleteQueryConverter converter = ServiceLoaderProvider.get(DeleteQueryConverter.class);
    DocumentDeleteQueryParams queryParams = converter.apply(deleteQuery, getParser());
    DocumentDeleteQuery query = queryParams.getQuery();
    Params params = queryParams.getParams();
    getParamsBinder().bind(params, args, method);
    return query;
}
Also used : DeleteMethodProvider(org.eclipse.jnosql.communication.query.method.DeleteMethodProvider) DocumentDeleteQueryParams(jakarta.nosql.document.DocumentDeleteQueryParams) DeleteQueryConverter(jakarta.nosql.document.DeleteQueryConverter) DocumentQueryParams(jakarta.nosql.document.DocumentQueryParams) DocumentDeleteQueryParams(jakarta.nosql.document.DocumentDeleteQueryParams) Params(jakarta.nosql.Params) DocumentDeleteQuery(jakarta.nosql.document.DocumentDeleteQuery) DeleteQuery(jakarta.nosql.query.DeleteQuery) DocumentDeleteQuery(jakarta.nosql.document.DocumentDeleteQuery)

Aggregations

DeleteQuery (jakarta.nosql.query.DeleteQuery)3 DeleteMethodProvider (org.eclipse.jnosql.communication.query.method.DeleteMethodProvider)3 Params (jakarta.nosql.Params)2 ColumnDeleteQuery (jakarta.nosql.column.ColumnDeleteQuery)1 ColumnDeleteQueryParams (jakarta.nosql.column.ColumnDeleteQueryParams)1 ColumnQueryParams (jakarta.nosql.column.ColumnQueryParams)1 DeleteQueryConverter (jakarta.nosql.document.DeleteQueryConverter)1 DocumentDeleteQuery (jakarta.nosql.document.DocumentDeleteQuery)1 DocumentDeleteQueryParams (jakarta.nosql.document.DocumentDeleteQueryParams)1 DocumentQueryParams (jakarta.nosql.document.DocumentQueryParams)1 Vertex (org.apache.tinkerpop.gremlin.structure.Vertex)1 ClassMapping (org.eclipse.jnosql.mapping.reflection.ClassMapping)1