idx
int64 0
165k
| question
stringlengths 73
5.81k
| target
stringlengths 5
918
|
---|---|---|
700 | private boolean isSpecial ( final char chr ) { return ( ( chr == '.' ) || ( chr == '?' ) || ( chr == '*' ) || ( chr == '^' ) || ( chr == '$' ) || ( chr == '+' ) || ( chr == '[' ) || ( chr == ']' ) || ( chr == '(' ) || ( chr == ')' ) || ( chr == '|' ) || ( chr == '\\' ) || ( chr == '&' ) ) ; } | Convenience method to determine if a character is special to the regex system . |
701 | private String fixSpecials ( final String inString ) { StringBuilder tmp = new StringBuilder ( ) ; for ( int i = 0 ; i < inString . length ( ) ; i ++ ) { char chr = inString . charAt ( i ) ; if ( isSpecial ( chr ) ) { tmp . append ( this . escape ) ; tmp . append ( chr ) ; } else { tmp . append ( chr ) ; } } return tmp . toString ( ) ; } | Convenience method to escape any character that is special to the regex system . |
702 | protected PreparedStatement prepareStatement ( Connection con , String sql , boolean scrollable , boolean createPreparedStatement , int explicitFetchSizeHint ) throws SQLException { PreparedStatement result ; try { if ( ! FORCEJDBC1_0 ) { if ( createPreparedStatement ) { result = con . prepareStatement ( sql , scrollable ? ResultSet . TYPE_SCROLL_INSENSITIVE : ResultSet . TYPE_FORWARD_ONLY , ResultSet . CONCUR_READ_ONLY ) ; afterJdbc2CapableStatementCreate ( result , explicitFetchSizeHint ) ; } else { result = con . prepareCall ( sql , scrollable ? ResultSet . TYPE_SCROLL_INSENSITIVE : ResultSet . TYPE_FORWARD_ONLY , ResultSet . CONCUR_READ_ONLY ) ; } } else { if ( createPreparedStatement ) { result = con . prepareStatement ( sql ) ; } else { result = con . prepareCall ( sql ) ; } } } catch ( AbstractMethodError err ) { log . warn ( "Used driver seems not JDBC 2.0 compatible, use the JDBC 1.0 mode" , err ) ; if ( createPreparedStatement ) { result = con . prepareStatement ( sql ) ; } else { result = con . prepareCall ( sql ) ; } FORCEJDBC1_0 = true ; } catch ( SQLException eSql ) { if ( eSql . getClass ( ) . getName ( ) . equals ( "interbase.interclient.DriverNotCapableException" ) ) { log . warn ( "JDBC 2.0 problems with this interbase driver, we use the JDBC 1.0 mode" ) ; if ( createPreparedStatement ) { result = con . prepareStatement ( sql ) ; } else { result = con . prepareCall ( sql ) ; } FORCEJDBC1_0 = true ; } else { throw eSql ; } } try { if ( ! ProxyHelper . isNormalOjbProxy ( result ) ) { platform . afterStatementCreate ( result ) ; } } catch ( PlatformException e ) { log . error ( "Platform dependend failure" , e ) ; } return result ; } | Prepares a statement with parameters that should work with most RDBMS . |
703 | private Statement createStatement ( Connection con , boolean scrollable , int explicitFetchSizeHint ) throws java . sql . SQLException { Statement result ; try { if ( ! FORCEJDBC1_0 ) { result = con . createStatement ( scrollable ? ResultSet . TYPE_SCROLL_INSENSITIVE : ResultSet . TYPE_FORWARD_ONLY , ResultSet . CONCUR_READ_ONLY ) ; afterJdbc2CapableStatementCreate ( result , explicitFetchSizeHint ) ; } else { result = con . createStatement ( ) ; } } catch ( AbstractMethodError err ) { log . warn ( "Used driver seems not JDBC 2.0 compatible, use the JDBC 1.0 mode" , err ) ; result = con . createStatement ( ) ; FORCEJDBC1_0 = true ; } catch ( SQLException eSql ) { if ( eSql . getClass ( ) . getName ( ) . equals ( "interbase.interclient.DriverNotCapableException" ) ) { log . warn ( "JDBC 2.0 problems with this interbase driver, we use the JDBC 1.0 mode" ) ; FORCEJDBC1_0 = true ; result = con . createStatement ( ) ; } else { throw eSql ; } } try { platform . afterStatementCreate ( result ) ; } catch ( PlatformException e ) { log . error ( "Platform dependend failure" , e ) ; } return result ; } | Creates a statement with parameters that should work with most RDBMS . |
704 | public int compareTo ( InternalFeature o ) { if ( null == o ) { return - 1 ; } if ( null != styleDefinition && null != o . getStyleInfo ( ) ) { if ( styleDefinition . getIndex ( ) > o . getStyleInfo ( ) . getIndex ( ) ) { return 1 ; } if ( styleDefinition . getIndex ( ) < o . getStyleInfo ( ) . getIndex ( ) ) { return - 1 ; } } return 0 ; } | This function compares style ID s between features . Features are usually sorted by style . |
705 | public final void begin ( ) { this . file = this . getAppender ( ) . getIoFile ( ) ; if ( this . file == null ) { this . getAppender ( ) . getErrorHandler ( ) . error ( "Scavenger not started: missing log file name" ) ; return ; } if ( this . getProperties ( ) . getScavengeInterval ( ) > - 1 ) { final Thread thread = new Thread ( this , "Log4J File Scavenger" ) ; thread . setDaemon ( true ) ; thread . start ( ) ; this . threadRef = thread ; } } | Starts the scavenger . |
706 | public final void end ( ) { final Thread thread = threadRef ; if ( thread != null ) { thread . interrupt ( ) ; try { thread . join ( ) ; } catch ( InterruptedException e ) { Thread . currentThread ( ) . interrupt ( ) ; } } this . threadRef = null ; } | Stops the scavenger . |
707 | public static boolean isPropertyAllowed ( Class defClass , String propertyName ) { HashMap props = ( HashMap ) _properties . get ( defClass ) ; return ( props == null ? true : props . containsKey ( propertyName ) ) ; } | Checks whether the property of the given name is allowed for the model element . |
708 | public static boolean toBoolean ( String value , boolean defaultValue ) { return "true" . equals ( value ) ? true : ( "false" . equals ( value ) ? false : defaultValue ) ; } | Determines whether the boolean value of the given string value . |
709 | protected FieldDescriptor getFieldDescriptor ( TableAlias aTableAlias , PathInfo aPathInfo ) { FieldDescriptor fld = null ; String colName = aPathInfo . column ; if ( aTableAlias != null ) { fld = aTableAlias . cld . getFieldDescriptorByName ( colName ) ; if ( fld == null ) { ObjectReferenceDescriptor ord = aTableAlias . cld . getObjectReferenceDescriptorByName ( colName ) ; if ( ord != null ) { fld = getFldFromReference ( aTableAlias , ord ) ; } else { fld = getFldFromJoin ( aTableAlias , colName ) ; } } } return fld ; } | Get the FieldDescriptor for the PathInfo |
710 | private FieldDescriptor getFldFromJoin ( TableAlias aTableAlias , String aColName ) { FieldDescriptor fld = null ; if ( aTableAlias . joins != null ) { Iterator itr = aTableAlias . joins . iterator ( ) ; while ( itr . hasNext ( ) ) { Join join = ( Join ) itr . next ( ) ; ClassDescriptor cld = join . right . cld ; if ( cld != null ) { fld = cld . getFieldDescriptorByName ( aColName ) ; if ( fld != null ) { break ; } } } } return fld ; } | Get FieldDescriptor from joined superclass . |
711 | private FieldDescriptor getFldFromReference ( TableAlias aTableAlias , ObjectReferenceDescriptor anOrd ) { FieldDescriptor fld = null ; if ( aTableAlias == getRoot ( ) ) { FieldDescriptor [ ] fk = anOrd . getForeignKeyFieldDescriptors ( aTableAlias . cld ) ; if ( fk . length > 0 ) { fld = fk [ 0 ] ; } } else { ClassDescriptor cld = aTableAlias . cld . getRepository ( ) . getDescriptorFor ( anOrd . getItemClass ( ) ) ; if ( cld != null ) { fld = aTableAlias . cld . getFieldDescriptorByName ( cld . getPkFields ( ) [ 0 ] . getPersistentField ( ) . getName ( ) ) ; } } return fld ; } | Get FieldDescriptor from Reference |
712 | protected void ensureColumns ( List columns , List existingColumns ) { if ( columns == null || columns . isEmpty ( ) ) { return ; } Iterator iter = columns . iterator ( ) ; while ( iter . hasNext ( ) ) { FieldHelper cf = ( FieldHelper ) iter . next ( ) ; if ( ! existingColumns . contains ( cf . name ) ) { getAttributeInfo ( cf . name , false , null , getQuery ( ) . getPathClasses ( ) ) ; } } } | Builds the Join for columns if they are not found among the existingColumns . |
713 | protected void appendWhereClause ( StringBuffer where , Criteria crit , StringBuffer stmt ) { if ( where . length ( ) == 0 ) { where = null ; } if ( where != null || ( crit != null && ! crit . isEmpty ( ) ) ) { stmt . append ( " WHERE " ) ; appendClause ( where , crit , stmt ) ; } } | appends a WHERE - clause to the Statement |
714 | protected void appendHavingClause ( StringBuffer having , Criteria crit , StringBuffer stmt ) { if ( having . length ( ) == 0 ) { having = null ; } if ( having != null || crit != null ) { stmt . append ( " HAVING " ) ; appendClause ( having , crit , stmt ) ; } } | appends a HAVING - clause to the Statement |
715 | private void appendBetweenCriteria ( TableAlias alias , PathInfo pathInfo , BetweenCriteria c , StringBuffer buf ) { appendColName ( alias , pathInfo , c . isTranslateAttribute ( ) , buf ) ; buf . append ( c . getClause ( ) ) ; appendParameter ( c . getValue ( ) , buf ) ; buf . append ( " AND " ) ; appendParameter ( c . getValue2 ( ) , buf ) ; } | Answer the SQL - Clause for a BetweenCriteria |
716 | private String getIndirectionTableColName ( TableAlias mnAlias , String path ) { int dotIdx = path . lastIndexOf ( "." ) ; String column = path . substring ( dotIdx ) ; return mnAlias . alias + column ; } | Get the column name from the indirection table . |
717 | private void appendLikeCriteria ( TableAlias alias , PathInfo pathInfo , LikeCriteria c , StringBuffer buf ) { appendColName ( alias , pathInfo , c . isTranslateAttribute ( ) , buf ) ; buf . append ( c . getClause ( ) ) ; appendParameter ( c . getValue ( ) , buf ) ; buf . append ( m_platform . getEscapeClause ( c ) ) ; } | Answer the SQL - Clause for a LikeCriteria |
718 | protected void appendSQLClause ( SelectionCriteria c , StringBuffer buf ) { if ( c instanceof SqlCriteria ) { buf . append ( c . getAttribute ( ) ) ; return ; } if ( c . getAttribute ( ) instanceof Query ) { Query q = ( Query ) c . getAttribute ( ) ; buf . append ( "(" ) ; buf . append ( getSubQuerySQL ( q ) ) ; buf . append ( ")" ) ; buf . append ( c . getClause ( ) ) ; appendParameter ( c . getValue ( ) , buf ) ; return ; } AttributeInfo attrInfo = getAttributeInfo ( ( String ) c . getAttribute ( ) , false , c . getUserAlias ( ) , c . getPathClasses ( ) ) ; TableAlias alias = attrInfo . tableAlias ; if ( alias != null ) { boolean hasExtents = alias . hasExtents ( ) ; if ( hasExtents ) { buf . append ( "(" ) ; appendCriteria ( alias , attrInfo . pathInfo , c , buf ) ; c . setNumberOfExtentsToBind ( alias . extents . size ( ) ) ; Iterator iter = alias . iterateExtents ( ) ; while ( iter . hasNext ( ) ) { TableAlias tableAlias = ( TableAlias ) iter . next ( ) ; buf . append ( " OR " ) ; appendCriteria ( tableAlias , attrInfo . pathInfo , c , buf ) ; } buf . append ( ")" ) ; } else { appendCriteria ( alias , attrInfo . pathInfo , c , buf ) ; } } else { appendCriteria ( alias , attrInfo . pathInfo , c , buf ) ; } } | Answer the SQL - Clause for a SelectionCriteria If the Criteria references a class with extents an OR - Clause is added for each extent |
719 | private void appendParameter ( Object value , StringBuffer buf ) { if ( value instanceof Query ) { appendSubQuery ( ( Query ) value , buf ) ; } else { buf . append ( "?" ) ; } } | Append the Parameter Add the place holder ? or the SubQuery |
720 | private void appendSubQuery ( Query subQuery , StringBuffer buf ) { buf . append ( " (" ) ; buf . append ( getSubQuerySQL ( subQuery ) ) ; buf . append ( ") " ) ; } | Append a SubQuery the SQL - Clause |
721 | private String getSubQuerySQL ( Query subQuery ) { ClassDescriptor cld = getRoot ( ) . cld . getRepository ( ) . getDescriptorFor ( subQuery . getSearchClass ( ) ) ; String sql ; if ( subQuery instanceof QueryBySQL ) { sql = ( ( QueryBySQL ) subQuery ) . getSql ( ) ; } else { sql = new SqlSelectStatement ( this , m_platform , cld , subQuery , m_logger ) . getStatement ( ) ; } return sql ; } | Convert subQuery to SQL |
722 | private void addJoin ( TableAlias left , Object [ ] leftKeys , TableAlias right , Object [ ] rightKeys , boolean outer , String name ) { TableAlias extAlias , rightCopy ; left . addJoin ( new Join ( left , leftKeys , right , rightKeys , outer , name ) ) ; if ( right . hasExtents ( ) ) { for ( int i = 0 ; i < right . extents . size ( ) ; i ++ ) { extAlias = ( TableAlias ) right . extents . get ( i ) ; FieldDescriptor [ ] extKeys = getExtentFieldDescriptors ( extAlias , ( FieldDescriptor [ ] ) rightKeys ) ; left . addJoin ( new Join ( left , leftKeys , extAlias , extKeys , true , name ) ) ; } } if ( left . hasExtents ( ) ) { for ( int i = 0 ; i < left . extents . size ( ) ; i ++ ) { extAlias = ( TableAlias ) left . extents . get ( i ) ; FieldDescriptor [ ] extKeys = getExtentFieldDescriptors ( extAlias , ( FieldDescriptor [ ] ) leftKeys ) ; rightCopy = right . copy ( "C" + i ) ; right . extents . add ( rightCopy ) ; right . extents . addAll ( rightCopy . extents ) ; addJoin ( extAlias , extKeys , rightCopy , rightKeys , true , name ) ; } } } | add a join between two aliases |
723 | private FieldDescriptor [ ] getExtentFieldDescriptors ( TableAlias extAlias , FieldDescriptor [ ] fds ) { FieldDescriptor [ ] result = new FieldDescriptor [ fds . length ] ; for ( int i = 0 ; i < fds . length ; i ++ ) { result [ i ] = extAlias . cld . getFieldDescriptorByName ( fds [ i ] . getAttributeName ( ) ) ; } return result ; } | Get the FieldDescriptors of the extent based on the FieldDescriptors of the parent . |
724 | private TableAlias createTableAlias ( String aTable , String aPath , String aUserAlias ) { if ( aUserAlias == null ) { return createTableAlias ( aTable , aPath ) ; } else { return createTableAlias ( aTable , aUserAlias + ALIAS_SEPARATOR + aPath ) ; } } | Create a TableAlias for path or userAlias |
725 | private TableAlias getTableAliasForPath ( String aPath , List hintClasses ) { return ( TableAlias ) m_pathToAlias . get ( buildAliasKey ( aPath , hintClasses ) ) ; } | Answer the TableAlias for aPath |
726 | private void setTableAliasForPath ( String aPath , List hintClasses , TableAlias anAlias ) { m_pathToAlias . put ( buildAliasKey ( aPath , hintClasses ) , anAlias ) ; } | Set the TableAlias for aPath |
727 | private String buildAliasKey ( String aPath , List hintClasses ) { if ( hintClasses == null || hintClasses . isEmpty ( ) ) { return aPath ; } StringBuffer buf = new StringBuffer ( aPath ) ; for ( Iterator iter = hintClasses . iterator ( ) ; iter . hasNext ( ) ; ) { Class hint = ( Class ) iter . next ( ) ; buf . append ( " " ) ; buf . append ( hint . getName ( ) ) ; } return buf . toString ( ) ; } | Build the key for the TableAlias based on the path and the hints |
728 | private void setTableAliasForClassDescriptor ( ClassDescriptor aCld , TableAlias anAlias ) { if ( m_cldToAlias . get ( aCld ) == null ) { m_cldToAlias . put ( aCld , anAlias ) ; } } | Set the TableAlias for ClassDescriptor |
729 | private TableAlias getTableAliasForPath ( String aPath , String aUserAlias , List hintClasses ) { if ( aUserAlias == null ) { return getTableAliasForPath ( aPath , hintClasses ) ; } else { return getTableAliasForPath ( aUserAlias + ALIAS_SEPARATOR + aPath , hintClasses ) ; } } | Answer the TableAlias for aPath or aUserAlias |
730 | protected void appendGroupByClause ( List groupByFields , StringBuffer buf ) { if ( groupByFields == null || groupByFields . size ( ) == 0 ) { return ; } buf . append ( " GROUP BY " ) ; for ( int i = 0 ; i < groupByFields . size ( ) ; i ++ ) { FieldHelper cf = ( FieldHelper ) groupByFields . get ( i ) ; if ( i > 0 ) { buf . append ( "," ) ; } appendColName ( cf . name , false , null , buf ) ; } } | Appends the GROUP BY clause for the Query |
731 | protected void appendTableWithJoins ( TableAlias alias , StringBuffer where , StringBuffer buf ) { int stmtFromPos = 0 ; byte joinSyntax = getJoinSyntaxType ( ) ; if ( joinSyntax == SQL92_JOIN_SYNTAX ) { stmtFromPos = buf . length ( ) ; } if ( alias == getRoot ( ) ) { if ( getQuery ( ) instanceof MtoNQuery ) { MtoNQuery mnQuery = ( MtoNQuery ) m_query ; buf . append ( getTableAliasForPath ( mnQuery . getIndirectionTable ( ) , null ) . getTableAndAlias ( ) ) ; buf . append ( ", " ) ; } buf . append ( alias . getTableAndAlias ( ) ) ; } else if ( joinSyntax != SQL92_NOPAREN_JOIN_SYNTAX ) { buf . append ( alias . getTableAndAlias ( ) ) ; } if ( ! alias . hasJoins ( ) ) { return ; } for ( Iterator it = alias . iterateJoins ( ) ; it . hasNext ( ) ; ) { Join join = ( Join ) it . next ( ) ; if ( joinSyntax == SQL92_JOIN_SYNTAX ) { appendJoinSQL92 ( join , where , buf ) ; if ( it . hasNext ( ) ) { buf . insert ( stmtFromPos , "(" ) ; buf . append ( ")" ) ; } } else if ( joinSyntax == SQL92_NOPAREN_JOIN_SYNTAX ) { appendJoinSQL92NoParen ( join , where , buf ) ; } else { appendJoin ( where , buf , join ) ; } } } | Appends to the statement table and all tables joined to it . |
732 | private void appendJoin ( StringBuffer where , StringBuffer buf , Join join ) { buf . append ( "," ) ; appendTableWithJoins ( join . right , where , buf ) ; if ( where . length ( ) > 0 ) { where . append ( " AND " ) ; } join . appendJoinEqualities ( where ) ; } | Append Join for non SQL92 Syntax |
733 | private void appendJoinSQL92 ( Join join , StringBuffer where , StringBuffer buf ) { if ( join . isOuter ) { buf . append ( " LEFT OUTER JOIN " ) ; } else { buf . append ( " INNER JOIN " ) ; } if ( join . right . hasJoins ( ) ) { buf . append ( "(" ) ; appendTableWithJoins ( join . right , where , buf ) ; buf . append ( ")" ) ; } else { appendTableWithJoins ( join . right , where , buf ) ; } buf . append ( " ON " ) ; join . appendJoinEqualities ( buf ) ; } | Append Join for SQL92 Syntax |
734 | private void appendJoinSQL92NoParen ( Join join , StringBuffer where , StringBuffer buf ) { if ( join . isOuter ) { buf . append ( " LEFT OUTER JOIN " ) ; } else { buf . append ( " INNER JOIN " ) ; } buf . append ( join . right . getTableAndAlias ( ) ) ; buf . append ( " ON " ) ; join . appendJoinEqualities ( buf ) ; appendTableWithJoins ( join . right , where , buf ) ; } | Append Join for SQL92 Syntax without parentheses |
735 | private void buildJoinTree ( Criteria crit ) { Enumeration e = crit . getElements ( ) ; while ( e . hasMoreElements ( ) ) { Object o = e . nextElement ( ) ; if ( o instanceof Criteria ) { buildJoinTree ( ( Criteria ) o ) ; } else { SelectionCriteria c = ( SelectionCriteria ) o ; if ( c instanceof SqlCriteria ) { continue ; } boolean useOuterJoin = ( crit . getType ( ) == Criteria . OR ) ; if ( c . getAttribute ( ) != null && c . getAttribute ( ) instanceof String ) { buildJoinTreeForColumn ( ( String ) c . getAttribute ( ) , useOuterJoin , c . getUserAlias ( ) , c . getPathClasses ( ) ) ; } if ( c instanceof FieldCriteria ) { FieldCriteria cc = ( FieldCriteria ) c ; buildJoinTreeForColumn ( ( String ) cc . getValue ( ) , useOuterJoin , c . getUserAlias ( ) , c . getPathClasses ( ) ) ; } } } } | Build the tree of joins for the given criteria |
736 | protected void buildSuperJoinTree ( TableAlias left , ClassDescriptor cld , String name , boolean useOuterJoin ) { ClassDescriptor superCld = cld . getSuperClassDescriptor ( ) ; if ( superCld != null ) { SuperReferenceDescriptor superRef = cld . getSuperReference ( ) ; FieldDescriptor [ ] leftFields = superRef . getForeignKeyFieldDescriptors ( cld ) ; TableAlias base_alias = getTableAliasForPath ( name , null , null ) ; String aliasName = String . valueOf ( getAliasChar ( ) ) + m_aliasCount ++ ; TableAlias right = new TableAlias ( superCld , aliasName , useOuterJoin , null ) ; Join join1to1 = new Join ( left , leftFields , right , superCld . getPkFields ( ) , useOuterJoin , "superClass" ) ; base_alias . addJoin ( join1to1 ) ; buildSuperJoinTree ( right , superCld , name , useOuterJoin ) ; } } | build the Join - Information if a super reference exists |
737 | private void buildMultiJoinTree ( TableAlias left , ClassDescriptor cld , String name , boolean useOuterJoin ) { DescriptorRepository repository = cld . getRepository ( ) ; Class [ ] multiJoinedClasses = repository . getSubClassesMultipleJoinedTables ( cld , false ) ; for ( int i = 0 ; i < multiJoinedClasses . length ; i ++ ) { ClassDescriptor subCld = repository . getDescriptorFor ( multiJoinedClasses [ i ] ) ; SuperReferenceDescriptor srd = subCld . getSuperReference ( ) ; if ( srd != null ) { FieldDescriptor [ ] leftFields = subCld . getPkFields ( ) ; FieldDescriptor [ ] rightFields = srd . getForeignKeyFieldDescriptors ( subCld ) ; TableAlias base_alias = getTableAliasForPath ( name , null , null ) ; String aliasName = String . valueOf ( getAliasChar ( ) ) + m_aliasCount ++ ; TableAlias right = new TableAlias ( subCld , aliasName , false , null ) ; Join join1to1 = new Join ( left , leftFields , right , rightFields , useOuterJoin , "subClass" ) ; base_alias . addJoin ( join1to1 ) ; buildMultiJoinTree ( right , subCld , name , useOuterJoin ) ; } } } | build the Join - Information for Subclasses having a super reference to this class |
738 | protected void splitCriteria ( ) { Criteria whereCrit = getQuery ( ) . getCriteria ( ) ; Criteria havingCrit = getQuery ( ) . getHavingCriteria ( ) ; if ( whereCrit == null || whereCrit . isEmpty ( ) ) { getJoinTreeToCriteria ( ) . put ( getRoot ( ) , null ) ; } else { getJoinTreeToCriteria ( ) . put ( getRoot ( ) , whereCrit ) ; buildJoinTree ( whereCrit ) ; } if ( havingCrit != null && ! havingCrit . isEmpty ( ) ) { buildJoinTree ( havingCrit ) ; } } | First reduce the Criteria to the normal disjunctive form then calculate the necessary tree of joined tables for each item then group items with the same tree of joined tables . |
739 | private Filter getFilter ( String layerFilter , String [ ] featureIds ) throws GeomajasException { Filter filter = null ; if ( null != layerFilter ) { filter = filterService . parseFilter ( layerFilter ) ; } if ( null != featureIds ) { Filter fidFilter = filterService . createFidFilter ( featureIds ) ; if ( null == filter ) { filter = fidFilter ; } else { filter = filterService . createAndFilter ( filter , fidFilter ) ; } } return filter ; } | Build filter for the request . |
740 | public static String resolveProxyUrl ( String relativeUrl , TileMap tileMap , String baseTmsUrl ) { TileCode tc = parseTileCode ( relativeUrl ) ; return buildUrl ( tc , tileMap , baseTmsUrl ) ; } | Replaces the proxy url with the correct url from the tileMap . |
741 | public AbstractGraph getModuleGraph ( final String moduleId ) { final ModuleHandler moduleHandler = new ModuleHandler ( repoHandler ) ; final DbModule module = moduleHandler . getModule ( moduleId ) ; final DbOrganization organization = moduleHandler . getOrganization ( module ) ; filters . setCorporateFilter ( new CorporateFilter ( organization ) ) ; final AbstractGraph graph = new ModuleGraph ( ) ; addModuleToGraph ( module , graph , 0 ) ; return graph ; } | Generate a module graph regarding the filters |
742 | private void addModuleToGraph ( final DbModule module , final AbstractGraph graph , final int depth ) { if ( graph . isTreated ( graph . getId ( module ) ) ) { return ; } final String moduleElementId = graph . getId ( module ) ; graph . addElement ( moduleElementId , module . getVersion ( ) , depth == 0 ) ; if ( filters . getDepthHandler ( ) . shouldGoDeeper ( depth ) ) { for ( final DbDependency dep : DataUtils . getAllDbDependencies ( module ) ) { if ( filters . shouldBeInReport ( dep ) ) { addDependencyToGraph ( dep , graph , depth + 1 , moduleElementId ) ; } } } } | Manage the artifact add to the Module AbstractGraph |
743 | private void addDependencyToGraph ( final DbDependency dependency , final AbstractGraph graph , final int depth , final String parentId ) { if ( filters . getCorporateFilter ( ) . filter ( dependency ) ) { final DbModule dbTarget = repoHandler . getModuleOf ( dependency . getTarget ( ) ) ; if ( dbTarget == null ) { LOG . error ( "Got missing reference: " + dependency . getTarget ( ) ) ; final DbArtifact dbArtifact = DataUtils . createDbArtifact ( dependency . getTarget ( ) ) ; final String targetElementId = graph . getId ( dbArtifact ) ; graph . addElement ( targetElementId , dbArtifact . getVersion ( ) , false ) ; graph . addDependency ( parentId , targetElementId , dependency . getScope ( ) ) ; return ; } addModuleToGraph ( dbTarget , graph , depth + 1 ) ; final String moduleElementId = graph . getId ( dbTarget ) ; graph . addDependency ( parentId , moduleElementId , dependency . getScope ( ) ) ; } else { final DbArtifact dbTarget = repoHandler . getArtifact ( dependency . getTarget ( ) ) ; if ( dbTarget == null ) { LOG . error ( "Got missing artifact: " + dependency . getTarget ( ) ) ; return ; } if ( ! graph . isTreated ( graph . getId ( dbTarget ) ) ) { final ModelMapper modelMapper = new ModelMapper ( repoHandler ) ; final Artifact target = modelMapper . getArtifact ( dbTarget ) ; final String targetElementId = graph . getId ( target ) ; graph . addElement ( targetElementId , target . getVersion ( ) , false ) ; graph . addDependency ( parentId , targetElementId , dependency . getScope ( ) ) ; } } } | Add a dependency to the graph |
744 | public TreeNode getModuleTree ( final String moduleId ) { final ModuleHandler moduleHandler = new ModuleHandler ( repoHandler ) ; final DbModule module = moduleHandler . getModule ( moduleId ) ; final TreeNode tree = new TreeNode ( ) ; tree . setName ( module . getName ( ) ) ; for ( final DbModule submodule : module . getSubmodules ( ) ) { addModuleToTree ( submodule , tree ) ; } return tree ; } | Generate a groupId tree regarding the filters |
745 | private void addModuleToTree ( final DbModule module , final TreeNode tree ) { final TreeNode subTree = new TreeNode ( ) ; subTree . setName ( module . getName ( ) ) ; tree . addChild ( subTree ) ; for ( final DbModule subsubmodule : module . getSubmodules ( ) ) { addModuleToTree ( subsubmodule , subTree ) ; } } | Add a module to a module tree |
746 | public static void main ( String [ ] args ) throws Exception { Logger logger = Logger . getLogger ( "MASReader.main" ) ; Properties beastConfigProperties = new Properties ( ) ; String beastConfigPropertiesFile = null ; if ( args . length > 0 ) { beastConfigPropertiesFile = args [ 0 ] ; beastConfigProperties . load ( new FileInputStream ( beastConfigPropertiesFile ) ) ; logger . info ( "Properties file selected -> " + beastConfigPropertiesFile ) ; } else { logger . severe ( "No properties file found. Set the path of properties file as argument." ) ; throw new BeastException ( "No properties file found. Set the path of properties file as argument." ) ; } String loggerConfigPropertiesFile ; if ( args . length > 1 ) { Properties loggerConfigProperties = new Properties ( ) ; loggerConfigPropertiesFile = args [ 1 ] ; try { FileInputStream loggerConfigFile = new FileInputStream ( loggerConfigPropertiesFile ) ; loggerConfigProperties . load ( loggerConfigFile ) ; LogManager . getLogManager ( ) . readConfiguration ( loggerConfigFile ) ; logger . info ( "Logging properties configured successfully. Logger config file: " + loggerConfigPropertiesFile ) ; } catch ( IOException ex ) { logger . warning ( "WARNING: Could not open configuration file" ) ; logger . warning ( "WARNING: Logging not configured (console output only)" ) ; } } else { loggerConfigPropertiesFile = null ; } MASReader . generateJavaFiles ( beastConfigProperties . getProperty ( "requirementsFolder" ) , "\"" + beastConfigProperties . getProperty ( "MASPlatform" ) + "\"" , beastConfigProperties . getProperty ( "srcTestRootFolder" ) , beastConfigProperties . getProperty ( "storiesPackage" ) , beastConfigProperties . getProperty ( "caseManagerPackage" ) , loggerConfigPropertiesFile , beastConfigProperties . getProperty ( "specificationPhase" ) ) ; } | Main method to start reading the plain text given by the client |
747 | private synchronized Constructor getIndirectionHandlerConstructor ( ) { if ( _indirectionHandlerConstructor == null ) { Class [ ] paramType = { PBKey . class , Identity . class } ; try { _indirectionHandlerConstructor = getIndirectionHandlerClass ( ) . getConstructor ( paramType ) ; } catch ( NoSuchMethodException ex ) { throw new MetadataException ( "The class " + _indirectionHandlerClass . getName ( ) + " specified for IndirectionHandlerClass" + " is required to have a public constructor with signature (" + PBKey . class . getName ( ) + ", " + Identity . class . getName ( ) + ")." ) ; } } return _indirectionHandlerConstructor ; } | Returns the constructor of the indirection handler class . |
748 | public void setIndirectionHandlerClass ( Class indirectionHandlerClass ) { if ( indirectionHandlerClass == null ) { indirectionHandlerClass = getDefaultIndirectionHandlerClass ( ) ; } if ( indirectionHandlerClass . isInterface ( ) || Modifier . isAbstract ( indirectionHandlerClass . getModifiers ( ) ) || ! getIndirectionHandlerBaseClass ( ) . isAssignableFrom ( indirectionHandlerClass ) ) { throw new MetadataException ( "Illegal class " + indirectionHandlerClass . getName ( ) + " specified for IndirectionHandlerClass. Must be a concrete subclass of " + getIndirectionHandlerBaseClass ( ) . getName ( ) ) ; } _indirectionHandlerClass = indirectionHandlerClass ; } | Sets the indirection handler class . |
749 | public IndirectionHandler createIndirectionHandler ( PBKey brokerKey , Identity id ) { Object args [ ] = { brokerKey , id } ; try { return ( IndirectionHandler ) getIndirectionHandlerConstructor ( ) . newInstance ( args ) ; } catch ( InvocationTargetException ex ) { throw new PersistenceBrokerException ( "Exception while creating a new indirection handler instance" , ex ) ; } catch ( InstantiationException ex ) { throw new PersistenceBrokerException ( "Exception while creating a new indirection handler instance" , ex ) ; } catch ( IllegalAccessException ex ) { throw new PersistenceBrokerException ( "Exception while creating a new indirection handler instance" , ex ) ; } } | Creates a new indirection handler instance . |
750 | private static Constructor retrieveCollectionProxyConstructor ( Class proxyClass , Class baseType , String typeDesc ) { if ( proxyClass == null ) { throw new MetadataException ( "No " + typeDesc + " specified." ) ; } if ( proxyClass . isInterface ( ) || Modifier . isAbstract ( proxyClass . getModifiers ( ) ) || ! baseType . isAssignableFrom ( proxyClass ) ) { throw new MetadataException ( "Illegal class " + proxyClass . getName ( ) + " specified for " + typeDesc + ". Must be a concrete subclass of " + baseType . getName ( ) ) ; } Class [ ] paramType = { PBKey . class , Class . class , Query . class } ; try { return proxyClass . getConstructor ( paramType ) ; } catch ( NoSuchMethodException ex ) { throw new MetadataException ( "The class " + proxyClass . getName ( ) + " specified for " + typeDesc + " is required to have a public constructor with signature (" + PBKey . class . getName ( ) + ", " + Class . class . getName ( ) + ", " + Query . class . getName ( ) + ")." ) ; } } | Retrieves the constructor that is used by OJB to create instances of the given collection proxy class . |
751 | public ManageableCollection createCollectionProxy ( PBKey brokerKey , Query query , Class collectionClass ) { Object args [ ] = { brokerKey , collectionClass , query } ; try { return ( ManageableCollection ) getCollectionProxyConstructor ( collectionClass ) . newInstance ( args ) ; } catch ( InstantiationException ex ) { throw new PersistenceBrokerException ( "Exception while creating a new collection proxy instance" , ex ) ; } catch ( InvocationTargetException ex ) { throw new PersistenceBrokerException ( "Exception while creating a new collection proxy instance" , ex ) ; } catch ( IllegalAccessException ex ) { throw new PersistenceBrokerException ( "Exception while creating a new collection proxy instance" , ex ) ; } } | Create a Collection Proxy for a given query . |
752 | public final Object getRealObject ( Object objectOrProxy ) { if ( isNormalOjbProxy ( objectOrProxy ) ) { String msg ; try { return getIndirectionHandler ( objectOrProxy ) . getRealSubject ( ) ; } catch ( ClassCastException e ) { msg = "The InvocationHandler for the provided Proxy was not an instance of " + IndirectionHandler . class . getName ( ) ; log . error ( msg ) ; throw new PersistenceBrokerException ( msg , e ) ; } catch ( IllegalArgumentException e ) { msg = "Could not retrieve real object for given Proxy: " + objectOrProxy ; log . error ( msg ) ; throw new PersistenceBrokerException ( msg , e ) ; } catch ( PersistenceBrokerException e ) { log . error ( "Could not retrieve real object for given Proxy: " + objectOrProxy ) ; throw e ; } } else if ( isVirtualOjbProxy ( objectOrProxy ) ) { try { return ( ( VirtualProxy ) objectOrProxy ) . getRealSubject ( ) ; } catch ( PersistenceBrokerException e ) { log . error ( "Could not retrieve real object for VirtualProxy: " + objectOrProxy ) ; throw e ; } } else { return objectOrProxy ; } } | Get the real Object |
753 | public Object getRealObjectIfMaterialized ( Object objectOrProxy ) { if ( isNormalOjbProxy ( objectOrProxy ) ) { String msg ; try { IndirectionHandler handler = getIndirectionHandler ( objectOrProxy ) ; return handler . alreadyMaterialized ( ) ? handler . getRealSubject ( ) : null ; } catch ( ClassCastException e ) { msg = "The InvocationHandler for the provided Proxy was not an instance of " + IndirectionHandler . class . getName ( ) ; log . error ( msg ) ; throw new PersistenceBrokerException ( msg , e ) ; } catch ( IllegalArgumentException e ) { msg = "Could not retrieve real object for given Proxy: " + objectOrProxy ; log . error ( msg ) ; throw new PersistenceBrokerException ( msg , e ) ; } catch ( PersistenceBrokerException e ) { log . error ( "Could not retrieve real object for given Proxy: " + objectOrProxy ) ; throw e ; } } else if ( isVirtualOjbProxy ( objectOrProxy ) ) { try { VirtualProxy proxy = ( VirtualProxy ) objectOrProxy ; return proxy . alreadyMaterialized ( ) ? proxy . getRealSubject ( ) : null ; } catch ( PersistenceBrokerException e ) { log . error ( "Could not retrieve real object for VirtualProxy: " + objectOrProxy ) ; throw e ; } } else { return objectOrProxy ; } } | Get the real Object for already materialized Handler |
754 | public Class getRealClass ( Object objectOrProxy ) { IndirectionHandler handler ; if ( isNormalOjbProxy ( objectOrProxy ) ) { String msg ; try { handler = getIndirectionHandler ( objectOrProxy ) ; return handler . getIdentity ( ) . getObjectsRealClass ( ) ; } catch ( ClassCastException e ) { msg = "The InvocationHandler for the provided Proxy was not an instance of " + IndirectionHandler . class . getName ( ) ; log . error ( msg ) ; throw new PersistenceBrokerException ( msg , e ) ; } catch ( IllegalArgumentException e ) { msg = "Could not retrieve real object for given Proxy: " + objectOrProxy ; log . error ( msg ) ; throw new PersistenceBrokerException ( msg , e ) ; } } else if ( isVirtualOjbProxy ( objectOrProxy ) ) { handler = VirtualProxy . getIndirectionHandler ( ( VirtualProxy ) objectOrProxy ) ; return handler . getIdentity ( ) . getObjectsRealClass ( ) ; } else { return objectOrProxy . getClass ( ) ; } } | Get the real Class |
755 | public IndirectionHandler getIndirectionHandler ( Object obj ) { if ( obj == null ) { return null ; } else if ( isNormalOjbProxy ( obj ) ) { return getDynamicIndirectionHandler ( obj ) ; } else if ( isVirtualOjbProxy ( obj ) ) { return VirtualProxy . getIndirectionHandler ( ( VirtualProxy ) obj ) ; } else { return null ; } } | Returns the invocation handler object of the given proxy object . |
756 | public boolean isMaterialized ( Object object ) { IndirectionHandler handler = getIndirectionHandler ( object ) ; return handler == null || handler . alreadyMaterialized ( ) ; } | Determines whether the object is a materialized object i . e . no proxy or a proxy that has already been loaded from the database . |
757 | public DbOrganization getOrganization ( final String organizationId ) { final DbOrganization dbOrganization = repositoryHandler . getOrganization ( organizationId ) ; if ( dbOrganization == null ) { throw new WebApplicationException ( Response . status ( Response . Status . NOT_FOUND ) . entity ( "Organization " + organizationId + " does not exist." ) . build ( ) ) ; } return dbOrganization ; } | Returns an Organization |
758 | public void deleteOrganization ( final String organizationId ) { final DbOrganization dbOrganization = getOrganization ( organizationId ) ; repositoryHandler . deleteOrganization ( dbOrganization . getName ( ) ) ; repositoryHandler . removeModulesOrganization ( dbOrganization ) ; } | Deletes an organization |
759 | public List < String > getCorporateGroupIds ( final String organizationId ) { final DbOrganization dbOrganization = getOrganization ( organizationId ) ; return dbOrganization . getCorporateGroupIdPrefixes ( ) ; } | Returns the list view of corporate groupIds of an organization |
760 | public void addCorporateGroupId ( final String organizationId , final String corporateGroupId ) { final DbOrganization dbOrganization = getOrganization ( organizationId ) ; if ( ! dbOrganization . getCorporateGroupIdPrefixes ( ) . contains ( corporateGroupId ) ) { dbOrganization . getCorporateGroupIdPrefixes ( ) . add ( corporateGroupId ) ; repositoryHandler . store ( dbOrganization ) ; } repositoryHandler . addModulesOrganization ( corporateGroupId , dbOrganization ) ; } | Adds a corporate groupId to an organization |
761 | public void removeCorporateGroupId ( final String organizationId , final String corporateGroupId ) { final DbOrganization dbOrganization = getOrganization ( organizationId ) ; if ( dbOrganization . getCorporateGroupIdPrefixes ( ) . contains ( corporateGroupId ) ) { dbOrganization . getCorporateGroupIdPrefixes ( ) . remove ( corporateGroupId ) ; repositoryHandler . store ( dbOrganization ) ; } repositoryHandler . removeModulesOrganization ( corporateGroupId , dbOrganization ) ; } | Removes a corporate groupId from an Organisation |
762 | public DbOrganization getMatchingOrganization ( final DbModule dbModule ) { if ( dbModule . getOrganization ( ) != null && ! dbModule . getOrganization ( ) . isEmpty ( ) ) { return getOrganization ( dbModule . getOrganization ( ) ) ; } for ( final DbOrganization organization : repositoryHandler . getAllOrganizations ( ) ) { final CorporateFilter corporateFilter = new CorporateFilter ( organization ) ; if ( corporateFilter . matches ( dbModule ) ) { return organization ; } } return null ; } | Returns an Organization that suits the Module or null if there is none |
763 | public void executeDelete ( ClassDescriptor cld , Object obj ) throws PersistenceBrokerException { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "executeDelete: " + obj ) ; } final StatementManagerIF sm = broker . serviceStatementManager ( ) ; PreparedStatement stmt = null ; try { stmt = sm . getDeleteStatement ( cld ) ; if ( stmt == null ) { logger . error ( "getDeleteStatement returned a null statement" ) ; throw new PersistenceBrokerException ( "JdbcAccessImpl: getDeleteStatement returned a null statement" ) ; } sm . bindDelete ( stmt , cld , obj ) ; if ( logger . isDebugEnabled ( ) ) logger . debug ( "executeDelete: " + stmt ) ; if ( stmt . executeUpdate ( ) == 0 && cld . isLocking ( ) ) { String objToString = "" ; try { objToString = obj . toString ( ) ; } catch ( Exception ex ) { } throw new OptimisticLockException ( "Object has been modified or deleted by someone else: " + objToString , obj ) ; } harvestReturnValues ( cld . getDeleteProcedure ( ) , obj , stmt ) ; } catch ( OptimisticLockException e ) { if ( logger . isDebugEnabled ( ) ) logger . debug ( "OptimisticLockException during the execution of delete: " + e . getMessage ( ) , e ) ; throw e ; } catch ( PersistenceBrokerException e ) { logger . error ( "PersistenceBrokerException during the execution of delete: " + e . getMessage ( ) , e ) ; throw e ; } catch ( SQLException e ) { final String sql = broker . serviceSqlGenerator ( ) . getPreparedDeleteStatement ( cld ) . getStatement ( ) ; throw ExceptionHelper . generateException ( e , sql , cld , logger , obj ) ; } finally { sm . closeResources ( stmt , null ) ; } } | performs a DELETE operation against RDBMS . |
764 | public void executeInsert ( ClassDescriptor cld , Object obj ) throws PersistenceBrokerException { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "executeInsert: " + obj ) ; } final StatementManagerIF sm = broker . serviceStatementManager ( ) ; PreparedStatement stmt = null ; try { stmt = sm . getInsertStatement ( cld ) ; if ( stmt == null ) { logger . error ( "getInsertStatement returned a null statement" ) ; throw new PersistenceBrokerException ( "getInsertStatement returned a null statement" ) ; } assignAutoincrementSequences ( cld , obj ) ; sm . bindInsert ( stmt , cld , obj ) ; if ( logger . isDebugEnabled ( ) ) logger . debug ( "executeInsert: " + stmt ) ; stmt . executeUpdate ( ) ; assignAutoincrementIdentityColumns ( cld , obj ) ; harvestReturnValues ( cld . getInsertProcedure ( ) , obj , stmt ) ; } catch ( PersistenceBrokerException e ) { logger . error ( "PersistenceBrokerException during the execution of the insert: " + e . getMessage ( ) , e ) ; throw e ; } catch ( SequenceManagerException e ) { throw new PersistenceBrokerException ( "Error while try to assign identity value" , e ) ; } catch ( SQLException e ) { final String sql = broker . serviceSqlGenerator ( ) . getPreparedInsertStatement ( cld ) . getStatement ( ) ; throw ExceptionHelper . generateException ( e , sql , cld , logger , obj ) ; } finally { sm . closeResources ( stmt , null ) ; } } | performs an INSERT operation against RDBMS . |
765 | public ResultSetAndStatement executeQuery ( Query query , ClassDescriptor cld ) throws PersistenceBrokerException { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "executeQuery: " + query ) ; } boolean scrollable = ( ( query . getStartAtIndex ( ) > Query . NO_START_AT_INDEX ) || ( query . getEndAtIndex ( ) > Query . NO_END_AT_INDEX ) ) ; if ( query != null && query . getPrefetchedRelationships ( ) != null && ! query . getPrefetchedRelationships ( ) . isEmpty ( ) ) { scrollable = true ; } final StatementManagerIF sm = broker . serviceStatementManager ( ) ; final SelectStatement sql = broker . serviceSqlGenerator ( ) . getPreparedSelectStatement ( query , cld ) ; PreparedStatement stmt = null ; ResultSet rs = null ; try { final int queryFetchSize = query . getFetchSize ( ) ; final boolean isStoredProcedure = isStoredProcedure ( sql . getStatement ( ) ) ; stmt = sm . getPreparedStatement ( cld , sql . getStatement ( ) , scrollable , queryFetchSize , isStoredProcedure ) ; if ( isStoredProcedure ) { getPlatform ( ) . registerOutResultSet ( ( CallableStatement ) stmt , 1 ) ; sm . bindStatement ( stmt , query , cld , 2 ) ; if ( logger . isDebugEnabled ( ) ) logger . debug ( "executeQuery: " + stmt ) ; stmt . execute ( ) ; rs = ( ResultSet ) ( ( CallableStatement ) stmt ) . getObject ( 1 ) ; } else { sm . bindStatement ( stmt , query , cld , 1 ) ; if ( logger . isDebugEnabled ( ) ) logger . debug ( "executeQuery: " + stmt ) ; rs = stmt . executeQuery ( ) ; } return new ResultSetAndStatement ( sm , stmt , rs , sql ) ; } catch ( PersistenceBrokerException e ) { sm . closeResources ( stmt , rs ) ; logger . error ( "PersistenceBrokerException during the execution of the query: " + e . getMessage ( ) , e ) ; throw e ; } catch ( SQLException e ) { sm . closeResources ( stmt , rs ) ; throw ExceptionHelper . generateException ( e , sql . getStatement ( ) , null , logger , null ) ; } } | performs a SELECT operation against RDBMS . |
766 | public ResultSetAndStatement executeSQL ( final String sql , ClassDescriptor cld , ValueContainer [ ] values , boolean scrollable ) throws PersistenceBrokerException { if ( logger . isDebugEnabled ( ) ) logger . debug ( "executeSQL: " + sql ) ; final boolean isStoredprocedure = isStoredProcedure ( sql ) ; final StatementManagerIF sm = broker . serviceStatementManager ( ) ; PreparedStatement stmt = null ; ResultSet rs = null ; try { stmt = sm . getPreparedStatement ( cld , sql , scrollable , StatementManagerIF . FETCH_SIZE_NOT_EXPLICITLY_SET , isStoredprocedure ) ; if ( isStoredprocedure ) { getPlatform ( ) . registerOutResultSet ( ( CallableStatement ) stmt , 1 ) ; sm . bindValues ( stmt , values , 2 ) ; stmt . execute ( ) ; rs = ( ResultSet ) ( ( CallableStatement ) stmt ) . getObject ( 1 ) ; } else { sm . bindValues ( stmt , values , 1 ) ; rs = stmt . executeQuery ( ) ; } return new ResultSetAndStatement ( sm , stmt , rs , new SelectStatement ( ) { public Query getQueryInstance ( ) { return null ; } public int getColumnIndex ( FieldDescriptor fld ) { return JdbcType . MIN_INT ; } public String getStatement ( ) { return sql ; } } ) ; } catch ( PersistenceBrokerException e ) { sm . closeResources ( stmt , rs ) ; logger . error ( "PersistenceBrokerException during the execution of the SQL query: " + e . getMessage ( ) , e ) ; throw e ; } catch ( SQLException e ) { sm . closeResources ( stmt , rs ) ; throw ExceptionHelper . generateException ( e , sql , cld , values , logger , null ) ; } } | performs a SQL SELECT statement against RDBMS . |
767 | public int executeUpdateSQL ( String sqlStatement , ClassDescriptor cld , ValueContainer [ ] values1 , ValueContainer [ ] values2 ) throws PersistenceBrokerException { if ( logger . isDebugEnabled ( ) ) logger . debug ( "executeUpdateSQL: " + sqlStatement ) ; int result ; int index ; PreparedStatement stmt = null ; final StatementManagerIF sm = broker . serviceStatementManager ( ) ; try { stmt = sm . getPreparedStatement ( cld , sqlStatement , Query . NOT_SCROLLABLE , StatementManagerIF . FETCH_SIZE_NOT_APPLICABLE , isStoredProcedure ( sqlStatement ) ) ; index = sm . bindValues ( stmt , values1 , 1 ) ; sm . bindValues ( stmt , values2 , index ) ; result = stmt . executeUpdate ( ) ; } catch ( PersistenceBrokerException e ) { logger . error ( "PersistenceBrokerException during the execution of the Update SQL query: " + e . getMessage ( ) , e ) ; throw e ; } catch ( SQLException e ) { ValueContainer [ ] tmp = addValues ( values1 , values2 ) ; throw ExceptionHelper . generateException ( e , sqlStatement , cld , tmp , logger , null ) ; } finally { sm . closeResources ( stmt , null ) ; } return result ; } | performs a SQL UPDTE INSERT or DELETE statement against RDBMS . |
768 | public void executeUpdate ( ClassDescriptor cld , Object obj ) throws PersistenceBrokerException { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "executeUpdate: " + obj ) ; } if ( cld . getNonPkRwFields ( ) . length == 0 ) { return ; } final StatementManagerIF sm = broker . serviceStatementManager ( ) ; PreparedStatement stmt = null ; ValueContainer [ ] oldLockingValues ; oldLockingValues = cld . getCurrentLockingValues ( obj ) ; try { stmt = sm . getUpdateStatement ( cld ) ; if ( stmt == null ) { logger . error ( "getUpdateStatement returned a null statement" ) ; throw new PersistenceBrokerException ( "getUpdateStatement returned a null statement" ) ; } sm . bindUpdate ( stmt , cld , obj ) ; if ( logger . isDebugEnabled ( ) ) logger . debug ( "executeUpdate: " + stmt ) ; if ( ( stmt . executeUpdate ( ) == 0 ) && cld . isLocking ( ) ) { String objToString = "" ; try { objToString = obj . toString ( ) ; } catch ( Exception ex ) { } throw new OptimisticLockException ( "Object has been modified by someone else: " + objToString , obj ) ; } harvestReturnValues ( cld . getUpdateProcedure ( ) , obj , stmt ) ; } catch ( OptimisticLockException e ) { if ( logger . isDebugEnabled ( ) ) logger . debug ( "OptimisticLockException during the execution of update: " + e . getMessage ( ) , e ) ; throw e ; } catch ( PersistenceBrokerException e ) { setLockingValues ( cld , obj , oldLockingValues ) ; logger . error ( "PersistenceBrokerException during the execution of the update: " + e . getMessage ( ) , e ) ; throw e ; } catch ( SQLException e ) { final String sql = broker . serviceSqlGenerator ( ) . getPreparedUpdateStatement ( cld ) . getStatement ( ) ; throw ExceptionHelper . generateException ( e , sql , cld , logger , obj ) ; } finally { sm . closeResources ( stmt , null ) ; } } | performs an UPDATE operation against RDBMS . |
769 | public Object materializeObject ( ClassDescriptor cld , Identity oid ) throws PersistenceBrokerException { final StatementManagerIF sm = broker . serviceStatementManager ( ) ; final SelectStatement sql = broker . serviceSqlGenerator ( ) . getPreparedSelectByPkStatement ( cld ) ; Object result = null ; PreparedStatement stmt = null ; ResultSet rs = null ; try { stmt = sm . getSelectByPKStatement ( cld ) ; if ( stmt == null ) { logger . error ( "getSelectByPKStatement returned a null statement" ) ; throw new PersistenceBrokerException ( "getSelectByPKStatement returned a null statement" ) ; } sm . bindSelect ( stmt , oid , cld , false ) ; rs = stmt . executeQuery ( ) ; ResultSetAndStatement rs_stmt = new ResultSetAndStatement ( broker . serviceStatementManager ( ) , stmt , rs , sql ) ; if ( rs . next ( ) ) { Map row = new HashMap ( ) ; cld . getRowReader ( ) . readObjectArrayFrom ( rs_stmt , row ) ; result = cld . getRowReader ( ) . readObjectFrom ( row ) ; } rs_stmt . close ( ) ; } catch ( PersistenceBrokerException e ) { sm . closeResources ( stmt , rs ) ; logger . error ( "PersistenceBrokerException during the execution of materializeObject: " + e . getMessage ( ) , e ) ; throw e ; } catch ( SQLException e ) { sm . closeResources ( stmt , rs ) ; throw ExceptionHelper . generateException ( e , sql . getStatement ( ) , cld , logger , null ) ; } return result ; } | performs a primary key lookup operation against RDBMS and materializes an object from the resulting row . Only skalar attributes are filled from the row references are not resolved . |
770 | private void setLockingValues ( ClassDescriptor cld , Object obj , ValueContainer [ ] oldLockingValues ) { FieldDescriptor fields [ ] = cld . getLockingFields ( ) ; for ( int i = 0 ; i < fields . length ; i ++ ) { PersistentField field = fields [ i ] . getPersistentField ( ) ; Object lockVal = oldLockingValues [ i ] . getValue ( ) ; field . set ( obj , lockVal ) ; } } | Set the locking values |
771 | private void harvestReturnValues ( ProcedureDescriptor proc , Object obj , PreparedStatement stmt ) throws PersistenceBrokerSQLException { if ( ( proc == null ) || ( ! proc . hasReturnValues ( ) ) ) { return ; } CallableStatement callable = ( CallableStatement ) stmt ; int index = 0 ; if ( proc . hasReturnValue ( ) ) { index ++ ; this . harvestReturnValue ( obj , callable , proc . getReturnValueFieldRef ( ) , index ) ; } Iterator iter = proc . getArguments ( ) . iterator ( ) ; while ( iter . hasNext ( ) ) { index ++ ; ArgumentDescriptor arg = ( ArgumentDescriptor ) iter . next ( ) ; if ( arg . getIsReturnedByProcedure ( ) ) { this . harvestReturnValue ( obj , callable , arg . getFieldRef ( ) , index ) ; } } } | Harvest any values that may have been returned during the execution of a procedure . |
772 | private void harvestReturnValue ( Object obj , CallableStatement callable , FieldDescriptor fmd , int index ) throws PersistenceBrokerSQLException { try { if ( ( callable != null ) && ( fmd != null ) && ( obj != null ) ) { Object value = fmd . getJdbcType ( ) . getObjectFromColumn ( callable , index ) ; fmd . getPersistentField ( ) . set ( obj , fmd . getFieldConversion ( ) . sqlToJava ( value ) ) ; } } catch ( SQLException e ) { String msg = "SQLException during the execution of harvestReturnValue" + " class=" + obj . getClass ( ) . getName ( ) + "," + " field=" + fmd . getAttributeName ( ) + " : " + e . getMessage ( ) ; logger . error ( msg , e ) ; throw new PersistenceBrokerSQLException ( msg , e ) ; } } | Harvest a single value that was returned by a callable statement . |
773 | protected boolean isStoredProcedure ( String sql ) { int k = 0 , i = 0 ; char c ; while ( k < 3 && i < sql . length ( ) ) { c = sql . charAt ( i ) ; if ( c != ' ' ) { switch ( k ) { case 0 : if ( c != '{' ) return false ; break ; case 1 : if ( c != '?' && c != 'c' ) return false ; break ; case 2 : if ( c != '=' && c != 'a' ) return false ; break ; } k ++ ; } i ++ ; } return true ; } | Check if the specified sql - string is a stored procedure or not . |
774 | public String get ( ) { synchronized ( LOCK ) { if ( ! initialised ) { Random rnd = new Random ( ) ; rnd . nextBytes ( value ) ; value [ 3 ] = BASE64 [ ( ( value [ 3 ] >> 2 ) & BITS_6 ) ] ; value [ 4 ] = BASE64 [ ( ( value [ 4 ] >> 2 ) & BITS_6 ) ] ; value [ 5 ] = BASE64 [ ( ( value [ 5 ] >> 2 ) & BITS_6 ) ] ; value [ 6 ] = BASE64 [ ( ( value [ 6 ] >> 2 ) & BITS_6 ) ] ; value [ 7 ] = BASE64 [ ( ( value [ 7 ] >> 2 ) & BITS_6 ) ] ; completeToken ( rnd ) ; initialised = true ; } int l = low ; value [ 0 ] = BASE64 [ ( l & BITS_6 ) ] ; l >>= SHIFT_6 ; value [ 1 ] = BASE64 [ ( l & BITS_6 ) ] ; l >>= SHIFT_6 ; value [ 2 ] = BASE64 [ ( l & BITS_6 ) ] ; String res = new String ( value ) ; low ++ ; if ( low == LOW_MAX ) { low = 0 ; } if ( low == lowLast ) { time = System . currentTimeMillis ( ) ; completeToken ( ) ; } return res ; } } | Get a new token . |
775 | public boolean removeReader ( Object key , Object resourceId ) { boolean result = false ; ObjectLocks objectLocks = null ; synchronized ( locktable ) { objectLocks = ( ObjectLocks ) locktable . get ( resourceId ) ; if ( objectLocks != null ) { Map readers = objectLocks . getReaders ( ) ; result = readers . remove ( key ) != null ; if ( ( objectLocks . getWriter ( ) == null ) && ( readers . size ( ) == 0 ) ) { locktable . remove ( resourceId ) ; } } } return result ; } | Remove an read lock . |
776 | public boolean removeWriter ( Object key , Object resourceId ) { boolean result = false ; ObjectLocks objectLocks = null ; synchronized ( locktable ) { objectLocks = ( ObjectLocks ) locktable . get ( resourceId ) ; if ( objectLocks != null ) { LockEntry entry = objectLocks . getWriter ( ) ; if ( entry != null && entry . isOwnedBy ( key ) ) { objectLocks . setWriter ( null ) ; result = true ; if ( objectLocks . getReaders ( ) . size ( ) == 0 ) { locktable . remove ( resourceId ) ; } } } } return result ; } | Remove an write lock . |
777 | private List < StyleFilter > initStyleFilters ( List < FeatureStyleInfo > styleDefinitions ) throws GeomajasException { List < StyleFilter > styleFilters = new ArrayList < StyleFilter > ( ) ; if ( styleDefinitions == null || styleDefinitions . size ( ) == 0 ) { styleFilters . add ( new StyleFilterImpl ( ) ) ; } else { for ( FeatureStyleInfo styleDef : styleDefinitions ) { StyleFilterImpl styleFilterImpl = null ; String formula = styleDef . getFormula ( ) ; if ( null != formula && formula . length ( ) > 0 ) { styleFilterImpl = new StyleFilterImpl ( filterService . parseFilter ( formula ) , styleDef ) ; } else { styleFilterImpl = new StyleFilterImpl ( Filter . INCLUDE , styleDef ) ; } styleFilters . add ( styleFilterImpl ) ; } } return styleFilters ; } | Build list of style filters from style definitions . |
778 | public static List < Artifact > getAllArtifacts ( final Module module ) { final List < Artifact > artifacts = new ArrayList < Artifact > ( ) ; for ( final Module subModule : module . getSubmodules ( ) ) { artifacts . addAll ( getAllArtifacts ( subModule ) ) ; } artifacts . addAll ( module . getArtifacts ( ) ) ; return artifacts ; } | Returns all the Artifacts of the module |
779 | public static List < Dependency > getAllDependencies ( final Module module ) { final Set < Dependency > dependencies = new HashSet < Dependency > ( ) ; final List < String > producedArtifacts = new ArrayList < String > ( ) ; for ( final Artifact artifact : getAllArtifacts ( module ) ) { producedArtifacts . add ( artifact . getGavc ( ) ) ; } dependencies . addAll ( getAllDependencies ( module , producedArtifacts ) ) ; return new ArrayList < Dependency > ( dependencies ) ; } | Returns all the dependencies of a module |
780 | public static Set < Dependency > getAllDependencies ( final Module module , final List < String > producedArtifacts ) { final Set < Dependency > dependencies = new HashSet < Dependency > ( ) ; for ( final Dependency dependency : module . getDependencies ( ) ) { if ( ! producedArtifacts . contains ( dependency . getTarget ( ) . getGavc ( ) ) ) { dependencies . add ( dependency ) ; } } for ( final Module subModule : module . getSubmodules ( ) ) { dependencies . addAll ( getAllDependencies ( subModule , producedArtifacts ) ) ; } return dependencies ; } | Returns all the dependencies taken into account the artifact of the module that will be removed from the dependencies |
781 | public static List < Dependency > getCorporateDependencies ( final Module module , final List < String > corporateFilters ) { final List < Dependency > corporateDependencies = new ArrayList < Dependency > ( ) ; final Pattern corporatePattern = generateCorporatePattern ( corporateFilters ) ; for ( final Dependency dependency : getAllDependencies ( module ) ) { if ( dependency . getTarget ( ) . getGavc ( ) . matches ( corporatePattern . pattern ( ) ) ) { corporateDependencies . add ( dependency ) ; } } return corporateDependencies ; } | Returns the corporate dependencies of a module |
782 | protected boolean _load ( ) { java . sql . ResultSet rs = null ; try { synchronized ( getDbMeta ( ) ) { getDbMetaTreeModel ( ) . setStatusBarMessage ( "Reading columns for table " + getSchema ( ) . getCatalog ( ) . getCatalogName ( ) + "." + getSchema ( ) . getSchemaName ( ) + "." + getTableName ( ) ) ; rs = getDbMeta ( ) . getColumns ( getSchema ( ) . getCatalog ( ) . getCatalogName ( ) , getSchema ( ) . getSchemaName ( ) , getTableName ( ) , "%" ) ; final java . util . ArrayList alNew = new java . util . ArrayList ( ) ; while ( rs . next ( ) ) { alNew . add ( new DBMetaColumnNode ( getDbMeta ( ) , getDbMetaTreeModel ( ) , DBMetaTableNode . this , rs . getString ( "COLUMN_NAME" ) ) ) ; } alChildren = alNew ; javax . swing . SwingUtilities . invokeLater ( new Runnable ( ) { public void run ( ) { getDbMetaTreeModel ( ) . nodeStructureChanged ( DBMetaTableNode . this ) ; } } ) ; rs . close ( ) ; } } catch ( java . sql . SQLException sqlEx ) { this . getDbMetaTreeModel ( ) . reportSqlError ( "Error retrieving columns" , sqlEx ) ; try { if ( rs != null ) rs . close ( ) ; } catch ( java . sql . SQLException sqlEx2 ) { this . getDbMetaTreeModel ( ) . reportSqlError ( "Error retrieving columns" , sqlEx2 ) ; } return false ; } return true ; } | Loads the columns for this table into the alChildren list . |
783 | private void configureCaching ( HttpServletResponse response , int seconds ) { response . setDateHeader ( HTTP_EXPIRES_HEADER , System . currentTimeMillis ( ) + seconds * 1000L ) ; if ( seconds > 0 ) { response . setHeader ( HTTP_CACHE_CONTROL_HEADER , "max-age=" + seconds ) ; } else { response . setHeader ( HTTP_CACHE_CONTROL_HEADER , "no-cache" ) ; } } | Set HTTP headers to allow caching for the given number of seconds . |
784 | public int compare ( Object objA , Object objB ) { String idAStr = ( ( FieldDescriptorDef ) _fields . get ( objA ) ) . getProperty ( "id" ) ; String idBStr = ( ( FieldDescriptorDef ) _fields . get ( objB ) ) . getProperty ( "id" ) ; int idA ; int idB ; try { idA = Integer . parseInt ( idAStr ) ; } catch ( Exception ex ) { return 1 ; } try { idB = Integer . parseInt ( idBStr ) ; } catch ( Exception ex ) { return - 1 ; } return idA < idB ? - 1 : ( idA > idB ? 1 : 0 ) ; } | Compares two fields given by their names . |
785 | public boolean hasMoreElements ( ) { try { if ( ! hasCalledCheck ) { hasCalledCheck = true ; hasNext = resultSetAndStatment . m_rs . next ( ) ; } } catch ( SQLException e ) { LoggerFactory . getDefaultLogger ( ) . error ( e ) ; hasNext = false ; } finally { if ( ! hasNext ) { releaseDbResources ( ) ; } } return hasNext ; } | Tests if this enumeration contains more elements . |
786 | @ RequestMapping ( value = "/legendgraphic" , method = RequestMethod . GET ) public ModelAndView getGraphic ( @ RequestParam ( "layerId" ) String layerId , @ RequestParam ( value = "styleName" , required = false ) String styleName , @ RequestParam ( value = "ruleIndex" , required = false ) Integer ruleIndex , @ RequestParam ( value = "format" , required = false ) String format , @ RequestParam ( value = "width" , required = false ) Integer width , @ RequestParam ( value = "height" , required = false ) Integer height , @ RequestParam ( value = "scale" , required = false ) Double scale , @ RequestParam ( value = "allRules" , required = false ) Boolean allRules , HttpServletRequest request ) throws GeomajasException { if ( ! allRules ) { return getGraphic ( layerId , styleName , ruleIndex , format , width , height , scale ) ; } else { return getGraphics ( layerId , styleName , format , width , height , scale ) ; } } | Gets a legend graphic with the specified metadata parameters . All parameters are passed as request parameters . |
787 | public boolean checkRead ( TransactionImpl tx , Object obj ) { if ( hasReadLock ( tx , obj ) ) { return true ; } LockEntry writer = getWriter ( obj ) ; if ( writer . isOwnedBy ( tx ) ) { return true ; } return false ; } | checks whether the specified Object obj is read - locked by Transaction tx . |
788 | public boolean checkWrite ( TransactionImpl tx , Object obj ) { LockEntry writer = getWriter ( obj ) ; if ( writer == null ) return false ; else if ( writer . isOwnedBy ( tx ) ) return true ; else return false ; } | checks whether the specified Object obj is write - locked by Transaction tx . |
789 | private Class getDynamicProxyClass ( Class baseClass ) { Class [ ] m_dynamicProxyClassInterfaces ; if ( foundInterfaces . containsKey ( baseClass ) ) { m_dynamicProxyClassInterfaces = ( Class [ ] ) foundInterfaces . get ( baseClass ) ; } else { m_dynamicProxyClassInterfaces = getInterfaces ( baseClass ) ; foundInterfaces . put ( baseClass , m_dynamicProxyClassInterfaces ) ; } Class proxyClazz = Proxy . getProxyClass ( baseClass . getClassLoader ( ) , m_dynamicProxyClassInterfaces ) ; return proxyClazz ; } | returns a dynamic Proxy that implements all interfaces of the class described by this ClassDescriptor . |
790 | private Class [ ] getInterfaces ( Class clazz ) { Class superClazz = clazz ; Class [ ] interfaces = clazz . getInterfaces ( ) ; if ( clazz . isInterface ( ) ) { Class [ ] tempInterfaces = new Class [ interfaces . length + 1 ] ; tempInterfaces [ 0 ] = clazz ; System . arraycopy ( interfaces , 0 , tempInterfaces , 1 , interfaces . length ) ; interfaces = tempInterfaces ; } while ( ( superClazz = superClazz . getSuperclass ( ) ) != null ) { Class [ ] superInterfaces = superClazz . getInterfaces ( ) ; Class [ ] combInterfaces = new Class [ interfaces . length + superInterfaces . length ] ; System . arraycopy ( interfaces , 0 , combInterfaces , 0 , interfaces . length ) ; System . arraycopy ( superInterfaces , 0 , combInterfaces , interfaces . length , superInterfaces . length ) ; interfaces = combInterfaces ; } HashMap unique = new HashMap ( ) ; for ( int i = 0 ; i < interfaces . length ; i ++ ) { unique . put ( interfaces [ i ] . getName ( ) , interfaces [ i ] ) ; } unique . put ( OJBProxy . class . getName ( ) , OJBProxy . class ) ; interfaces = ( Class [ ] ) unique . values ( ) . toArray ( new Class [ unique . size ( ) ] ) ; return interfaces ; } | Get interfaces implemented by clazz |
791 | public Object getRealKey ( ) { if ( keyRealSubject != null ) { return keyRealSubject ; } else { TransactionExt tx = getTransaction ( ) ; if ( ( tx != null ) && tx . isOpen ( ) ) { prepareKeyRealSubject ( tx . getBroker ( ) ) ; } else { if ( getPBKey ( ) != null ) { PBCapsule capsule = new PBCapsule ( getPBKey ( ) , null ) ; try { prepareKeyRealSubject ( capsule . getBroker ( ) ) ; } finally { capsule . destroy ( ) ; } } else { getLog ( ) . warn ( "No tx, no PBKey - can't materialise key with Identity " + getKeyOid ( ) ) ; } } } return keyRealSubject ; } | Returns the real key object . |
792 | public Object getRealValue ( ) { if ( valueRealSubject != null ) { return valueRealSubject ; } else { TransactionExt tx = getTransaction ( ) ; if ( ( tx != null ) && tx . isOpen ( ) ) { prepareValueRealSubject ( tx . getBroker ( ) ) ; } else { if ( getPBKey ( ) != null ) { PBCapsule capsule = new PBCapsule ( getPBKey ( ) , null ) ; try { prepareValueRealSubject ( capsule . getBroker ( ) ) ; } finally { capsule . destroy ( ) ; } } else { getLog ( ) . warn ( "No tx, no PBKey - can't materialise value with Identity " + getKeyOid ( ) ) ; } } } return valueRealSubject ; } | Returns the real value object . |
793 | private Object readMetadataFromXML ( InputSource source , Class target ) throws MalformedURLException , ParserConfigurationException , SAXException , IOException { boolean validate = false ; SAXParserFactory factory = SAXParserFactory . newInstance ( ) ; log . info ( "RepositoryPersistor using SAXParserFactory : " + factory . getClass ( ) . getName ( ) ) ; if ( validate ) { factory . setValidating ( true ) ; } SAXParser p = factory . newSAXParser ( ) ; XMLReader reader = p . getXMLReader ( ) ; if ( validate ) { reader . setErrorHandler ( new OJBErrorHandler ( ) ) ; } Object result ; if ( DescriptorRepository . class . equals ( target ) ) { DescriptorRepository repository = new DescriptorRepository ( ) ; ContentHandler handler = new RepositoryXmlHandler ( repository ) ; reader . setContentHandler ( handler ) ; reader . parse ( source ) ; result = repository ; } else if ( ConnectionRepository . class . equals ( target ) ) { ConnectionRepository repository = new ConnectionRepository ( ) ; ContentHandler handler = new ConnectionDescriptorXmlHandler ( repository ) ; reader . setContentHandler ( handler ) ; reader . parse ( source ) ; result = repository ; } else throw new MetadataException ( "Could not build a repository instance for '" + target + "', using source " + source ) ; return result ; } | Read metadata by populating an instance of the target class using SAXParser . |
794 | public Criteria copy ( boolean includeGroupBy , boolean includeOrderBy , boolean includePrefetchedRelationships ) { Criteria copy = new Criteria ( ) ; copy . m_criteria = new Vector ( this . m_criteria ) ; copy . m_negative = this . m_negative ; if ( includeGroupBy ) { copy . groupby = this . groupby ; } if ( includeOrderBy ) { copy . orderby = this . orderby ; } if ( includePrefetchedRelationships ) { copy . prefetchedRelationships = this . prefetchedRelationships ; } return copy ; } | make a copy of the criteria |
795 | protected List splitInCriteria ( Object attribute , Collection values , boolean negative , int inLimit ) { List result = new ArrayList ( ) ; Collection inCollection = new ArrayList ( ) ; if ( values == null || values . isEmpty ( ) ) { result . add ( buildInCriteria ( attribute , negative , values ) ) ; } else { Iterator iter = values . iterator ( ) ; while ( iter . hasNext ( ) ) { inCollection . add ( iter . next ( ) ) ; if ( inCollection . size ( ) == inLimit || ! iter . hasNext ( ) ) { result . add ( buildInCriteria ( attribute , negative , inCollection ) ) ; inCollection = new ArrayList ( ) ; } } } return result ; } | Answer a List of InCriteria based on values each InCriteria contains only inLimit values |
796 | List getOrderby ( ) { List result = _getOrderby ( ) ; Iterator iter = getCriteria ( ) . iterator ( ) ; Object crit ; while ( iter . hasNext ( ) ) { crit = iter . next ( ) ; if ( crit instanceof Criteria ) { result . addAll ( ( ( Criteria ) crit ) . getOrderby ( ) ) ; } } return result ; } | Answer the orderBy of all Criteria and Sub Criteria the elements are of class Criteria . FieldHelper |
797 | public void addColumnIsNull ( String column ) { SelectionCriteria c = ValueCriteria . buildNullCriteria ( column , getUserAlias ( column ) ) ; c . setTranslateAttribute ( false ) ; addSelectionCriteria ( c ) ; } | Adds is Null criteria customer_id is Null The attribute will NOT be translated into column name |
798 | public void addColumnNotNull ( String column ) { SelectionCriteria c = ValueCriteria . buildNotNullCriteria ( column , getUserAlias ( column ) ) ; c . setTranslateAttribute ( false ) ; addSelectionCriteria ( c ) ; } | Adds not Null criteria customer_id is not Null The attribute will NOT be translated into column name |
799 | public void addBetween ( Object attribute , Object value1 , Object value2 ) { addSelectionCriteria ( ValueCriteria . buildBeweenCriteria ( attribute , value1 , value2 , getUserAlias ( attribute ) ) ) ; } | Adds BETWEEN criteria customer_id between 1 and 10 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.