idx
int64
0
41.2k
question
stringlengths
73
5.81k
target
stringlengths
5
918
36,000
private boolean isCollectionAttribute ( PluralAttribute < ? super X , ? , ? > attribute ) { return attribute != null && attribute . getCollectionType ( ) . equals ( CollectionType . COLLECTION ) ; }
Checks if is collection attribute .
36,001
private boolean isListAttribute ( PluralAttribute < ? super X , ? , ? > attribute ) { return attribute != null && attribute . getCollectionType ( ) . equals ( CollectionType . LIST ) ; }
Checks if is list attribute .
36,002
private boolean isSetAttribute ( PluralAttribute < ? super X , ? , ? > attribute ) { return attribute != null && attribute . getCollectionType ( ) . equals ( CollectionType . SET ) ; }
Checks if is sets the attribute .
36,003
private boolean isMapAttribute ( PluralAttribute < ? super X , ? , ? > attribute ) { return attribute != null && attribute . getCollectionType ( ) . equals ( CollectionType . MAP ) ; }
Checks if is map attribute .
36,004
private < E > boolean isBindable ( Bindable < ? > attribute , Class < E > elementType ) { return attribute != null && attribute . getBindableJavaType ( ) . equals ( elementType ) ; }
Checks if is bindable .
36,005
private void checkForValid ( String paramName , Attribute < ? super X , ? > attribute ) { if ( attribute == null ) { throw new IllegalArgumentException ( "attribute of the given name and type is not present in the managed type, for name:" + paramName ) ; } }
Check for valid .
36,006
private Attribute < X , ? > getDeclaredAttribute ( String paramName , boolean checkValidity ) { Attribute < X , ? > attribute = ( Attribute < X , ? > ) getSingularAttribute ( paramName , false ) ; if ( attribute == null ) { attribute = ( Attribute < X , ? > ) getDeclaredPluralAttribute ( paramName ) ; } if ( checkValid...
Gets the declared attribute .
36,007
private void onValidity ( String paramString , boolean checkValidity , SingularAttribute < ? super X , ? > attribute ) { if ( checkValidity ) { checkForValid ( paramString , attribute ) ; } }
On validity check .
36,008
private void bindTypeAnnotations ( ) { for ( Class < ? extends Annotation > ann : validJPAAnnotations ) { if ( getJavaType ( ) . isAnnotationPresent ( ann ) ) { checkForValid ( ) ; Annotation annotation = getJavaType ( ) . getAnnotation ( ann ) ; if ( ann . isAssignableFrom ( AttributeOverride . class ) ) { bindAttribu...
Bind type annotations .
36,009
private void bindAttribute ( Annotation annotation ) { String fieldname = ( ( AttributeOverride ) annotation ) . name ( ) ; Column column = ( ( AttributeOverride ) annotation ) . column ( ) ; ( ( AbstractManagedType ) this . superClazzType ) . columnBindings . put ( fieldname , column ) ; }
Bind attribute .
36,010
private InheritanceModel buildInheritenceModel ( ) { InheritanceModel model = null ; if ( superClazzType != null ) { if ( superClazzType . getPersistenceType ( ) . equals ( PersistenceType . ENTITY ) && superClazzType . getJavaType ( ) . isAnnotationPresent ( Inheritance . class ) ) { Inheritance inheritenceAnn = super...
Build inheritance model .
36,011
private InheritanceModel onStrategyType ( InheritanceModel model , InheritanceType strategyType , String descriminator , String descriminatorValue , String tableName , String schemaName ) { switch ( strategyType ) { case SINGLE_TABLE : if ( superClazzType . getJavaType ( ) . isAnnotationPresent ( DiscriminatorColumn . ...
On strategy type .
36,012
private SchemaManager getSchemaManagerForPu ( final String persistenceUnit ) { SchemaManager schemaManager = null ; Map < String , Object > externalProperties = KunderaCoreUtils . getExternalProperties ( persistenceUnit , externalPropertyMap , persistenceUnits ) ; if ( getSchemaProperty ( persistenceUnit , externalProp...
Return schema manager for pu .
36,013
private void addTableGenerator ( ApplicationMetadata appMetadata , String persistenceUnit , List < TableInfo > tableInfos , EntityMetadata entityMetadata ) { Metamodel metamodel = appMetadata . getMetamodel ( persistenceUnit ) ; IdDiscriptor keyValue = ( ( MetamodelImpl ) metamodel ) . getKeyValue ( entityMetadata . ge...
Add tableGenerator to table info .
36,014
private void addJoinColumnToInfo ( String joinColumn , TableInfo targetTableInfo , List < TableInfo > targetTableInfos , EntityMetadata m ) { if ( ! joinColumn . equals ( targetTableInfo . getIdColumnName ( ) ) ) { if ( ! targetTableInfos . isEmpty ( ) && targetTableInfos . contains ( targetTableInfo ) ) { int idx = ta...
adds join column name to the table Info of entity .
36,015
private EmbeddedColumnInfo getEmbeddedColumn ( TableInfo tableInfo , EmbeddableType embeddableType , String embeddableColName , Class embeddedEntityClass , Field field ) { String [ ] orderByColumns = null ; if ( field . isAnnotationPresent ( OrderBy . class ) ) { OrderBy order = ( OrderBy ) field . getAnnotation ( Orde...
Get Embedded column info .
36,016
private ColumnInfo getColumn ( TableInfo tableInfo , Attribute column , PropertyIndex indexedColumn , String [ ] orderByColumns ) { ColumnInfo columnInfo = new ColumnInfo ( ) ; if ( column . getJavaType ( ) . isAnnotationPresent ( OrderBy . class ) ) { OrderBy order = ( OrderBy ) column . getJavaType ( ) . getAnnotatio...
getColumn method return ColumnInfo for the given column
36,017
private String getOrderByColumn ( String [ ] orderByColumns , Attribute column ) { if ( orderByColumns != null ) { for ( String orderColumn : orderByColumns ) { String [ ] orderValue = orderColumn . split ( "\\s" ) ; String orderColumnName = orderValue [ 0 ] . substring ( orderValue [ 0 ] . lastIndexOf ( '.' ) + 1 ) ; ...
getOrderByColumn method return order by value of the column
36,018
private ColumnInfo getJoinColumn ( TableInfo tableInfo , String joinColumnName , Class columnType ) { ColumnInfo columnInfo = new ColumnInfo ( ) ; columnInfo . setColumnName ( joinColumnName ) ; columnInfo . setIndexable ( true ) ; IndexInfo indexInfo = new IndexInfo ( joinColumnName ) ; tableInfo . addToIndexedColumnL...
getJoinColumn method return ColumnInfo for the join column
36,019
private String getSchemaProperty ( String persistenceUnit , Map < String , Object > externalProperties ) { PersistenceUnitMetadata persistenceUnitMetadata = kunderaMetadata . getApplicationMetadata ( ) . getPersistenceUnitMetadata ( persistenceUnit ) ; String autoDdlOption = externalProperties != null ? ( String ) exte...
getKunderaProperty method return auto schema generation property for give persistence unit .
36,020
@ SuppressWarnings ( "unchecked" ) public static PropertyAccessor getPropertyAccessor ( Class < ? > clazz ) { PropertyAccessor < ? > accessor ; if ( clazz . isEnum ( ) ) { accessor = new EnumAccessor ( ) ; } else { accessor = map . get ( clazz ) ; } if ( null == accessor ) { if ( Enum . class . isAssignableFrom ( clazz...
Gets the property accessor .
36,021
public HashMap < TranslationType , Map < String , StringBuilder > > prepareColumnOrColumnValues ( final Object record , final EntityMetadata entityMetadata , TranslationType type , Map < String , Object > externalProperties , final KunderaMetadata kunderaMetadata ) { HashMap < TranslationType , Map < String , StringBui...
Prepares column name or column values .
36,022
private void buildEmbeddedValue ( final Object record , MetamodelImpl metaModel , StringBuilder embeddedValueBuilder , SingularAttribute attribute ) { Field field = ( Field ) attribute . getJavaMember ( ) ; EmbeddableType embeddableKey = metaModel . embeddable ( field . getType ( ) ) ; Object embeddableKeyObj = Propert...
Builds the embedded value .
36,023
private void translateCompositeId ( final Object record , final EntityMetadata m , TranslationType type , MetamodelImpl metaModel , Map < String , StringBuilder > builders , Map < String , StringBuilder > columnBuilders , Map < String , Object > externalProperties , final KunderaMetadata kunderaMetadata , String tableN...
Translate composite id .
36,024
public void buildSetClauseForCounters ( StringBuilder builder , String field , Object value ) { builder = ensureCase ( builder , field , false ) ; builder . append ( EQ_CLAUSE ) ; builder = ensureCase ( builder , field , false ) ; builder . append ( INCR_COUNTER ) ; appendValue ( builder , value . getClass ( ) , value ...
Builds set clause for a given counter field .
36,025
public void buildSetClause ( EntityMetadata m , StringBuilder builder , String property , Object value ) { builder = ensureCase ( builder , property , false ) ; builder . append ( EQ_CLAUSE ) ; if ( m . isCounterColumnType ( ) ) { builder = ensureCase ( builder , property , false ) ; builder . append ( INCR_COUNTER ) ;...
Builds set clause for a given field .
36,026
public StringBuilder ensureCase ( StringBuilder builder , String fieldName , boolean useToken ) { if ( useToken ) { builder . append ( TOKEN ) ; } builder . append ( Constants . ESCAPE_QUOTE ) ; builder . append ( fieldName ) ; builder . append ( Constants . ESCAPE_QUOTE ) ; if ( useToken ) { builder . append ( CLOSE_B...
Ensures case for corresponding column name .
36,027
private boolean appendColumnValue ( StringBuilder builder , Object valueObj , Field column ) { Object value = PropertyAccessorHelper . getObject ( valueObj , column ) ; boolean isPresent = false ; isPresent = appendValue ( builder , column . getType ( ) , value , isPresent , false ) ; return isPresent ; }
Appends column value with parametrised builder object . Returns true if value is present .
36,028
public boolean appendValue ( StringBuilder builder , Class fieldClazz , Object value , boolean isPresent , boolean useToken ) { if ( List . class . isAssignableFrom ( fieldClazz ) ) { isPresent = appendList ( builder , value != null ? value : new ArrayList ( ) ) ; } else if ( Set . class . isAssignableFrom ( fieldClazz...
Appends value to builder object for given class type .
36,029
public void appendColumnName ( StringBuilder builder , String columnName , String dataType ) { ensureCase ( builder , columnName , false ) ; builder . append ( " " ) ; builder . append ( dataType ) ; }
Appends column name and data type also ensures case sensitivity .
36,030
private boolean isDate ( Class clazz ) { return clazz . isAssignableFrom ( Date . class ) || clazz . isAssignableFrom ( java . sql . Date . class ) || clazz . isAssignableFrom ( Timestamp . class ) || clazz . isAssignableFrom ( Time . class ) || clazz . isAssignableFrom ( Calendar . class ) ; }
Validates if input class is of type input .
36,031
public void buildOrderByClause ( StringBuilder builder , String field , Object orderType , boolean useToken ) { builder . append ( SPACE_STRING ) ; builder . append ( SORT_CLAUSE ) ; builder = ensureCase ( builder , field , useToken ) ; builder . append ( SPACE_STRING ) ; builder . append ( orderType ) ; }
Builds the order by clause .
36,032
public StringBuilder buildSelectQuery ( TableGeneratorDiscriptor descriptor ) { StringBuilder builder = new StringBuilder ( "Select " ) ; ensureCase ( builder , descriptor . getValueColumnName ( ) , false ) . append ( " from " ) ; ensureCase ( builder , descriptor . getTable ( ) , false ) . append ( " where " ) ; ensur...
Builds the select query .
36,033
@ SuppressWarnings ( "unchecked" ) private void addCallBackMethod ( EntityMetadata metadata , Class < ? > jpaAnnotation , CallbackMethod callbackMethod ) { Map < Class < ? > , List < ? extends CallbackMethod > > callBackMethodsMap = metadata . getCallbackMethodsMap ( ) ; List < CallbackMethod > list = ( List < Callback...
Adds the call back method .
36,034
private List < Class < ? > > getValidJPAAnnotationsFromMethod ( Class < ? > clazz , Method method , int numberOfParams , Class < ? > entityClazz ) { List < Class < ? > > annotations = new ArrayList < Class < ? > > ( ) ; for ( Annotation methodAnnotation : method . getAnnotations ( ) ) { Class < ? > methodAnnotationType...
Gets the valid jpa annotations from method .
36,035
private ConnectionPool getPoolUsingPolicy ( ) { if ( ! hostPools . isEmpty ( ) ) { return ( ConnectionPool ) loadBalancingPolicy . getPool ( hostPools . values ( ) ) ; } throw new KunderaException ( "All hosts are down. please check servers manully." ) ; }
Gets the pool using policy .
36,036
private ConnectionPool getNewPool ( String host , int port ) { CassandraHost cassandraHost = ( ( CassandraHostConfiguration ) configuration ) . getCassandraHost ( host , port ) ; hostPools . remove ( cassandraHost ) ; if ( cassandraHost . isRetryHost ( ) ) { logger . warn ( "Scheduling node for future retry" ) ; ( ( Ca...
Gets the new pool .
36,037
void releaseConnection ( ConnectionPool pool , Cassandra . Client conn ) { if ( pool != null && conn != null ) { pool . release ( conn ) ; } }
Release connection .
36,038
private LoadBalancingPolicy getPolicyInstance ( BalancingPolicy policy , Properties conProperties ) { LoadBalancingPolicy loadBalancingPolicy = null ; String isTokenAware = ( String ) conProperties . get ( "isTokenAware" ) ; String isLatencyAware = ( String ) conProperties . get ( "isLatencyAware" ) ; String whiteList ...
Gets the policy instance .
36,039
private Predicate < com . datastax . driver . core . Host > getHostFilterPredicate ( String hostFilterPolicy ) { Predicate < com . datastax . driver . core . Host > predicate = null ; Method getter = null ; Class < ? > hostFilterClazz = null ; try { hostFilterClazz = Class . forName ( hostFilterPolicy ) ; getter = host...
Gets the host filter predicate .
36,040
private Collection < InetSocketAddress > buildWhiteListCollection ( String whiteList ) { String [ ] list = whiteList . split ( Constants . COMMA ) ; Collection < InetSocketAddress > whiteListCollection = new ArrayList < InetSocketAddress > ( ) ; PersistenceUnitMetadata persistenceUnitMetadata = kunderaMetadata . getApp...
Builds the white list collection .
36,041
private com . datastax . driver . core . policies . RetryPolicy getCustomRetryPolicy ( Properties props ) { String customRetryPolicy = ( String ) props . get ( CUSTOM_RETRY_POLICY ) ; Class < ? > clazz = null ; Method getter = null ; try { clazz = Class . forName ( customRetryPolicy ) ; com . datastax . driver . core ....
Gets the custom retry policy .
36,042
private SocketOptions getSocketOptions ( Properties connectionProperties ) { SocketOptions socketConfig = new SocketOptions ( ) ; String connectTimeoutMillis = connectionProperties . getProperty ( CassandraConstants . SOCKET_TIMEOUT ) ; String readTimeoutMillis = connectionProperties . getProperty ( "readTimeoutMillis"...
Gets the socket options .
36,043
private PoolingOptions getPoolingOptions ( Properties connectionProperties ) { PoolingOptions options = new PoolingOptions ( ) ; String hostDistance = connectionProperties . getProperty ( "hostDistance" ) ; String maxConnectionsPerHost = connectionProperties . getProperty ( "maxConnectionsPerHost" ) ; String maxRequest...
Gets the pooling options .
36,044
private byte [ ] getBytes ( String jpaFieldName , EntityMetadata m , Object value ) { AbstractAttribute idCol = ( AbstractAttribute ) m . getIdAttribute ( ) ; MetamodelImpl metaModel = ( MetamodelImpl ) kunderaMetadata . getApplicationMetadata ( ) . getMetamodel ( m . getPersistenceUnit ( ) ) ; EntityType entity = meta...
Returns bytes of value object .
36,045
public static Map < String , Object > getExternalProperties ( String pu , Map < String , Object > externalProperties , String ... persistenceUnits ) { Map < String , Object > puProperty ; if ( persistenceUnits != null && persistenceUnits . length > 1 && externalProperties != null ) { puProperty = ( Map < String , Objec...
Retrun map of external properties for given pu ;
36,046
public static String prepareCompositeKey ( final EntityMetadata m , final Object compositeKey ) { Field [ ] fields = m . getIdAttribute ( ) . getBindableJavaType ( ) . getDeclaredFields ( ) ; StringBuilder stringBuilder = new StringBuilder ( ) ; for ( Field f : fields ) { if ( ! ReflectUtils . isTransientOrStatic ( f )...
Prepares composite key .
36,047
public static String prepareCompositeKey ( final SingularAttribute attribute , final MetamodelImpl metaModel , final Object compositeKey ) { Field [ ] fields = attribute . getBindableJavaType ( ) . getDeclaredFields ( ) ; EmbeddableType embeddable = metaModel . embeddable ( attribute . getBindableJavaType ( ) ) ; Strin...
Prepares composite key as a lucene key .
36,048
public static String resolvePath ( String input ) { if ( null == input ) { return input ; } Pattern pathPattern = Pattern . compile ( "\\$\\{(.+?)\\}" ) ; Matcher matcherPattern = pathPattern . matcher ( input ) ; StringBuffer sb = new StringBuffer ( ) ; EnvironmentConfiguration config = new EnvironmentConfiguration ( ...
Resolves variable in path given as string
36,049
public static String getLuceneQueryFromJPAQuery ( final KunderaQuery kunderaQuery , final KunderaMetadata kunderaMetadata ) { LuceneQueryBuilder queryBuilder = new LuceneQueryBuilder ( ) ; EntityMetadata metadata = kunderaQuery . getEntityMetadata ( ) ; MetamodelImpl metaModel = ( MetamodelImpl ) kunderaMetadata . getA...
Gets the lucene query from jpa query .
36,050
private static void isCompletePartitionKeyPresentInQuery ( Queue filterQueue , MetamodelImpl metaModel , EntityMetadata metadata ) { Set < String > partitionKeyFields = new HashSet < String > ( ) ; populateEmbeddedIdFields ( metaModel . embeddable ( metadata . getIdAttribute ( ) . getBindableJavaType ( ) ) . getAttribu...
cheking whether all the fields of partition key are present in the jpa query
36,051
private static void populateEmbeddedIdFields ( Set < Attribute > embeddedAttributes , MetamodelImpl metaModel , Set < String > embeddedIdFields ) { for ( Attribute attribute : embeddedAttributes ) { if ( ! ReflectUtils . isTransientOrStatic ( ( Field ) attribute . getJavaMember ( ) ) ) { if ( metaModel . isEmbeddable (...
recursively populate all the fields present in partition key
36,052
public static String getJPAColumnName ( String field , EntityMetadata entityMetadata , MetamodelImpl metaModel ) { if ( field . indexOf ( '.' ) > 0 ) { return ( ( AbstractAttribute ) metaModel . entity ( entityMetadata . getEntityClazz ( ) ) . getAttribute ( field . substring ( field . indexOf ( '.' ) + 1 , field . ind...
Gets the JPA column name .
36,053
public static void addToRow ( PartialRow row , String jpaColumnName , Object value , Type type ) { if ( value == null ) { row . setNull ( jpaColumnName ) ; } else { switch ( type ) { case BINARY : row . addBinary ( jpaColumnName , ( byte [ ] ) value ) ; break ; case BOOL : row . addBoolean ( jpaColumnName , ( Boolean )...
Adds the to row .
36,054
public static KuduPredicate getPredicate ( ColumnSchema column , KuduPredicate . ComparisonOp operator , Type type , Object key ) { switch ( type ) { case BINARY : return KuduPredicate . newComparisonPredicate ( column , operator , ( byte [ ] ) key ) ; case BOOL : return KuduPredicate . newComparisonPredicate ( column ...
Gets the predicate .
36,055
public static KuduPredicate getEqualComparisonPredicate ( ColumnSchema column , Type type , Object key ) { return getPredicate ( column , KuduPredicate . ComparisonOp . EQUAL , type , key ) ; }
Gets the equal comparison predicate .
36,056
public static boolean hasColumn ( Schema schema , String columnName ) { try { schema . getColumn ( columnName ) ; return true ; } catch ( IllegalArgumentException e ) { return false ; } }
Checks for column .
36,057
private void onSuperClass ( Class < ? > clazz , List < Field > keys ) { Class < ? > superClass = clazz . getSuperclass ( ) ; if ( superClass != null && ( superClass . isAnnotationPresent ( MappedSuperclass . class ) || superClass . isAnnotationPresent ( Entity . class ) ) ) { while ( superClass != null && ( superClass ...
Checks whether the defined class is a validone with an id field present either in class itself or its superclass
36,058
private void validateGeneratedValueAnnotation ( final Class < ? > clazz , Field field ) { Table table = clazz . getAnnotation ( Table . class ) ; if ( table != null ) { String schemaName = table . schema ( ) ; if ( schemaName != null && schemaName . indexOf ( '@' ) > 0 ) { schemaName = schemaName . substring ( 0 , sche...
validate generated value annotation if given .
36,059
private void checkForGenerator ( final Class < ? > clazz , Field field , GeneratedValue generatedValue , String schemaName ) { TableGenerator tableGenerator = field . getAnnotation ( TableGenerator . class ) ; SequenceGenerator sequenceGenerator = field . getAnnotation ( SequenceGenerator . class ) ; if ( tableGenerato...
Validate for generator .
36,060
private void setTTLPerRequest ( Object value ) { if ( value instanceof String ) { if ( Boolean . valueOf ( ( String ) value ) . booleanValue ( ) ) { this . cassandraClientBase . setTtlPerSession ( false ) ; } this . cassandraClientBase . setTtlPerRequest ( Boolean . valueOf ( ( String ) value ) ) ; } else if ( value in...
set ttl per request .
36,061
private void setConsistencylevel ( Object value ) { if ( value instanceof String ) { this . cassandraClientBase . setConsistencyLevel ( ConsistencyLevel . valueOf ( ( String ) value ) ) ; } else if ( value instanceof ConsistencyLevel ) { this . cassandraClientBase . setConsistencyLevel ( ( ConsistencyLevel ) value ) ; ...
set consistency level .
36,062
private Object populateEntityFromSlice ( EntityMetadata m , List < String > relationNames , boolean isWrapReq , Object e , Map < ByteBuffer , List < ColumnOrSuperColumn > > columnOrSuperColumnsFromRow ) throws CharacterCodingException { ThriftDataResultHelper dataGenerator = new ThriftDataResultHelper ( ) ; for ( ByteB...
Populate entity from slice .
36,063
public static String getValidType ( String type ) { return ( validationClassMapper . get ( type ) == null ) ? "binary" : validationClassMapper . get ( type ) ; }
Gets the valid type .
36,064
public static String getValidIdType ( String type ) { if ( validationClassMapperforId . get ( type ) == null ) { throw new KunderaException ( "ID of type: " + type + " is not supported for Kundera Oracle NOSQL." ) ; } return validationClassMapperforId . get ( type ) ; }
Gets the valid Id type .
36,065
public static WhereClause getWhereClause ( JPQLExpression jpqlExpression ) { WhereClause whereClause = null ; if ( hasWhereClause ( jpqlExpression ) ) { if ( isSelectStatement ( jpqlExpression ) ) { whereClause = ( WhereClause ) ( ( SelectStatement ) jpqlExpression . getQueryStatement ( ) ) . getWhereClause ( ) ; } els...
Gets the where clause .
36,066
public static OrderByClause getOrderByClause ( JPQLExpression jpqlExpression ) { OrderByClause orderByClause = null ; if ( hasOrderBy ( jpqlExpression ) ) { orderByClause = ( OrderByClause ) ( ( SelectStatement ) jpqlExpression . getQueryStatement ( ) ) . getOrderByClause ( ) ; } return orderByClause ; }
Gets the order by clause .
36,067
public static boolean hasWhereClause ( JPQLExpression jpqlExpression ) { if ( isSelectStatement ( jpqlExpression ) ) { return ( ( SelectStatement ) jpqlExpression . getQueryStatement ( ) ) . hasWhereClause ( ) ; } else if ( isUpdateStatement ( jpqlExpression ) ) { return ( ( UpdateStatement ) jpqlExpression . getQueryS...
Checks for where clause .
36,068
public static boolean hasGroupBy ( JPQLExpression jpqlExpression ) { if ( isSelectStatement ( jpqlExpression ) ) { return ( ( SelectStatement ) jpqlExpression . getQueryStatement ( ) ) . hasGroupByClause ( ) ; } return false ; }
Checks for group by .
36,069
public static boolean hasHaving ( JPQLExpression jpqlExpression ) { if ( isSelectStatement ( jpqlExpression ) ) { return ( ( SelectStatement ) jpqlExpression . getQueryStatement ( ) ) . hasHavingClause ( ) ; } return false ; }
Checks for having .
36,070
public static boolean hasOrderBy ( JPQLExpression jpqlExpression ) { if ( isSelectStatement ( jpqlExpression ) ) { return ( ( SelectStatement ) jpqlExpression . getQueryStatement ( ) ) . hasOrderByClause ( ) ; } return false ; }
Checks for order by .
36,071
private static void addToOutputColumns ( Expression selectExpression , EntityMetadata m , List < Map < String , Object > > columnsToOutput , KunderaMetadata kunderaMetadata ) { Map < String , Object > map = setFieldClazzAndColumnFamily ( selectExpression , m , kunderaMetadata ) ; columnsToOutput . add ( map ) ; }
Adds the to output columns .
36,072
public static List < Map < String , Object > > readSelectClause ( Expression selectExpression , EntityMetadata m , Boolean useLuceneOrES , KunderaMetadata kunderaMetadata ) { List < Map < String , Object > > columnsToOutput = new ArrayList < Map < String , Object > > ( ) ; if ( StateFieldPathExpression . class . isAssi...
Read select clause .
36,073
public static Map < String , Object > onRegExpression ( Expression expression , EntityMetadata m , KunderaMetadata kunderaMetadata , KunderaQuery kunderaQuery ) { RegexpExpression regExp = ( RegexpExpression ) expression ; Expression sfpExp = regExp . getStringExpression ( ) ; Map < String , Object > map = KunderaQuery...
On reg expression .
36,074
public static void onLogicalExpression ( Expression expression , EntityMetadata m , KunderaMetadata kunderaMetadata , KunderaQuery kunderaQuery ) { if ( expression instanceof OrExpression ) { kunderaQuery . addFilterClause ( "(" ) ; } traverse ( ( ( LogicalExpression ) expression ) . getLeftExpression ( ) , m , kundera...
On logical expression .
36,075
public static Map < String , Object > onInExpression ( Expression expression , EntityMetadata m , KunderaMetadata kunderaMetadata , KunderaQuery kunderaQuery ) { InExpression inExp = ( InExpression ) expression ; Expression sfpExp = inExp . getExpression ( ) ; Map < String , Object > map = KunderaQueryUtils . setFieldC...
On in expression .
36,076
public static Map < String , Object > onComparisonExpression ( Expression expression , EntityMetadata m , KunderaMetadata kunderaMetadata , KunderaQuery kunderaQuery ) { ComparisonExpression compExp = ( ComparisonExpression ) expression ; String condition = compExp . getIdentifier ( ) ; Expression sfpExp = compExp . ge...
On comparison expression .
36,077
public static Map < String , Object > onNullComparisonExpression ( Expression expression , EntityMetadata m , KunderaMetadata kunderaMetadata , KunderaQuery kunderaQuery ) { NullComparisonExpression compExp = ( NullComparisonExpression ) expression ; String condition = compExp . getIdentifier ( ) ; Expression sfpExp = ...
On null - comparison expression .
36,078
public static List < OrderByItem > getOrderByItems ( JPQLExpression jpqlExpression ) { List < OrderByItem > orderList = new LinkedList < > ( ) ; if ( hasOrderBy ( jpqlExpression ) ) { Expression orderByItems = getOrderByClause ( jpqlExpression ) . getOrderByItems ( ) ; if ( orderByItems instanceof CollectionExpression ...
Gets the order by items .
36,079
public static StringBuilder appendColumns ( StringBuilder builder , List < String > columns , String selectQuery , CQLTranslator translator ) { if ( columns != null ) { for ( String column : columns ) { translator . appendColumnName ( builder , column ) ; builder . append ( "," ) ; } } if ( builder . lastIndexOf ( "," ...
Append columns .
36,080
public List handleFindByRange ( EntityMetadata m , Client client , List result , Map < Boolean , List < IndexClause > > ixClause , boolean isRowKeyQuery , List < String > columns , int maxResults ) { List < IndexExpression > expressions = ixClause . get ( isRowKeyQuery ) . get ( 0 ) . getExpressions ( ) ; if ( expressi...
Handle find by range .
36,081
public List < EnhanceEntity > readFromIndexTable ( EntityMetadata m , Client client , Map < Boolean , List < IndexClause > > indexClauseMap ) { List < SearchResult > searchResults = new ArrayList < SearchResult > ( ) ; List < Object > primaryKeys = new ArrayList < Object > ( ) ; String columnFamilyName = m . getTableNa...
Read from index table .
36,082
Map < String , byte [ ] > getRowKeyValue ( List < IndexExpression > expressions , String primaryKeyName ) { Map < String , byte [ ] > rowKeys = new HashMap < String , byte [ ] > ( ) ; List < IndexExpression > rowExpressions = new ArrayList < IndexExpression > ( ) ; if ( expressions != null ) { for ( IndexExpression e :...
Returns list of row keys . First element will be min value and second will be major value .
36,083
public void addIdAttribute ( SingularAttribute < ? super X , ? > idAttribute , boolean isIdClass , Set < SingularAttribute < ? super X , ? > > idClassAttributes ) { this . idAttribute = idAttribute ; this . isIdClass = isIdClass ; this . idClassAttributes = idClassAttributes ; if ( MetadataUtils . onCheckValidationCons...
Adds the id attribute .
36,084
public < E > List < E > findByRange ( Class < E > entityClass , EntityMetadata metadata , byte [ ] startRow , byte [ ] endRow , String [ ] columns , Filter f , Queue filterClausequeue ) { EntityMetadata entityMetadata = KunderaMetadataManager . getEntityMetadata ( kunderaMetadata , entityClass ) ; String tableName = en...
Handles find by range query for given start and end row key range values .
36,085
private void addRecords ( HBaseDataWrapper columnWrapper , List < HBaseDataWrapper > embeddableData , List < HBaseDataWrapper > dataSet ) { dataSet . add ( columnWrapper ) ; if ( ! embeddableData . isEmpty ( ) ) { dataSet . addAll ( embeddableData ) ; } }
Add records to data wrapper .
36,086
private List fetchEntity ( Class entityClass , Object rowId , EntityMetadata entityMetadata , List < String > relationNames , String tableName , List results , FilterList filter , Queue filterClausequeue , String ... columns ) throws IOException { results = new ArrayList ( ) ; List < AbstractManagedType > subManagedTyp...
Fetch entity .
36,087
private List < AbstractManagedType > getSubManagedType ( Class entityClass , EntityMetadata entityMetadata ) { MetamodelImpl metaModel = ( MetamodelImpl ) kunderaMetadata . getApplicationMetadata ( ) . getMetamodel ( entityMetadata . getPersistenceUnit ( ) ) ; EntityType entityType = metaModel . entity ( entityClass ) ...
Gets the sub managed type .
36,088
public ThriftRow translateToThriftRow ( Map < ByteBuffer , List < ColumnOrSuperColumn > > coscResultMap , boolean isCounterType , Type columnFamilyType , ThriftRow row ) { ColumnFamilyType columnType = ColumnFamilyType . COLUMN ; if ( isCounterType ) { if ( columnFamilyType . equals ( Type . SUPER_COLUMN_FAMILY ) ) { c...
Translates into thrift row .
36,089
private void addInPredicateToBuilder ( KuduScannerBuilder scannerBuilder , ListIterator < Expression > inIter , Attribute attribute ) { List < Object > finalVals = new ArrayList < > ( ) ; Type type = KuduDBValidationClassMapper . getValidTypeForClass ( ( ( Field ) attribute . getJavaMember ( ) ) . getType ( ) ) ; Colum...
Adds the in predicate to builder .
36,090
private void addColumnRangePredicateToBuilder ( Field field , KuduScannerBuilder scannerBuilder , String columnName , String value , String identifier ) { Type type = KuduDBValidationClassMapper . getValidTypeForClass ( field . getType ( ) ) ; ColumnSchema column = new ColumnSchema . ColumnSchemaBuilder ( columnName , ...
Adds the column range predicate to builder .
36,091
private static Object setIntValue ( Field member , Object retVal ) { if ( member != null ) { if ( member . getType ( ) . isAssignableFrom ( byte . class ) ) { retVal = ( ( Integer ) retVal ) . byteValue ( ) ; } else if ( member . getType ( ) . isAssignableFrom ( short . class ) ) { retVal = ( ( Integer ) retVal ) . sho...
Sets the int value .
36,092
private static Object setTextValue ( Object entity , Field member , Object retVal ) { if ( member != null && member . getType ( ) . isEnum ( ) ) { EnumAccessor accessor = new EnumAccessor ( ) ; if ( member != null ) { retVal = accessor . fromString ( member . getType ( ) , ( String ) retVal ) ; } } else if ( member != ...
Sets the text value .
36,093
private Object populateEmbeddedObject ( SuperColumn sc , EntityMetadata m ) throws Exception { Field embeddedCollectionField = null ; Object embeddedObject = null ; String scName = PropertyAccessorFactory . STRING . fromBytes ( String . class , sc . getName ( ) ) ; String scNamePrefix = null ; Map < String , Field > co...
Populate embedded object .
36,094
private ThriftRow getThriftRow ( Object id , String columnFamily , Map < String , ThriftRow > thriftRows ) { ThriftRow tr = thriftRows . get ( columnFamily ) ; if ( tr == null ) { tr = new ThriftRow ( ) ; tr . setColumnFamilyName ( columnFamily ) ; tr . setId ( id ) ; thriftRows . put ( columnFamily , tr ) ; } return t...
Gets the thrift row .
36,095
public List < ThriftRow > toIndexThriftRow ( Object e , EntityMetadata m , String columnFamily ) { List < ThriftRow > indexThriftRows = new ArrayList < ThriftRow > ( ) ; byte [ ] rowKey = getThriftColumnValue ( e , m . getIdAttribute ( ) ) ; MetamodelImpl metaModel = ( MetamodelImpl ) kunderaMetadata . getApplicationMe...
To index thrift row .
36,096
public < E > List < Object > getForeignKeysFromJoinTable ( String inverseJoinColumnName , List < Column > columns , Class columnJavaType ) { List < Object > foreignKeys = new ArrayList < Object > ( ) ; if ( columns == null || columns . isEmpty ( ) ) { return foreignKeys ; } for ( Column c : columns ) { try { String thr...
Gets the foreign keys from join table .
36,097
private void setId ( EntityMetadata m , Object entity , Object columnValue , boolean isCql3Enabled ) { if ( isCql3Enabled && ! m . getType ( ) . equals ( Type . SUPER_COLUMN_FAMILY ) ) { setFieldValueViaCQL ( entity , columnValue , m . getIdAttribute ( ) ) ; } else { setFieldValue ( entity , columnValue , m . getIdAttr...
Sets the id .
36,098
private boolean isAggregate ( String thriftColumnName ) { if ( thriftColumnName . startsWith ( SYS_COUNT ) || thriftColumnName . startsWith ( SYS_MIN ) || thriftColumnName . startsWith ( SYS_MAX ) || thriftColumnName . startsWith ( SYS_AVG ) || thriftColumnName . startsWith ( SYS_SUM ) ) { return true ; } else if ( thr...
Checks if is aggregate .
36,099
private void composeAndAdd ( HashMap entity , CqlMetadata cqlMetadata , Object thriftColumnValue , String thriftColumnName ) { byte [ ] columnName = thriftColumnName . getBytes ( ) ; Map < ByteBuffer , String > schemaTypes = this . clientBase . getCqlMetadata ( ) . getValue_types ( ) ; AbstractType < ? > type = null ; ...
Compose and add .