Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
The Java Data Objects (JDO) API is a standard interface-based Java model abstraction of persistence, developed as Java Specification Request 243 under the auspices of the Java Community Process.
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package javax.jdo;
import java.io.Closeable;
import java.io.Serializable;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import javax.jdo.query.BooleanExpression;
import javax.jdo.query.CharacterExpression;
import javax.jdo.query.CollectionExpression;
import javax.jdo.query.DateExpression;
import javax.jdo.query.DateTimeExpression;
import javax.jdo.query.Expression;
import javax.jdo.query.IfThenElseExpression;
import javax.jdo.query.ListExpression;
import javax.jdo.query.MapExpression;
import javax.jdo.query.NumericExpression;
import javax.jdo.query.OrderExpression;
import javax.jdo.query.PersistableExpression;
import javax.jdo.query.StringExpression;
import javax.jdo.query.TimeExpression;
/**
* Interface for a type-safe refactorable JDOQL query, using a fluent API, based around expressions.
* Note that a JDOQLTypedQuery only supports named parameters, and the values of these parameters
* should be set using the relevant setter methods prior to execution, and that the values for the
* parameters will only be retained until the subsequent query execution.
*
* @param candidate type for this query
*/
public interface JDOQLTypedQuery extends Serializable, Closeable {
public static final String QUERY_CLASS_PREFIX = "Q";
/**
* Method to return an expression for the candidate of the query.
* Cast the returned expression to the candidate "Q" type to be able to call methods on it.
* This calls the method "Q{type}.candidate(null)"
* The preference is to use the "Q{type}.candidate()" method for real type-safe handling.
* @return Expression for the candidate
*/
PersistableExpression candidate();
/**
* Method to return a parameter for the query.
* Cast the returned parameter to the right type to be able to call methods on it.
* The preference is to use the "xxxParameter(String)" methods for real type-safe handling.
* @param name Name of the parameter
* @param type Java type of the parameter
* @return Expression for the parameter
* @param
type for the parameter
*/
Expression
parameter(String name, Class
type);
/**
* Method to return a string parameter for the query.
* @param name Name of the parameter
* @return StringExpression for the parameter
*/
StringExpression stringParameter(String name);
/**
* Method to return a character parameter for the query.
* @param name Name of the parameter
* @return Expression for the parameter
*/
CharacterExpression characterParameter(String name);
/**
* Method to return a numeric parameter for the query.
* @param name Name of the parameter
* @return NumericExpression for the parameter
*/
NumericExpression> numericParameter(String name);
/**
* Method to return a numeric parameter for the query.
* @param name Name of the parameter
* @param type Type of the numeric parameter
* @param Type for the numeric parameter
* @return NumericExpression for the parameter
*/
@SuppressWarnings("unchecked")
default NumericExpression numericParameter(String name, Class type) {
return (NumericExpression)numericParameter(name);
}
/**
* Method to return a date parameter for the query.
* @param name Name of the parameter
* @return Expression for the parameter
*/
DateExpression dateParameter(String name);
/**
* Method to return a time parameter for the query.
* @param name Name of the parameter
* @return Expression for the parameter
*/
TimeExpression timeParameter(String name);
/**
* Method to return a datetime parameter for the query.
* @param name Name of the parameter
* @return Expression for the parameter
*/
DateTimeExpression datetimeParameter(String name);
/**
* Method to return a collection parameter for the query.
* @param name Name of the parameter
* @return Expression for the parameter
*/
CollectionExpression, ?> collectionParameter(String name);
/**
* Method to return a collection parameter for the query.
*
* @param name Name of the parameter
* @param elementType Element type of the collection parameter
* @param Element type for the collection parameter
* @return Expression for the parameter
*/
@SuppressWarnings("unchecked")
default CollectionExpression, E> collectionParameter(String name, Class elementType) {
return (CollectionExpression, E>)collectionParameter(name);
}
/**
* Method to return a map parameter for the query.
* @param name Name of the parameter
* @return Expression for the parameter
*/
MapExpression, ?, ?> mapParameter(String name);
/**
* Method to return a map parameter for the query.
* @param name Name of the parameter
* @param keyType Key type of the map parameter
* @param valueType Value type of the map parameter
* @param Key type for the map parameter
* @param Value type for the map parameter
* @return Expression for the parameter
*/
@SuppressWarnings("unchecked")
default MapExpression