idx
int64
0
41.2k
question
stringlengths
73
5.81k
target
stringlengths
5
918
11,800
@ WithBridgeMethods ( value = SQLServerQuery . class , castRequired = true ) public C tableHints ( SQLServerTableHints ... tableHints ) { if ( tableHints . length > 0 ) { String hints = SQLServerGrammar . tableHints ( tableHints ) ; addJoinFlag ( hints , JoinFlag . Position . END ) ; } return ( C ) this ; }
Set the table hints
11,801
public SQLTemplates . Builder getBuilder ( DatabaseMetaData md ) throws SQLException { String name = md . getDatabaseProductName ( ) . toLowerCase ( ) ; if ( name . equals ( "cubrid" ) ) { return CUBRIDTemplates . builder ( ) ; } else if ( name . equals ( "apache derby" ) ) { return DerbyTemplates . builder ( ) ; } else if ( name . startsWith ( "firebird" ) ) { return FirebirdTemplates . builder ( ) ; } else if ( name . equals ( "h2" ) ) { return H2Templates . builder ( ) ; } else if ( name . equals ( "hsql" ) ) { return HSQLDBTemplates . builder ( ) ; } else if ( name . equals ( "mysql" ) ) { return MySQLTemplates . builder ( ) ; } else if ( name . equals ( "oracle" ) ) { return OracleTemplates . builder ( ) ; } else if ( name . equals ( "postgresql" ) ) { return PostgreSQLTemplates . builder ( ) ; } else if ( name . equals ( "sqlite" ) ) { return SQLiteTemplates . builder ( ) ; } else if ( name . startsWith ( "teradata" ) ) { return TeradataTemplates . builder ( ) ; } else if ( name . equals ( "microsoft sql server" ) ) { switch ( md . getDatabaseMajorVersion ( ) ) { case 13 : case 12 : case 11 : return SQLServer2012Templates . builder ( ) ; case 10 : return SQLServer2008Templates . builder ( ) ; case 9 : return SQLServer2005Templates . builder ( ) ; default : return SQLServerTemplates . builder ( ) ; } } else { return new SQLTemplates . Builder ( ) { protected SQLTemplates build ( char escape , boolean quote ) { return new SQLTemplates ( Keywords . DEFAULT , "\"" , escape , quote , false ) ; } } ; } }
Get a SQLTemplates . Builder instance that matches best the SQL engine of the given database metadata
11,802
public NumberExpression < Double > length ( ) { if ( length == null ) { length = Expressions . numberOperation ( Double . class , SpatialOps . LENGTH , mixin ) ; } return length ; }
The length of this Curve in its associated spatial reference .
11,803
public static < T extends Comparable > DateTimeExpression < T > currentDate ( Class < T > cl ) { return Expressions . dateTimeOperation ( cl , Ops . DateTimeOps . CURRENT_DATE ) ; }
Create an expression representing the current date as a DateTimeExpression instance
11,804
public static < T extends Comparable > DateTimeExpression < T > currentTimestamp ( Class < T > cl ) { return Expressions . dateTimeOperation ( cl , Ops . DateTimeOps . CURRENT_TIMESTAMP ) ; }
Create an expression representing the current time instant as a DateTimeExpression instance
11,805
public NumberExpression < Integer > week ( ) { if ( week == null ) { week = Expressions . numberOperation ( Integer . class , Ops . DateTimeOps . WEEK , mixin ) ; } return week ; }
Create a week expression
11,806
public NumberExpression < Integer > year ( ) { if ( year == null ) { year = Expressions . numberOperation ( Integer . class , Ops . DateTimeOps . YEAR , mixin ) ; } return year ; }
Create a year expression
11,807
public NumberExpression < Integer > yearWeek ( ) { if ( yearWeek == null ) { yearWeek = Expressions . numberOperation ( Integer . class , Ops . DateTimeOps . YEAR_WEEK , mixin ) ; } return yearWeek ; }
Create a ISO yearweek expression
11,808
public NumberExpression < Integer > ordinal ( ) { if ( ordinal == null ) { ordinal = Expressions . numberOperation ( Integer . class , Ops . ORDINAL , mixin ) ; } return ordinal ; }
Get the ordinal of this enum
11,809
public < T > JoinBuilder < Q , K , T > join ( Path < T > ref , Path < T > target ) { return new JoinBuilder < Q , K , T > ( queryMixin , ref , target ) ; }
Define a join
11,810
public < T > AnyEmbeddedBuilder < Q , K > anyEmbedded ( Path < ? extends Collection < T > > collection , Path < T > target ) { return new AnyEmbeddedBuilder < Q , K > ( queryMixin , collection ) ; }
Define a constraint for an embedded object
11,811
public NumberExpression < Integer > dimension ( ) { if ( dimension == null ) { dimension = Expressions . numberOperation ( Integer . class , SpatialOps . DIMENSION , mixin ) ; } return dimension ; }
The inherent dimension of this geometric object which must be less than or equal to the coordinate dimension . In non - homogeneous collections this will return the largest topological dimension of the contained objects .
11,812
public StringExpression geometryType ( ) { if ( geometryType == null ) { geometryType = Expressions . stringOperation ( SpatialOps . GEOMETRY_TYPE , mixin ) ; } return geometryType ; }
Returns the name of the instantiable subtype of Geometry of which this geometric object is an instantiable member . The name of the subtype of Geometry is returned as a string .
11,813
public NumberExpression < Integer > srid ( ) { if ( srid == null ) { srid = Expressions . numberOperation ( Integer . class , SpatialOps . SRID , mixin ) ; } return srid ; }
Returns the Spatial Reference System ID for this geometric object . This will normally be a foreign key to an index of reference systems stored in either the same or some other datastore .
11,814
public StringExpression asText ( ) { if ( text == null ) { text = Expressions . stringOperation ( SpatialOps . AS_TEXT , mixin ) ; } return text ; }
Exports this geometric object to a specific Well - known Text Representation of Geometry .
11,815
public SimpleExpression < byte [ ] > asBinary ( ) { if ( binary == null ) { binary = Expressions . operation ( byte [ ] . class , SpatialOps . AS_BINARY , mixin ) ; } return binary ; }
Exports this geometric object to a specific Well - known Binary Representation of Geometry .
11,816
public NumberExpression < Double > distance ( Expression < ? extends Geometry > geometry ) { return Expressions . numberOperation ( Double . class , SpatialOps . DISTANCE , mixin , geometry ) ; }
Returns the shortest distance between any two Points in the two geometric objects as calculated in the spatial reference system of this geometric object . Because the geometries are closed it is possible to find a point on each geometric object involved such that the distance between these 2 points is the returned distance between their geometric objects .
11,817
@ SuppressWarnings ( "unchecked" ) public PathBuilder < Object > get ( String property ) { SimpleEntry < String , Class < ? > > entry = new SimpleEntry < String , Class < ? > > ( property , Object . class ) ; PathBuilder < Object > path = ( PathBuilder < Object > ) properties . get ( entry ) ; PathBuilder < ? > existingPath = null ; if ( path == null ) { Class < ? > vtype = validate ( property , Object . class ) ; path = new PathBuilder < Object > ( vtype , forProperty ( property ) , validator ) ; existingPath = properties . putIfAbsent ( entry , path ) ; } return existingPath == null ? path : ( PathBuilder < Object > ) existingPath ; }
Create a PathBuilder instance for the given property
11,818
@ SuppressWarnings ( "unchecked" ) public < A > PathBuilder < A > get ( String property , Class < A > type ) { SimpleEntry < String , Class < ? > > entry = new SimpleEntry < String , Class < ? > > ( property , type ) ; PathBuilder < A > path = ( PathBuilder < A > ) properties . get ( entry ) ; PathBuilder < ? > existingPath = null ; if ( path == null ) { Class < ? extends A > vtype = validate ( property , type ) ; path = new PathBuilder < A > ( vtype , forProperty ( property ) , validator ) ; existingPath = properties . putIfAbsent ( entry , path ) ; } return existingPath == null ? path : ( PathBuilder < A > ) existingPath ; }
Create a PathBuilder for the given property with the given type
11,819
public < A , E > ArrayPath < A , E > getArray ( String property , Class < A > type ) { validate ( property , Array . newInstance ( type , 0 ) . getClass ( ) ) ; return super . createArray ( property , type ) ; }
Create a ArrayPath instance for the given property and the given array type
11,820
public BooleanPath get ( BooleanPath path ) { BooleanPath newPath = getBoolean ( toString ( path ) ) ; return addMetadataOf ( newPath , path ) ; }
Create a new Boolean typed path
11,821
public StringPath get ( StringPath path ) { StringPath newPath = getString ( toString ( path ) ) ; return addMetadataOf ( newPath , path ) ; }
Create a new String typed path
11,822
public String [ ] getCustomTypes ( ) { String [ ] customTypes = new String [ this . customTypes . size ( ) ] ; for ( int i = 0 ; i < this . customTypes . size ( ) ; i ++ ) { CustomType customType = this . customTypes . get ( i ) ; customTypes [ i ] = customType . getClassName ( ) ; } return customTypes ; }
Gets a list of custom types
11,823
public void setCustomTypes ( String [ ] strings ) { this . customTypes . clear ( ) ; for ( String string : strings ) { CustomType customType = new CustomType ( ) ; customType . setClassName ( string ) ; this . customTypes . add ( customType ) ; } }
Sets a list of custom types
11,824
@ SuppressWarnings ( "unchecked" ) protected List < Expression < ? > > getIdentifierColumns ( List < JoinExpression > joins , boolean alias ) { if ( joins . size ( ) == 1 ) { JoinExpression join = joins . get ( 0 ) ; if ( join . getTarget ( ) instanceof RelationalPath ) { return ( ( RelationalPath ) join . getTarget ( ) ) . getColumns ( ) ; } else { return Collections . emptyList ( ) ; } } else { List < Expression < ? > > rv = Lists . newArrayList ( ) ; int counter = 0 ; for ( JoinExpression join : joins ) { if ( join . getTarget ( ) instanceof RelationalPath ) { RelationalPath path = ( RelationalPath ) join . getTarget ( ) ; List < Expression < ? > > columns ; if ( path . getPrimaryKey ( ) != null ) { columns = path . getPrimaryKey ( ) . getLocalColumns ( ) ; } else { columns = path . getColumns ( ) ; } if ( alias ) { for ( Expression < ? > column : columns ) { rv . add ( ExpressionUtils . as ( column , "col" + ( ++ counter ) ) ) ; } } else { rv . addAll ( columns ) ; } } else { return Collections . emptyList ( ) ; } } return rv ; } }
Return a list of expressions that can be used to uniquely define the query sources
11,825
@ SuppressWarnings ( "unchecked" ) public < T > PathBuilder < T > create ( Class < T > type ) { PathBuilder < T > rv = ( PathBuilder < T > ) paths . get ( type ) ; if ( rv == null ) { rv = new PathBuilder < T > ( type , variableName ( type ) ) ; paths . put ( type , rv ) ; } return rv ; }
Create a new PathBuilder instance for the given type
11,826
@ WithBridgeMethods ( value = MySQLQuery . class , castRequired = true ) public C bigResult ( ) { return addFlag ( Position . AFTER_SELECT , SQL_BIG_RESULT ) ; }
For SQL_BIG_RESULT MySQL directly uses disk - based temporary tables if needed and prefers sorting to using a temporary table with a key on the GROUP BY elements .
11,827
@ WithBridgeMethods ( value = MySQLQuery . class , castRequired = true ) public C bufferResult ( ) { return addFlag ( Position . AFTER_SELECT , SQL_BUFFER_RESULT ) ; }
SQL_BUFFER_RESULT forces the result to be put into a temporary table . This helps MySQL free the table locks early and helps in cases where it takes a long time to send the result set to the client . This option can be used only for top - level SELECT statements not for subqueries or following UNION .
11,828
@ WithBridgeMethods ( value = MySQLQuery . class , castRequired = true ) public C cache ( ) { return addFlag ( Position . AFTER_SELECT , SQL_CACHE ) ; }
SQL_CACHE tells MySQL to store the result in the query cache if it is cacheable and the value of the query_cache_type system variable is 2 or DEMAND .
11,829
@ WithBridgeMethods ( value = MySQLQuery . class , castRequired = true ) public C highPriority ( ) { return addFlag ( Position . AFTER_SELECT , HIGH_PRIORITY ) ; }
HIGH_PRIORITY gives the SELECT higher priority than a statement that updates a table . You should use this only for queries that are very fast and must be done at once .
11,830
@ WithBridgeMethods ( value = MySQLQuery . class , castRequired = true ) public C into ( String var ) { return addFlag ( Position . END , "\ninto " + var ) ; }
SELECT ... INTO var_list selects column values and stores them into variables .
11,831
@ WithBridgeMethods ( value = MySQLQuery . class , castRequired = true ) public C intoOutfile ( File file ) { return addFlag ( Position . END , "\ninto outfile '" + file . getPath ( ) + "'" ) ; }
SELECT ... INTO OUTFILE writes the selected rows to a file . Column and line terminators c an be specified to produce a specific output format .
11,832
@ WithBridgeMethods ( value = MySQLQuery . class , castRequired = true ) public C lockInShareMode ( ) { return addFlag ( Position . END , LOCK_IN_SHARE_MODE ) ; }
Using LOCK IN SHARE MODE sets a shared lock that permits other transactions to read the examined rows but not to update or delete them .
11,833
@ WithBridgeMethods ( value = MySQLQuery . class , castRequired = true ) public C noCache ( ) { return addFlag ( Position . AFTER_SELECT , SQL_NO_CACHE ) ; }
With SQL_NO_CACHE the server does not use the query cache . It neither checks the query cache to see whether the result is already cached nor does it cache the query result .
11,834
@ WithBridgeMethods ( value = MySQLQuery . class , castRequired = true ) public C smallResult ( ) { return addFlag ( Position . AFTER_SELECT , SQL_SMALL_RESULT ) ; }
For SQL_SMALL_RESULT MySQL uses fast temporary tables to store the resulting table instead of using sorting . This should not normally be needed .
11,835
@ WithBridgeMethods ( value = MySQLQuery . class , castRequired = true ) public C straightJoin ( ) { return addFlag ( Position . AFTER_SELECT , STRAIGHT_JOIN ) ; }
STRAIGHT_JOIN forces the optimizer to join the tables in the order in which they are listed in the FROM clause . You can use this to speed up a query if the optimizer joins the tables in nonoptimal order . STRAIGHT_JOIN also can be used in the table_references list .
11,836
public static < T > PathMetadata forDelegate ( Path < T > delegate ) { return new PathMetadata ( delegate , delegate , PathType . DELEGATE ) ; }
Create a new PathMetadata instance for delegate access
11,837
public static < KT > PathMetadata forMapAccess ( Path < ? > parent , Expression < KT > key ) { return new PathMetadata ( parent , key , PathType . MAPVALUE ) ; }
Create a new PathMetadata instance for key based map access
11,838
public static < KT > PathMetadata forMapAccess ( Path < ? > parent , KT key ) { return new PathMetadata ( parent , key , PathType . MAPVALUE_CONSTANT ) ; }
Create a new PathMetadata instance for for key based map access
11,839
public static PathMetadata forProperty ( Path < ? > parent , String property ) { return new PathMetadata ( parent , property , PathType . PROPERTY ) ; }
Create a new PathMetadata instance for property access
11,840
public Object put ( String name , Object value ) { if ( bean != null ) { Object oldValue = get ( name ) ; Method method = getWriteMethod ( name ) ; if ( method == null ) { throw new IllegalArgumentException ( "The bean of type: " + bean . getClass ( ) . getName ( ) + " has no property called: " + name ) ; } try { Object [ ] arguments = createWriteMethodArguments ( method , value ) ; method . invoke ( bean , arguments ) ; Object newValue = get ( name ) ; firePropertyChange ( name , oldValue , newValue ) ; } catch ( InvocationTargetException e ) { throw new IllegalArgumentException ( e . getMessage ( ) ) ; } catch ( IllegalAccessException e ) { throw new IllegalArgumentException ( e . getMessage ( ) ) ; } return oldValue ; } return null ; }
Sets the bean property with the given name to the given value .
11,841
public Collection < Object > values ( ) { List < Object > answer = new ArrayList < Object > ( readMethods . size ( ) ) ; for ( Iterator < Object > iter = valueIterator ( ) ; iter . hasNext ( ) ; ) { answer . add ( iter . next ( ) ) ; } return answer ; }
Returns the values for the BeanMap .
11,842
public Iterator < Entry < String , Object > > entryIterator ( ) { final Iterator < String > iter = keyIterator ( ) ; return new Iterator < Entry < String , Object > > ( ) { public boolean hasNext ( ) { return iter . hasNext ( ) ; } public Entry < String , Object > next ( ) { String key = iter . next ( ) ; Object value = get ( key ) ; return new MyMapEntry ( BeanMap . this , key , value ) ; } public void remove ( ) { throw new UnsupportedOperationException ( "remove() not supported for BeanMap" ) ; } } ; }
Convenience method for getting an iterator over the entries .
11,843
public < T > List < T > subList ( List < T > list ) { if ( ! list . isEmpty ( ) ) { int from = offset != null ? toInt ( offset ) : 0 ; int to = limit != null ? ( from + toInt ( limit ) ) : list . size ( ) ; return list . subList ( from , Math . min ( to , list . size ( ) ) ) ; } else { return list ; } }
Get a sublist based on the restriction of limit and offset
11,844
public NumberExpression < Double > x ( ) { if ( x == null ) { x = Expressions . numberOperation ( Double . class , SpatialOps . X , mixin ) ; } return x ; }
The x - coordinate value for this Point .
11,845
public NumberExpression < Double > y ( ) { if ( y == null ) { y = Expressions . numberOperation ( Double . class , SpatialOps . Y , mixin ) ; } return y ; }
The y - coordinate value for this Point .
11,846
public NumberExpression < Double > z ( ) { if ( z == null ) { z = Expressions . numberOperation ( Double . class , SpatialOps . Z , mixin ) ; } return z ; }
The z - coordinate value for this Point if it has one . Returns NIL otherwise .
11,847
public NumberExpression < Double > m ( ) { if ( m == null ) { m = Expressions . numberOperation ( Double . class , SpatialOps . M , mixin ) ; } return m ; }
The m - coordinate value for this Point if it has one . Returns NIL otherwise .
11,848
public ImmutableList < Object > getBindings ( ) { final ImmutableList . Builder < Object > builder = ImmutableList . builder ( ) ; for ( Object o : getNullFriendlyBindings ( ) ) { if ( o != null ) { builder . add ( o ) ; } } return builder . build ( ) ; }
Returns the bindings for this instance .
11,849
public PointExpression < Point > centroid ( ) { if ( centroid == null ) { centroid = GeometryExpressions . pointOperation ( SpatialOps . CENTROID , mixin ) ; } return centroid ; }
The mathematical centroid for this MultiSurface . The result is not guaranteed to be on this MultiSurface .
11,850
public PointExpression < Point > pointOnSurface ( ) { if ( pointOnSurface == null ) { pointOnSurface = GeometryExpressions . pointOperation ( SpatialOps . POINT_ON_SURFACE , mixin ) ; } return pointOnSurface ; }
A Point guaranteed to be on this MultiSurface .
11,851
@ SuppressWarnings ( "unchecked" ) public < U extends BeanPath < ? extends T > > U as ( Class < U > clazz ) { try { if ( ! casts . containsKey ( clazz ) ) { PathMetadata metadata ; if ( pathMixin . getMetadata ( ) . getPathType ( ) != PathType . COLLECTION_ANY ) { metadata = PathMetadataFactory . forDelegate ( pathMixin ) ; } else { metadata = pathMixin . getMetadata ( ) ; } U rv ; if ( inits != null && pathMixin . getMetadata ( ) . getPathType ( ) != PathType . VARIABLE ) { rv = clazz . getConstructor ( PathMetadata . class , PathInits . class ) . newInstance ( metadata , inits ) ; } else { rv = clazz . getConstructor ( PathMetadata . class ) . newInstance ( metadata ) ; } casts . put ( clazz , rv ) ; return rv ; } else { return ( U ) casts . get ( clazz ) ; } } catch ( InstantiationException e ) { throw new ExpressionException ( e . getMessage ( ) , e ) ; } catch ( IllegalAccessException e ) { throw new ExpressionException ( e . getMessage ( ) , e ) ; } catch ( InvocationTargetException e ) { throw new ExpressionException ( e . getMessage ( ) , e ) ; } catch ( NoSuchMethodException e ) { throw new ExpressionException ( e . getMessage ( ) , e ) ; } }
Cast the path to a subtype querytype
11,852
protected < A , E > ArrayPath < A , E > createArray ( String property , Class < ? super A > type ) { return add ( new ArrayPath < A , E > ( type , forProperty ( property ) ) ) ; }
Create a new array path
11,853
@ SuppressWarnings ( "unchecked" ) protected < A extends Number & Comparable < ? > > NumberPath < A > createNumber ( String property , Class < ? super A > type ) { return add ( new NumberPath < A > ( ( Class ) type , forProperty ( property ) ) ) ; }
Create a new Number path
11,854
@ SuppressWarnings ( "unchecked" ) protected < A extends Comparable > TimePath < A > createTime ( String property , Class < ? super A > type ) { return add ( new TimePath < A > ( ( Class ) type , forProperty ( property ) ) ) ; }
Create a new Time path
11,855
public static < T extends Geometry > JTSGeometryExpression < T > setSRID ( Expression < T > expr , int srid ) { return geometryOperation ( expr . getType ( ) , SpatialOps . SET_SRID , expr , ConstantImpl . create ( srid ) ) ; }
Sets the SRID on a geometry to a particular integer value .
11,856
public static NumberExpression < Double > xmin ( JTSGeometryExpression < ? > expr ) { return Expressions . numberOperation ( Double . class , SpatialOps . XMIN , expr ) ; }
Returns X minima of a bounding box 2d or 3d or a geometry .
11,857
public static NumberExpression < Double > xmax ( JTSGeometryExpression < ? > expr ) { return Expressions . numberOperation ( Double . class , SpatialOps . XMAX , expr ) ; }
Returns X maxima of a bounding box 2d or 3d or a geometry .
11,858
public static NumberExpression < Double > ymin ( JTSGeometryExpression < ? > expr ) { return Expressions . numberOperation ( Double . class , SpatialOps . YMIN , expr ) ; }
Returns Y minima of a bounding box 2d or 3d or a geometry .
11,859
public static JTSGeometryExpression < ? > collect ( Expression < ? extends Geometry > expr1 , Expression < ? extends Geometry > expr2 ) { return geometryOperation ( SpatialOps . COLLECT2 , expr1 , expr2 ) ; }
Return a specified ST_Geometry value from a collection of other geometries .
11,860
public static < T extends Geometry > JTSGeometryExpression < T > translate ( Expression < T > expr , float deltax , float deltay ) { return geometryOperation ( expr . getType ( ) , SpatialOps . TRANSLATE , expr , ConstantImpl . create ( deltax ) , ConstantImpl . create ( deltay ) ) ; }
Translates the geometry to a new location using the numeric parameters as offsets .
11,861
public SQLMergeClause addFlag ( Position position , String flag ) { metadata . addFlag ( new QueryFlag ( position , flag ) ) ; return this ; }
Add the given String literal at the given position as a query flag
11,862
@ SuppressWarnings ( "unchecked" ) public < T > T executeWithKey ( Path < T > path ) { return executeWithKey ( ( Class < T > ) path . getType ( ) , path ) ; }
Execute the clause and return the generated key with the type of the given path . If no rows were created null is returned otherwise the key of the first row is returned .
11,863
@ SuppressWarnings ( "unchecked" ) public < T > List < T > executeWithKeys ( Path < T > path ) { return executeWithKeys ( ( Class < T > ) path . getType ( ) , path ) ; }
Execute the clause and return the generated key with the type of the given path . If no rows were created or the referenced column is not a generated key null is returned . Otherwise the key of the first row is returned .
11,864
@ SuppressWarnings ( "unchecked" ) @ WithBridgeMethods ( value = SQLUpdateClause . class , castRequired = true ) public C populate ( Object bean ) { return populate ( bean , DefaultMapper . DEFAULT ) ; }
Populate the UPDATE clause with the properties of the given bean . The properties need to match the fields of the clause s entity instance . Primary key columns are skipped in the population .
11,865
@ SuppressWarnings ( { "rawtypes" , "unchecked" } ) @ WithBridgeMethods ( value = SQLUpdateClause . class , castRequired = true ) public < T > C populate ( T obj , Mapper < T > mapper ) { Collection < ? extends Path < ? > > primaryKeyColumns = entity . getPrimaryKey ( ) != null ? entity . getPrimaryKey ( ) . getLocalColumns ( ) : Collections . < Path < ? > > emptyList ( ) ; Map < Path < ? > , Object > values = mapper . createMap ( entity , obj ) ; for ( Map . Entry < Path < ? > , Object > entry : values . entrySet ( ) ) { if ( ! primaryKeyColumns . contains ( entry . getKey ( ) ) ) { set ( ( Path ) entry . getKey ( ) , entry . getValue ( ) ) ; } } return ( C ) this ; }
Populate the UPDATE clause with the properties of the given bean using the given Mapper .
11,866
public static BooleanExpression allOf ( BooleanExpression ... exprs ) { BooleanExpression rv = null ; for ( BooleanExpression b : exprs ) { rv = rv == null ? b : rv . and ( b ) ; } return rv ; }
Get the intersection of the given Boolean expressions
11,867
public static BooleanExpression anyOf ( BooleanExpression ... exprs ) { BooleanExpression rv = null ; for ( BooleanExpression b : exprs ) { rv = rv == null ? b : rv . or ( b ) ; } return rv ; }
Get the union of the given Boolean expressions
11,868
public static < T extends Number & Comparable < ? > > NumberPath < T > numberPath ( Class < ? extends T > type , PathMetadata metadata ) { return new NumberPath < T > ( type , metadata ) ; }
Create new Path expression
11,869
@ SuppressWarnings ( "unchecked" ) public static < T > SimpleExpression < T > list ( Class < T > clazz , SimpleExpression < ? > ... exprs ) { SimpleExpression < T > rv = ( SimpleExpression < T > ) exprs [ 0 ] ; for ( int i = 1 ; i < exprs . length ; i ++ ) { rv = new SimpleOperation < T > ( clazz , Ops . LIST , rv , exprs [ i ] ) ; } return rv ; }
Combine the given expressions into a list expression
11,870
@ SuppressWarnings ( "unchecked" ) public static < T > SimpleExpression < T > set ( Class < T > clazz , SimpleExpression < ? > ... exprs ) { SimpleExpression < T > rv = ( SimpleExpression < T > ) exprs [ 0 ] ; for ( int i = 1 ; i < exprs . length ; i ++ ) { rv = new SimpleOperation < T > ( clazz , Ops . SET , rv , exprs [ i ] ) ; } return rv ; }
Combine the given expressions into a set expression
11,871
public static < T extends Enum < T > > EnumOperation < T > enumOperation ( Class < ? extends T > type , Operator operator , Expression < ? > ... args ) { return new EnumOperation < T > ( type , operator , args ) ; }
Create a new Enum operation expression
11,872
public static < T > CollectionExpression < Collection < T > , T > collectionOperation ( Class < T > elementType , Operator operator , Expression < ? > ... args ) { return new CollectionOperation < T > ( elementType , operator , args ) ; }
Create a new Collection operation expression
11,873
public static BooleanExpression asBoolean ( Expression < Boolean > expr ) { Expression < Boolean > underlyingMixin = ExpressionUtils . extract ( expr ) ; if ( underlyingMixin instanceof PathImpl ) { return new BooleanPath ( ( PathImpl < Boolean > ) underlyingMixin ) ; } else if ( underlyingMixin instanceof PredicateOperation ) { return new BooleanOperation ( ( PredicateOperation ) underlyingMixin ) ; } else if ( underlyingMixin instanceof PredicateTemplate ) { return new BooleanTemplate ( ( PredicateTemplate ) underlyingMixin ) ; } else { return new BooleanExpression ( underlyingMixin ) { private static final long serialVersionUID = - 8712299418891960222L ; public < R , C > R accept ( Visitor < R , C > v , C context ) { return this . mixin . accept ( v , context ) ; } } ; } }
Create a new BooleanExpression
11,874
public static StringExpression asString ( Expression < String > expr ) { Expression < String > underlyingMixin = ExpressionUtils . extract ( expr ) ; if ( underlyingMixin instanceof PathImpl ) { return new StringPath ( ( PathImpl < String > ) underlyingMixin ) ; } else if ( underlyingMixin instanceof OperationImpl ) { return new StringOperation ( ( OperationImpl < String > ) underlyingMixin ) ; } else if ( underlyingMixin instanceof TemplateExpressionImpl ) { return new StringTemplate ( ( TemplateExpressionImpl < String > ) underlyingMixin ) ; } else { return new StringExpression ( underlyingMixin ) { private static final long serialVersionUID = 8007203530480765244L ; public < R , C > R accept ( Visitor < R , C > v , C context ) { return this . mixin . accept ( v , context ) ; } } ; } }
Create a new StringExpression
11,875
public static < T > SimpleExpression < T > asSimple ( Expression < T > expr ) { Expression < T > underlyingMixin = ExpressionUtils . extract ( expr ) ; if ( underlyingMixin instanceof PathImpl ) { return new SimplePath < T > ( ( PathImpl < T > ) underlyingMixin ) ; } else if ( underlyingMixin instanceof OperationImpl ) { return new SimpleOperation < T > ( ( OperationImpl < T > ) underlyingMixin ) ; } else if ( underlyingMixin instanceof TemplateExpressionImpl ) { return new SimpleTemplate < T > ( ( TemplateExpressionImpl < T > ) underlyingMixin ) ; } else { return new SimpleExpression < T > ( underlyingMixin ) { private static final long serialVersionUID = - 8712299418891960222L ; public < R , C > R accept ( Visitor < R , C > v , C context ) { return this . mixin . accept ( v , context ) ; } } ; } }
Create a new SimpleExpression
11,876
public static BooleanExpression near ( Expression < Double [ ] > expr , double latVal , double longVal ) { return Expressions . booleanOperation ( MongodbOps . NEAR , expr , ConstantImpl . create ( new Double [ ] { latVal , longVal } ) ) ; }
Finds the closest points relative to the given location and orders the results with decreasing proximity
11,877
public static BooleanExpression nearSphere ( Expression < Double [ ] > expr , double latVal , double longVal ) { return Expressions . booleanOperation ( MongodbOps . NEAR_SPHERE , expr , ConstantImpl . create ( new Double [ ] { latVal , longVal } ) ) ; }
Finds the closest points relative to the given location on a sphere and orders the results with decreasing proximity
11,878
public static < C > Constructor < C > getConstructor ( Class < C > type , Class < ? > [ ] givenTypes ) throws NoSuchMethodException { return type . getConstructor ( givenTypes ) ; }
Returns the constructor where the formal parameter list matches the givenTypes argument .
11,879
public static Class < ? > [ ] getConstructorParameters ( Class < ? > type , Class < ? > [ ] givenTypes ) { next_constructor : for ( Constructor < ? > constructor : type . getConstructors ( ) ) { int matches = 0 ; Class < ? > [ ] parameters = constructor . getParameterTypes ( ) ; Iterator < Class < ? > > parameterIterator = Arrays . asList ( parameters ) . iterator ( ) ; if ( ! isEmpty ( givenTypes ) && ! isEmpty ( parameters ) ) { Class < ? > parameter = null ; for ( Class < ? > argument : givenTypes ) { if ( parameterIterator . hasNext ( ) ) { parameter = parameterIterator . next ( ) ; if ( ! compatible ( parameter , argument ) ) { continue next_constructor ; } matches ++ ; } else if ( constructor . isVarArgs ( ) ) { if ( ! compatible ( parameter , argument ) ) { continue next_constructor ; } } else { continue next_constructor ; } } if ( matches == parameters . length ) { return parameters ; } } else if ( isEmpty ( givenTypes ) && isEmpty ( parameters ) ) { return NO_ARGS ; } } throw new ExpressionException ( "No constructor found for " + type . toString ( ) + " with parameters: " + Arrays . deepToString ( givenTypes ) ) ; }
Returns the parameters for the constructor that matches the given types .
11,880
public static Iterable < Function < Object [ ] , Object [ ] > > getTransformers ( Constructor < ? > constructor ) { Iterable < ArgumentTransformer > transformers = Lists . newArrayList ( new PrimitiveAwareVarArgsTransformer ( constructor ) , new PrimitiveTransformer ( constructor ) , new VarArgsTransformer ( constructor ) ) ; return ImmutableList . < Function < Object [ ] , Object [ ] > > copyOf ( filter ( transformers , applicableFilter ) ) ; }
Returns a fetch of transformers applicable to the given constructor .
11,881
public NumberExpression < Integer > numPatches ( ) { if ( numPatches == null ) { numPatches = Expressions . numberOperation ( Integer . class , SpatialOps . NUM_SURFACES , mixin ) ; } return numPatches ; }
Returns the number of including polygons
11,882
public PolygonExpression < ? > patchN ( int n ) { return GeometryExpressions . polygonOperation ( SpatialOps . SURFACE , mixin , ConstantImpl . create ( n ) ) ; }
Returns a polygon in this surface the order is arbitrary .
11,883
public NumberExpression < Integer > numInteriorRing ( ) { if ( numInteriorRing == null ) { numInteriorRing = Expressions . numberOperation ( Integer . class , SpatialOps . NUM_INTERIOR_RING , mixin ) ; } return numInteriorRing ; }
Returns the number of interior rings in this Polygon .
11,884
public Q addJoinFlag ( String flag ) { return addJoinFlag ( flag , JoinFlag . Position . BEFORE_TARGET ) ; }
Add the given String literal as a join flag to the last added join with the position BEFORE_TARGET
11,885
@ SuppressWarnings ( "unchecked" ) public Q addJoinFlag ( String flag , JoinFlag . Position position ) { queryMixin . addJoinFlag ( new JoinFlag ( flag , position ) ) ; return ( Q ) this ; }
Add the given String literal as a join flag to the last added join
11,886
public Q addFlag ( Position position , String prefix , Expression < ? > expr ) { Expression < ? > flag = Expressions . template ( expr . getType ( ) , prefix + "{0}" , expr ) ; return queryMixin . addFlag ( new QueryFlag ( position , flag ) ) ; }
Add the given prefix and expression as a general query flag
11,887
public Q addFlag ( Position position , String flag ) { return queryMixin . addFlag ( new QueryFlag ( position , flag ) ) ; }
Add the given String literal as query flag
11,888
public void serialize ( QueryMetadata metadata , boolean forCountRow , SQLSerializer context ) { context . serializeForQuery ( metadata , forCountRow ) ; if ( ! metadata . getFlags ( ) . isEmpty ( ) ) { context . serialize ( Position . END , metadata . getFlags ( ) ) ; } }
template method for SELECT serialization
11,889
public void serializeMerge ( QueryMetadata metadata , RelationalPath < ? > entity , List < Path < ? > > keys , List < Path < ? > > columns , List < Expression < ? > > values , SubQueryExpression < ? > subQuery , SQLSerializer context ) { context . serializeForMerge ( metadata , entity , keys , columns , values , subQuery ) ; if ( ! metadata . getFlags ( ) . isEmpty ( ) ) { context . serialize ( Position . END , metadata . getFlags ( ) ) ; } }
template method for MERGE serialization
11,890
protected void serializeModifiers ( QueryMetadata metadata , SQLSerializer context ) { QueryModifiers mod = metadata . getModifiers ( ) ; if ( mod . getLimit ( ) != null ) { context . handle ( limitTemplate , mod . getLimit ( ) ) ; } else if ( limitRequired ) { context . handle ( limitTemplate , maxLimit ) ; } if ( mod . getOffset ( ) != null ) { context . handle ( offsetTemplate , mod . getOffset ( ) ) ; } }
template method for LIMIT and OFFSET serialization
11,891
@ SuppressWarnings ( "unchecked" ) public HibernateUpdateClause setLockMode ( Path < ? > path , LockMode lockMode ) { lockModes . put ( path , lockMode ) ; return this ; }
Set the lock mode for the given path .
11,892
public static ColumnMetadata getColumnMetadata ( Path < ? > path ) { Path < ? > parent = path . getMetadata ( ) . getParent ( ) ; if ( parent instanceof EntityPath ) { Object columnMetadata = ( ( EntityPath < ? > ) parent ) . getMetadata ( path ) ; if ( columnMetadata instanceof ColumnMetadata ) { return ( ColumnMetadata ) columnMetadata ; } } return ColumnMetadata . named ( path . getMetadata ( ) . getName ( ) ) ; }
Returns this path s column metadata if present . Otherwise returns default metadata where the column name is equal to the path s name .
11,893
public static String getName ( Path < ? > path ) { Path < ? > parent = path . getMetadata ( ) . getParent ( ) ; if ( parent instanceof EntityPath ) { Object columnMetadata = ( ( EntityPath < ? > ) parent ) . getMetadata ( path ) ; if ( columnMetadata instanceof ColumnMetadata ) { return ( ( ColumnMetadata ) columnMetadata ) . getName ( ) ; } } return path . getMetadata ( ) . getName ( ) ; }
Extract the column name for the given path returns the path name if no ColumnMetadata is attached
11,894
public static ColumnMetadata named ( String name ) { return new ColumnMetadata ( null , name , null , true , UNDEFINED , UNDEFINED ) ; }
Creates default column meta data with the given column name but without any type or constraint information . Use the fluent builder methods to further configure it .
11,895
public < A > Q from ( Path < A > entity , Iterable < ? extends A > col ) { iterables . put ( entity , col ) ; getMetadata ( ) . addJoin ( JoinType . DEFAULT , entity ) ; return queryMixin . getSelf ( ) ; }
Add a query source
11,896
public < A > Q bind ( Path < A > entity , Iterable < ? extends A > col ) { iterables . put ( entity , col ) ; return queryMixin . getSelf ( ) ; }
Bind the given collection to an already existing query source
11,897
public < P > Q innerJoin ( Path < ? extends Collection < P > > target , Path < P > alias ) { getMetadata ( ) . addJoin ( JoinType . INNERJOIN , createAlias ( target , alias ) ) ; return queryMixin . getSelf ( ) ; }
Define an inner join from the Collection typed path to the alias
11,898
public < P > Q leftJoin ( Path < ? extends Collection < P > > target , Path < P > alias ) { getMetadata ( ) . addJoin ( JoinType . LEFTJOIN , createAlias ( target , alias ) ) ; return queryMixin . getSelf ( ) ; }
Define a left join from the Collection typed path to the alias
11,899
public static < T > ArrayConstructorExpression < T > array ( Class < T [ ] > type , Expression < T > ... exprs ) { return new ArrayConstructorExpression < T > ( type , exprs ) ; }
Create a typed array projection for the given type and expressions