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

com.backendless.persistence.BackendlessDataQuery Maven / Gradle / Ivy

There is a newer version: 7.0-alpha
Show newest version
/*
 * ********************************************************************************************************************
 *  

* BACKENDLESS.COM CONFIDENTIAL *

* ******************************************************************************************************************** *

* Copyright 2012 BACKENDLESS.COM. All Rights Reserved. *

* NOTICE: All information contained herein is, and remains the property of Backendless.com and its suppliers, * if any. The intellectual and technical concepts contained herein are proprietary to Backendless.com and its * suppliers and may be covered by U.S. and Foreign Patents, patents in process, and are protected by trade secret * or copyright law. Dissemination of this information or reproduction of this material is strictly forbidden * unless prior written permission is obtained from Backendless.com. *

* ******************************************************************************************************************** */ package com.backendless.persistence; import java.util.ArrayList; import java.util.List; public class BackendlessDataQuery extends AbstractBackendlessQuery { public static final int DEFAULT_PAGE_SIZE = 10; public static final int DEFAULT_OFFSET = 0; private List properties; private String whereClause; private QueryOptions queryOptions; private List groupBy = new ArrayList<>(); private String havingClause = ""; public BackendlessDataQuery() { } public BackendlessDataQuery( List properties ) { this.properties = properties; } public BackendlessDataQuery( String whereClause ) { this.whereClause = whereClause; } public BackendlessDataQuery( QueryOptions queryOptions ) { this.queryOptions = queryOptions; } public BackendlessDataQuery( List properties, String whereClause, QueryOptions queryOptions, List groupBy, String havingClause ) { this.properties = properties; this.whereClause = whereClause; this.queryOptions = queryOptions; this.groupBy = groupBy; this.havingClause = havingClause; } public List getProperties() { if( properties == null ) return properties = new ArrayList<>(); return new ArrayList<>( properties ); } public void setProperties( List properties ) { this.properties = properties; } public void addProperty( String property ) { if( property == null || property.equals( "" ) ) return; if( properties == null ) properties = new ArrayList<>(); properties.add( property ); } public String getWhereClause() { return whereClause; } public void setWhereClause( String whereClause ) { this.whereClause = whereClause; } public QueryOptions getQueryOptions() { if( queryOptions == null ) return null; return queryOptions.newInstance(); } public void setQueryOptions( QueryOptions queryOptions ) { this.queryOptions = queryOptions; } public List getGroupBy() { return groupBy; } public void setGroupBy( List groupBy ) { this.groupBy = groupBy; } public String getHavingClause() { return havingClause; } public void setHavingClause( String havingClause ) { this.havingClause = havingClause; } @Override public BackendlessDataQuery newInstance() { BackendlessDataQuery result = new BackendlessDataQuery(); result.setProperties( getProperties() ); result.setWhereClause( whereClause ); result.setQueryOptions( getQueryOptions() ); result.setGroupBy( groupBy ); result.setHavingClause( havingClause ); return result; } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy