idx int64 0 165k | question stringlengths 73 5.81k | target stringlengths 5 918 |
|---|---|---|
800 | public void addNotBetween ( Object attribute , Object value1 , Object value2 ) { addSelectionCriteria ( ValueCriteria . buildNotBeweenCriteria ( attribute , value1 , value2 , getUserAlias ( attribute ) ) ) ; } | Adds NOT BETWEEN criteria customer_id not between 1 and 10 |
801 | public void addIn ( Object attribute , Query subQuery ) { addSelectionCriteria ( ValueCriteria . buildInCriteria ( attribute , subQuery , getUserAlias ( attribute ) ) ) ; } | IN Criteria with SubQuery |
802 | public void addNotIn ( String attribute , Query subQuery ) { addSelectionCriteria ( ValueCriteria . buildNotInCriteria ( attribute , subQuery , getUserAlias ( attribute ) ) ) ; } | NOT IN Criteria with SubQuery |
803 | List getGroupby ( ) { List result = _getGroupby ( ) ; Iterator iter = getCriteria ( ) . iterator ( ) ; Object crit ; while ( iter . hasNext ( ) ) { crit = iter . next ( ) ; if ( crit instanceof Criteria ) { result . addAll ( ( ( Criteria ) crit ) . getGroupby ( ) ) ; } } return result ; } | Gets the groupby for ReportQueries of all Criteria and Sub Criteria the elements are of class FieldHelper |
804 | public void addGroupBy ( String [ ] fieldNames ) { for ( int i = 0 ; i < fieldNames . length ; i ++ ) { addGroupBy ( fieldNames [ i ] ) ; } } | Adds an array of groupby fieldNames for ReportQueries . |
805 | private static int getSqlInLimit ( ) { try { PersistenceBrokerConfiguration config = ( PersistenceBrokerConfiguration ) PersistenceBrokerFactory . getConfigurator ( ) . getConfigurationFor ( null ) ; return config . getSqlInLimit ( ) ; } catch ( ConfigurationException e ) { return 200 ; } } | read the prefetchInLimit from Config based on OJB . properties |
806 | private UserAlias getUserAlias ( Object attribute ) { if ( m_userAlias != null ) { return m_userAlias ; } if ( ! ( attribute instanceof String ) ) { return null ; } if ( m_alias == null ) { return null ; } if ( m_aliasPath == null ) { boolean allPathsAliased = true ; return new UserAlias ( m_alias , ( String ) attribut... | Retrieves or if necessary creates a user alias to be used by a child criteria |
807 | public void setAlias ( String alias ) { if ( alias == null || alias . trim ( ) . equals ( "" ) ) { m_alias = null ; } else { m_alias = alias ; } for ( int i = 0 ; i < m_criteria . size ( ) ; i ++ ) { if ( ! ( m_criteria . elementAt ( i ) instanceof Criteria ) ) { ( ( SelectionCriteria ) m_criteria . elementAt ( i ) ) .... | Sets the alias . Empty String is regarded as null . |
808 | public void setAlias ( UserAlias userAlias ) { m_alias = userAlias . getName ( ) ; for ( int i = 0 ; i < m_criteria . size ( ) ; i ++ ) { if ( ! ( m_criteria . elementAt ( i ) instanceof Criteria ) ) { ( ( SelectionCriteria ) m_criteria . elementAt ( i ) ) . setAlias ( userAlias ) ; } } } | Sets the alias using a userAlias object . |
809 | public Map getPathClasses ( ) { if ( m_pathClasses . isEmpty ( ) ) { if ( m_parentCriteria == null ) { if ( m_query == null ) { return m_pathClasses ; } else { return m_query . getPathClasses ( ) ; } } else { return m_parentCriteria . getPathClasses ( ) ; } } else { return m_pathClasses ; } } | Gets the pathClasses . A Map containing hints about what Class to be used for what path segment If local instance not set try parent Criteria s instance . If this is the top - level Criteria try the m_query s instance |
810 | public void beforeBatch ( PreparedStatement stmt ) throws PlatformException { final Method methodSetExecuteBatch ; final Method methodSendBatch ; methodSetExecuteBatch = ClassHelper . getMethod ( stmt , "setExecuteBatch" , PARAM_TYPE_INTEGER ) ; methodSendBatch = ClassHelper . getMethod ( stmt , "sendBatch" , null ) ; ... | Try Oracle update batching and call setExecuteBatch or revert to JDBC update batching . See 12 - 2 Update Batching in the Oracle9i JDBC Developer s Guide and Reference . |
811 | public void addBatch ( PreparedStatement stmt ) throws PlatformException { final boolean statementBatchingSupported = m_batchStatementsInProgress . containsKey ( stmt ) ; if ( statementBatchingSupported ) { try { stmt . executeUpdate ( ) ; } catch ( SQLException e ) { throw new PlatformException ( e . getLocalizedMessa... | Try Oracle update batching and call executeUpdate or revert to JDBC update batching . |
812 | public int [ ] executeBatch ( PreparedStatement stmt ) throws PlatformException { final Method methodSendBatch = ( Method ) m_batchStatementsInProgress . remove ( stmt ) ; final boolean statementBatchingSupported = methodSendBatch != null ; int [ ] retval = null ; if ( statementBatchingSupported ) { try { methodSendBat... | Try Oracle update batching and call sendBatch or revert to JDBC update batching . |
813 | public BeanDefinition toInternal ( BeanDefinitionInfo beanDefinitionInfo ) { if ( beanDefinitionInfo instanceof GenericBeanDefinitionInfo ) { GenericBeanDefinitionInfo genericInfo = ( GenericBeanDefinitionInfo ) beanDefinitionInfo ; GenericBeanDefinition def = new GenericBeanDefinition ( ) ; def . setBeanClassName ( ge... | Convert from a DTO to an internal Spring bean definition . |
814 | public BeanDefinitionInfo toDto ( BeanDefinition beanDefinition ) { if ( beanDefinition instanceof GenericBeanDefinition ) { GenericBeanDefinitionInfo info = new GenericBeanDefinitionInfo ( ) ; info . setClassName ( beanDefinition . getBeanClassName ( ) ) ; if ( beanDefinition . getPropertyValues ( ) != null ) { Map < ... | Convert from an internal Spring bean definition to a DTO . |
815 | private void validate ( Object object ) { Set < ConstraintViolation < Object > > viols = validator . validate ( object ) ; for ( ConstraintViolation < Object > constraintViolation : viols ) { if ( Null . class . isAssignableFrom ( constraintViolation . getConstraintDescriptor ( ) . getAnnotation ( ) . getClass ( ) ) ) ... | Take a stab at fixing validation problems ? |
816 | protected void initializeJdbcConnection ( Connection con , JdbcConnectionDescriptor jcd ) throws LookupException { try { PlatformFactory . getPlatformFor ( jcd ) . initializeJdbcConnection ( jcd , con ) ; } catch ( PlatformException e ) { throw new LookupException ( "Platform dependent initialization of connection fail... | Initialize the connection with the specified properties in OJB configuration files and platform depended properties . Invoke this method after a NEW connection is created not if re - using from pool . |
817 | protected Connection newConnectionFromDataSource ( JdbcConnectionDescriptor jcd ) throws LookupException { Connection retval = null ; DataSource ds = jcd . getDataSource ( ) ; if ( ds == null ) { ds = ( DataSource ) dataSourceCache . get ( jcd . getDatasourceName ( ) ) ; } try { if ( ds == null ) { synchronized ( dataS... | Creates a new connection from the data source that the connection descriptor represents . If the connection descriptor does not directly contain the data source then a JNDI lookup is performed to retrieve the data source . |
818 | protected Connection newConnectionFromDriverManager ( JdbcConnectionDescriptor jcd ) throws LookupException { Connection retval = null ; final String driver = jcd . getDriver ( ) ; final String url = getDbURL ( jcd ) ; try { ClassHelper . getClass ( driver , true ) ; final String user = jcd . getUserName ( ) ; final St... | Returns a new created connection |
819 | private void prepareModel ( DescriptorRepository model ) { TreeMap result = new TreeMap ( ) ; for ( Iterator it = model . getDescriptorTable ( ) . values ( ) . iterator ( ) ; it . hasNext ( ) ; ) { ClassDescriptor classDesc = ( ClassDescriptor ) it . next ( ) ; if ( classDesc . getFullTableName ( ) == null ) { continue... | Prepares a representation of the model that is easier accessible for our purposes . |
820 | protected final void subAppend ( final LoggingEvent event ) { if ( event instanceof ScheduledFileRollEvent ) { synchronized ( this ) { if ( this . closed ) { return ; } this . rollFile ( event ) ; } } else if ( event instanceof FileRollEvent ) { super . subAppend ( event ) ; } else { if ( event instanceof FoundationLof... | Responsible for executing file rolls as and when required in addition to delegating to the super class to perform the actual append operation . Synchronized for safety during enforced file roll . |
821 | public void updateIntegerBelief ( String name , int value ) { introspector . storeBeliefValue ( this , name , getIntegerBelief ( name ) + value ) ; } | Updates the given integer belief adding the given integer newBelief = previousBelief + givenValue |
822 | public int getIntegerBelief ( String name ) { Object belief = introspector . getBeliefBase ( this ) . get ( name ) ; int count = 0 ; if ( belief != null ) { count = ( Integer ) belief ; } return ( Integer ) count ; } | Returns the integer value o the given belief |
823 | public < T > List < T > fromExcel ( final Blob excelBlob , final Class < T > cls , final String sheetName ) throws ExcelService . Exception { return fromExcel ( excelBlob , new WorksheetSpec ( cls , sheetName ) ) ; } | Returns a list of objects for each line in the spreadsheet of the specified type . |
824 | public TransactionImpl getCurrentTransaction ( ) { TransactionImpl tx = tx_table . get ( Thread . currentThread ( ) ) ; if ( tx == null ) { throw new TransactionNotInProgressException ( "Calling method needed transaction, but no transaction found for current thread :-(" ) ; } return tx ; } | Returns the current transaction for the calling thread . |
825 | public String getDefaultTableName ( ) { String name = getName ( ) ; int lastDotPos = name . lastIndexOf ( '.' ) ; int lastDollarPos = name . lastIndexOf ( '$' ) ; return lastDollarPos > lastDotPos ? name . substring ( lastDollarPos + 1 ) : name . substring ( lastDotPos + 1 ) ; } | Returns the default table name for this class which is the unqualified class name . |
826 | private void sortFields ( ) { HashMap fields = new HashMap ( ) ; ArrayList fieldsWithId = new ArrayList ( ) ; ArrayList fieldsWithoutId = new ArrayList ( ) ; FieldDescriptorDef fieldDef ; for ( Iterator it = getFields ( ) ; it . hasNext ( ) ; ) { fieldDef = ( FieldDescriptorDef ) it . next ( ) ; fields . put ( fieldDef... | Sorts the fields . |
827 | public void checkConstraints ( String checkLevel ) throws ConstraintException { FieldDescriptorConstraints fieldConstraints = new FieldDescriptorConstraints ( ) ; ReferenceDescriptorConstraints refConstraints = new ReferenceDescriptorConstraints ( ) ; CollectionDescriptorConstraints collConstraints = new CollectionDesc... | Checks the constraints on this class . |
828 | private boolean contains ( ArrayList defs , DefBase obj ) { for ( Iterator it = defs . iterator ( ) ; it . hasNext ( ) ; ) { if ( obj . getName ( ) . equals ( ( ( DefBase ) it . next ( ) ) . getName ( ) ) ) { return true ; } } return false ; } | Determines whether the given list contains a descriptor with the same name . |
829 | private FieldDescriptorDef cloneField ( FieldDescriptorDef fieldDef , String prefix ) { FieldDescriptorDef copyFieldDef = new FieldDescriptorDef ( fieldDef , prefix ) ; copyFieldDef . setOwner ( this ) ; copyFieldDef . setProperty ( PropertyHelper . OJB_PROPERTY_IGNORE , null ) ; Properties mod = getModification ( copy... | Clones the given field . |
830 | private ReferenceDescriptorDef cloneReference ( ReferenceDescriptorDef refDef , String prefix ) { ReferenceDescriptorDef copyRefDef = new ReferenceDescriptorDef ( refDef , prefix ) ; copyRefDef . setOwner ( this ) ; copyRefDef . setProperty ( PropertyHelper . OJB_PROPERTY_IGNORE , null ) ; Properties mod = getModificat... | Clones the given reference . |
831 | private CollectionDescriptorDef cloneCollection ( CollectionDescriptorDef collDef , String prefix ) { CollectionDescriptorDef copyCollDef = new CollectionDescriptorDef ( collDef , prefix ) ; copyCollDef . setOwner ( this ) ; copyCollDef . setProperty ( PropertyHelper . OJB_PROPERTY_IGNORE , null ) ; Properties mod = ge... | Clones the given collection . |
832 | public Iterator getAllBaseTypes ( ) { ArrayList baseTypes = new ArrayList ( ) ; baseTypes . addAll ( _directBaseTypes . values ( ) ) ; for ( int idx = baseTypes . size ( ) - 1 ; idx >= 0 ; idx -- ) { ClassDescriptorDef curClassDef = ( ClassDescriptorDef ) baseTypes . get ( idx ) ; for ( Iterator it = curClassDef . getD... | Returns all base types . |
833 | public Iterator getAllExtentClasses ( ) { ArrayList subTypes = new ArrayList ( ) ; subTypes . addAll ( _extents ) ; for ( int idx = 0 ; idx < subTypes . size ( ) ; idx ++ ) { ClassDescriptorDef curClassDef = ( ClassDescriptorDef ) subTypes . get ( idx ) ; for ( Iterator it = curClassDef . getExtentClasses ( ) ; it . ha... | Returns an iterator of all direct and indirect extents of this class . |
834 | public FieldDescriptorDef getField ( String name ) { FieldDescriptorDef fieldDef = null ; for ( Iterator it = _fields . iterator ( ) ; it . hasNext ( ) ; ) { fieldDef = ( FieldDescriptorDef ) it . next ( ) ; if ( fieldDef . getName ( ) . equals ( name ) ) { return fieldDef ; } } return null ; } | Returns the field definition with the specified name . |
835 | public ArrayList getFields ( String fieldNames ) throws NoSuchFieldException { ArrayList result = new ArrayList ( ) ; FieldDescriptorDef fieldDef ; String name ; for ( CommaListIterator it = new CommaListIterator ( fieldNames ) ; it . hasNext ( ) ; ) { name = it . getNext ( ) ; fieldDef = getField ( name ) ; if ( field... | Returns the field descriptors given in the the field names list . |
836 | public ArrayList getPrimaryKeys ( ) { ArrayList result = new ArrayList ( ) ; FieldDescriptorDef fieldDef ; for ( Iterator it = getFields ( ) ; it . hasNext ( ) ; ) { fieldDef = ( FieldDescriptorDef ) it . next ( ) ; if ( fieldDef . getBooleanProperty ( PropertyHelper . OJB_PROPERTY_PRIMARYKEY , false ) ) { result . add... | Returns the primarykey fields . |
837 | public ReferenceDescriptorDef getReference ( String name ) { ReferenceDescriptorDef refDef ; for ( Iterator it = _references . iterator ( ) ; it . hasNext ( ) ; ) { refDef = ( ReferenceDescriptorDef ) it . next ( ) ; if ( refDef . getName ( ) . equals ( name ) ) { return refDef ; } } return null ; } | Returns a reference definition of the given name if it exists . |
838 | public CollectionDescriptorDef getCollection ( String name ) { CollectionDescriptorDef collDef = null ; for ( Iterator it = _collections . iterator ( ) ; it . hasNext ( ) ; ) { collDef = ( CollectionDescriptorDef ) it . next ( ) ; if ( collDef . getName ( ) . equals ( name ) ) { return collDef ; } } return null ; } | Returns the collection definition of the given name if it exists . |
839 | public NestedDef getNested ( String name ) { NestedDef nestedDef = null ; for ( Iterator it = _nested . iterator ( ) ; it . hasNext ( ) ; ) { nestedDef = ( NestedDef ) it . next ( ) ; if ( nestedDef . getName ( ) . equals ( name ) ) { return nestedDef ; } } return null ; } | Returns the nested object definition with the specified name . |
840 | public IndexDescriptorDef getIndexDescriptor ( String name ) { IndexDescriptorDef indexDef = null ; for ( Iterator it = _indexDescriptors . iterator ( ) ; it . hasNext ( ) ; ) { indexDef = ( IndexDescriptorDef ) it . next ( ) ; if ( indexDef . getName ( ) . equals ( name ) ) { return indexDef ; } } return null ; } | Returns the index descriptor definition of the given name if it exists . |
841 | public void addProcedure ( ProcedureDef procDef ) { procDef . setOwner ( this ) ; _procedures . put ( procDef . getName ( ) , procDef ) ; } | Adds a procedure definition to this class descriptor . |
842 | public void addProcedureArgument ( ProcedureArgumentDef argDef ) { argDef . setOwner ( this ) ; _procedureArguments . put ( argDef . getName ( ) , argDef ) ; } | Adds a procedure argument definition to this class descriptor . |
843 | public void processClass ( String template , Properties attributes ) throws XDocletException { if ( ! _model . hasClass ( getCurrentClass ( ) . getQualifiedName ( ) ) ) { LogHelper . debug ( true , OjbTagsHandler . class , "processClass" , "Type " + getCurrentClass ( ) . getQualifiedName ( ) ) ; } ClassDescriptorDef cl... | Sets the current class definition derived from the current class and optionally some attributes . |
844 | public void forAllClassDefinitions ( String template , Properties attributes ) throws XDocletException { for ( Iterator it = _model . getClasses ( ) ; it . hasNext ( ) ; ) { _curClassDef = ( ClassDescriptorDef ) it . next ( ) ; generate ( template ) ; } _curClassDef = null ; LogHelper . debug ( true , OjbTagsHandler . ... | Processes the template for all class definitions . |
845 | public void originalClass ( String template , Properties attributes ) throws XDocletException { pushCurrentClass ( _curClassDef . getOriginalClass ( ) ) ; generate ( template ) ; popCurrentClass ( ) ; } | Processes the original class rather than the current class definition . |
846 | public String addExtent ( Properties attributes ) throws XDocletException { String name = attributes . getProperty ( ATTRIBUTE_NAME ) ; if ( ! _model . hasClass ( name ) ) { throw new XDocletException ( Translator . getString ( XDocletModulesOjbMessages . class , XDocletModulesOjbMessages . COULD_NOT_FIND_TYPE , new St... | Adds an extent relation to the current class definition . |
847 | public void forAllExtents ( String template , Properties attributes ) throws XDocletException { for ( Iterator it = _curClassDef . getExtentClasses ( ) ; it . hasNext ( ) ; ) { _curExtent = ( ClassDescriptorDef ) it . next ( ) ; generate ( template ) ; } _curExtent = null ; } | Processes the template for all extents of the current class . |
848 | public String processIndexDescriptor ( Properties attributes ) throws XDocletException { String name = attributes . getProperty ( ATTRIBUTE_NAME ) ; IndexDescriptorDef indexDef = _curClassDef . getIndexDescriptor ( name ) ; String attrName ; if ( indexDef == null ) { indexDef = new IndexDescriptorDef ( name ) ; _curCla... | Processes an index descriptor tag . |
849 | public void forAllIndexDescriptorDefinitions ( String template , Properties attributes ) throws XDocletException { for ( Iterator it = _curClassDef . getIndexDescriptors ( ) ; it . hasNext ( ) ; ) { _curIndexDescriptorDef = ( IndexDescriptorDef ) it . next ( ) ; generate ( template ) ; } _curIndexDescriptorDef = null ;... | Processes the template for all index descriptors of the current class definition . |
850 | public void forAllIndexDescriptorColumns ( String template , Properties attributes ) throws XDocletException { String fields = _curIndexDescriptorDef . getProperty ( PropertyHelper . OJB_PROPERTY_FIELDS ) ; FieldDescriptorDef fieldDef ; String name ; for ( CommaListIterator it = new CommaListIterator ( fields ) ; it . ... | Processes the template for all index columns for the current index descriptor . |
851 | public String processObjectCache ( Properties attributes ) throws XDocletException { ObjectCacheDef objCacheDef = _curClassDef . setObjectCache ( attributes . getProperty ( ATTRIBUTE_CLASS ) ) ; String attrName ; attributes . remove ( ATTRIBUTE_CLASS ) ; for ( Enumeration attrNames = attributes . propertyNames ( ) ; at... | Processes an object cache tag . |
852 | public void forObjectCache ( String template , Properties attributes ) throws XDocletException { _curObjectCacheDef = _curClassDef . getObjectCache ( ) ; if ( _curObjectCacheDef != null ) { generate ( template ) ; _curObjectCacheDef = null ; } } | Processes the template for the object cache of the current class definition . |
853 | public String processProcedure ( Properties attributes ) throws XDocletException { String type = attributes . getProperty ( ATTRIBUTE_TYPE ) ; ProcedureDef procDef = _curClassDef . getProcedure ( type ) ; String attrName ; if ( procDef == null ) { procDef = new ProcedureDef ( type ) ; _curClassDef . addProcedure ( proc... | Processes a procedure tag . |
854 | public void forAllProcedures ( String template , Properties attributes ) throws XDocletException { for ( Iterator it = _curClassDef . getProcedures ( ) ; it . hasNext ( ) ; ) { _curProcedureDef = ( ProcedureDef ) it . next ( ) ; generate ( template ) ; } _curProcedureDef = null ; } | Processes the template for all procedures of the current class definition . |
855 | public String processProcedureArgument ( Properties attributes ) throws XDocletException { String id = attributes . getProperty ( ATTRIBUTE_NAME ) ; ProcedureArgumentDef argDef = _curClassDef . getProcedureArgument ( id ) ; String attrName ; if ( argDef == null ) { argDef = new ProcedureArgumentDef ( id ) ; _curClassDe... | Processes a runtime procedure argument tag . |
856 | public void forAllProcedureArguments ( String template , Properties attributes ) throws XDocletException { String argNameList = _curProcedureDef . getProperty ( PropertyHelper . OJB_PROPERTY_ARGUMENTS ) ; for ( CommaListIterator it = new CommaListIterator ( argNameList ) ; it . hasNext ( ) ; ) { _curProcedureArgumentDe... | Processes the template for all procedure arguments of the current procedure . |
857 | public void processAnonymousField ( Properties attributes ) throws XDocletException { if ( ! attributes . containsKey ( ATTRIBUTE_NAME ) ) { throw new XDocletException ( Translator . getString ( XDocletModulesOjbMessages . class , XDocletModulesOjbMessages . PARAMETER_IS_REQUIRED , new String [ ] { ATTRIBUTE_NAME } ) )... | Processes an anonymous field definition specified at the class level . |
858 | public void processField ( String template , Properties attributes ) throws XDocletException { String name = OjbMemberTagsHandler . getMemberName ( ) ; String defaultType = getDefaultJdbcTypeForCurrentMember ( ) ; String defaultConversion = getDefaultJdbcConversionForCurrentMember ( ) ; FieldDescriptorDef fieldDef = _c... | Sets the current field definition derived from the current member and optionally some attributes . |
859 | public void processAnonymousReference ( Properties attributes ) throws XDocletException { ReferenceDescriptorDef refDef = _curClassDef . getReference ( "super" ) ; String attrName ; if ( refDef == null ) { refDef = new ReferenceDescriptorDef ( "super" ) ; _curClassDef . addReference ( refDef ) ; } refDef . setAnonymous... | Processes an anonymous reference definition . |
860 | public void processReference ( String template , Properties attributes ) throws XDocletException { String name = OjbMemberTagsHandler . getMemberName ( ) ; XClass type = OjbMemberTagsHandler . getMemberType ( ) ; int dim = OjbMemberTagsHandler . getMemberDimension ( ) ; ReferenceDescriptorDef refDef = _curClassDef . ge... | Sets the current reference definition derived from the current member and optionally some attributes . |
861 | public void forAllReferenceDefinitions ( String template , Properties attributes ) throws XDocletException { for ( Iterator it = _curClassDef . getReferences ( ) ; it . hasNext ( ) ; ) { _curReferenceDef = ( ReferenceDescriptorDef ) it . next ( ) ; if ( _curReferenceDef . isAnonymous ( ) && ( _curReferenceDef . getOwne... | Processes the template for all reference definitions of the current class definition . |
862 | public void processCollection ( String template , Properties attributes ) throws XDocletException { String name = OjbMemberTagsHandler . getMemberName ( ) ; CollectionDescriptorDef collDef = _curClassDef . getCollection ( name ) ; String attrName ; if ( collDef == null ) { collDef = new CollectionDescriptorDef ( name )... | Sets the current collection definition derived from the current member and optionally some attributes . |
863 | public void forAllCollectionDefinitions ( String template , Properties attributes ) throws XDocletException { for ( Iterator it = _curClassDef . getCollections ( ) ; it . hasNext ( ) ; ) { _curCollectionDef = ( CollectionDescriptorDef ) it . next ( ) ; if ( ! isFeatureIgnored ( LEVEL_COLLECTION ) && ! _curCollectionDef... | Processes the template for all collection definitions of the current class definition . |
864 | public String processNested ( Properties attributes ) throws XDocletException { String name = OjbMemberTagsHandler . getMemberName ( ) ; XClass type = OjbMemberTagsHandler . getMemberType ( ) ; int dim = OjbMemberTagsHandler . getMemberDimension ( ) ; NestedDef nestedDef = _curClassDef . getNested ( name ) ; if ( type ... | Addes the current member as a nested object . |
865 | public String createTorqueSchema ( Properties attributes ) throws XDocletException { String dbName = ( String ) getDocletContext ( ) . getConfigParam ( CONFIG_PARAM_DATABASENAME ) ; _torqueModel = new TorqueModelDef ( dbName , _model ) ; return "" ; } | Generates a torque schema for the model . |
866 | public void forAllTables ( String template , Properties attributes ) throws XDocletException { for ( Iterator it = _torqueModel . getTables ( ) ; it . hasNext ( ) ; ) { _curTableDef = ( TableDef ) it . next ( ) ; generate ( template ) ; } _curTableDef = null ; } | Processes the template for all table definitions in the torque model . |
867 | public void forAllColumns ( String template , Properties attributes ) throws XDocletException { for ( Iterator it = _curTableDef . getColumns ( ) ; it . hasNext ( ) ; ) { _curColumnDef = ( ColumnDef ) it . next ( ) ; generate ( template ) ; } _curColumnDef = null ; } | Processes the template for all column definitions of the current table . |
868 | public void forAllForeignkeys ( String template , Properties attributes ) throws XDocletException { for ( Iterator it = _curTableDef . getForeignkeys ( ) ; it . hasNext ( ) ; ) { _curForeignkeyDef = ( ForeignkeyDef ) it . next ( ) ; generate ( template ) ; } _curForeignkeyDef = null ; } | Processes the template for all foreignkeys of the current table . |
869 | public void forAllForeignkeyColumnPairs ( String template , Properties attributes ) throws XDocletException { for ( int idx = 0 ; idx < _curForeignkeyDef . getNumColumnPairs ( ) ; idx ++ ) { _curPairLeft = _curForeignkeyDef . getLocalColumn ( idx ) ; _curPairRight = _curForeignkeyDef . getRemoteColumn ( idx ) ; generat... | Processes the template for all column pairs of the current foreignkey . |
870 | public void forAllIndices ( String template , Properties attributes ) throws XDocletException { boolean processUnique = TypeConversionUtil . stringToBoolean ( attributes . getProperty ( ATTRIBUTE_UNIQUE ) , false ) ; _curIndexDef = _curTableDef . getIndex ( null ) ; if ( ( _curIndexDef != null ) && ( processUnique == _... | Processes the template for all indices of the current table . |
871 | public void forAllIndexColumns ( String template , Properties attributes ) throws XDocletException { for ( Iterator it = _curIndexDef . getColumns ( ) ; it . hasNext ( ) ; ) { _curColumnDef = _curTableDef . getColumn ( ( String ) it . next ( ) ) ; generate ( template ) ; } _curColumnDef = null ; } | Processes the template for all columns of the current table index . |
872 | public String name ( Properties attributes ) throws XDocletException { return getDefForLevel ( attributes . getProperty ( ATTRIBUTE_LEVEL ) ) . getName ( ) ; } | Returns the name of the current object on the specified level . |
873 | public void ifHasName ( String template , Properties attributes ) throws XDocletException { String name = getDefForLevel ( attributes . getProperty ( ATTRIBUTE_LEVEL ) ) . getName ( ) ; if ( ( name != null ) && ( name . length ( ) > 0 ) ) { generate ( template ) ; } } | Processes the template if the current object on the specified level has a non - empty name . |
874 | public void ifHasProperty ( String template , Properties attributes ) throws XDocletException { String value = getPropertyValue ( attributes . getProperty ( ATTRIBUTE_LEVEL ) , attributes . getProperty ( ATTRIBUTE_NAME ) ) ; if ( value != null ) { generate ( template ) ; } } | Determines whether the current object on the specified level has a specific property and if so processes the template |
875 | public String propertyValue ( Properties attributes ) throws XDocletException { String value = getPropertyValue ( attributes . getProperty ( ATTRIBUTE_LEVEL ) , attributes . getProperty ( ATTRIBUTE_NAME ) ) ; if ( value == null ) { value = attributes . getProperty ( ATTRIBUTE_DEFAULT ) ; } return value ; } | Returns the value of a property of the current object on the specified level . |
876 | public void ifPropertyValueEquals ( String template , Properties attributes ) throws XDocletException { String value = getPropertyValue ( attributes . getProperty ( ATTRIBUTE_LEVEL ) , attributes . getProperty ( ATTRIBUTE_NAME ) ) ; String expected = attributes . getProperty ( ATTRIBUTE_VALUE ) ; if ( value == null ) {... | Processes the template if the property value of the current object on the specified level equals the given value . |
877 | public void forAllValuePairs ( String template , Properties attributes ) throws XDocletException { String name = attributes . getProperty ( ATTRIBUTE_NAME , "attributes" ) ; String defaultValue = attributes . getProperty ( ATTRIBUTE_DEFAULT_RIGHT , "" ) ; String attributePairs = getPropertyValue ( attributes . getPrope... | Processes the template for the comma - separated value pairs in an attribute of the current object on the specified level . |
878 | private ClassDescriptorDef ensureClassDef ( XClass original ) { String name = original . getQualifiedName ( ) ; ClassDescriptorDef classDef = _model . getClass ( name ) ; if ( classDef == null ) { classDef = new ClassDescriptorDef ( original ) ; _model . addClass ( classDef ) ; } return classDef ; } | Makes sure that there is a class definition for the given qualified name and returns it . |
879 | private void addDirectSubTypes ( XClass type , ArrayList subTypes ) { if ( type . isInterface ( ) ) { if ( type . getExtendingInterfaces ( ) != null ) { subTypes . addAll ( type . getExtendingInterfaces ( ) ) ; } if ( type . getImplementingClasses ( ) != null ) { Collection declaredInterfaces = null ; XClass subType ; ... | Adds all direct subtypes to the given list . |
880 | private String searchForPersistentSubType ( XClass type ) { ArrayList queue = new ArrayList ( ) ; XClass subType ; queue . add ( type ) ; while ( ! queue . isEmpty ( ) ) { subType = ( XClass ) queue . get ( 0 ) ; queue . remove ( 0 ) ; if ( _model . hasClass ( subType . getQualifiedName ( ) ) ) { return subType . getQu... | Searches the type and its sub types for the nearest ojb - persistent type and returns its name . |
881 | private DefBase getDefForLevel ( String level ) { if ( LEVEL_CLASS . equals ( level ) ) { return _curClassDef ; } else if ( LEVEL_FIELD . equals ( level ) ) { return _curFieldDef ; } else if ( LEVEL_REFERENCE . equals ( level ) ) { return _curReferenceDef ; } else if ( LEVEL_COLLECTION . equals ( level ) ) { return _cu... | Returns the current definition on the indicated level . |
882 | private String getPropertyValue ( String level , String name ) { return getDefForLevel ( level ) . getProperty ( name ) ; } | Returns the value of the indicated property of the current object on the specified level . |
883 | final void compress ( final File backupFile , final AppenderRollingProperties properties ) { if ( this . isCompressed ( backupFile ) ) { LogLog . debug ( "Backup log file " + backupFile . getName ( ) + " is already compressed" ) ; return ; } final long lastModified = backupFile . lastModified ( ) ; if ( 0L == lastModif... | Template method responsible for file compression checks file creation and delegation to specific strategy implementations . |
884 | public static PersistenceBroker createPersistenceBroker ( String jcdAlias , String user , String password ) throws PBFactoryException { return PersistenceBrokerFactoryFactory . instance ( ) . createPersistenceBroker ( jcdAlias , user , password ) ; } | Creates a new broker instance . |
885 | public void setRegistrationConfig ( RegistrationConfig registrationConfig ) { this . registrationConfig = registrationConfig ; if ( registrationConfig . getDefaultConfig ( ) != null ) { for ( String key : registrationConfig . getDefaultConfig ( ) . keySet ( ) ) { dynamicConfig . put ( key , registrationConfig . getDefa... | The mediator registration config . If it contains default config and definitions then the dynamic config will be initialized with those values . |
886 | public void characters ( char ch [ ] , int start , int length ) { if ( m_CurrentString == null ) m_CurrentString = new String ( ch , start , length ) ; else m_CurrentString += new String ( ch , start , length ) ; } | characters callback . |
887 | public synchronized boolean hasNext ( ) { try { if ( ! isHasCalledCheck ( ) ) { setHasCalledCheck ( true ) ; setHasNext ( getRsAndStmt ( ) . m_rs . next ( ) ) ; if ( ! getHasNext ( ) ) { autoReleaseDbResources ( ) ; } } } catch ( Exception ex ) { setHasNext ( false ) ; autoReleaseDbResources ( ) ; if ( ex instanceof Re... | returns true if there are still more rows in the underlying ResultSet . Returns false if ResultSet is exhausted . |
888 | public synchronized Object next ( ) throws NoSuchElementException { try { if ( ! isHasCalledCheck ( ) ) { hasNext ( ) ; } setHasCalledCheck ( false ) ; if ( getHasNext ( ) ) { Object obj = getObjectFromResultSet ( ) ; m_current_row ++ ; if ( ! disableLifeCycleEvents ) { getAfterLookupEvent ( ) . setTarget ( obj ) ; get... | moves to the next row of the underlying ResultSet and returns the corresponding Object materialized from this row . |
889 | private Collection getOwnerObjects ( ) { Collection owners = new Vector ( ) ; while ( hasNext ( ) ) { owners . add ( next ( ) ) ; } return owners ; } | read all objects of this iterator . objects will be placed in cache |
890 | private void prefetchRelationships ( Query query ) { List prefetchedRel ; Collection owners ; String relName ; RelationshipPrefetcher [ ] prefetchers ; if ( query == null || query . getPrefetchedRelationships ( ) == null || query . getPrefetchedRelationships ( ) . isEmpty ( ) ) { return ; } if ( ! supportsAdvancedJDBCC... | prefetch defined relationships requires JDBC level 2 . 0 does not work with Arrays |
891 | protected Object getProxyFromResultSet ( ) throws PersistenceBrokerException { Identity oid = getIdentityFromResultSet ( ) ; return getBroker ( ) . createProxy ( getItemProxyClass ( ) , oid ) ; } | Reads primary key information from current RS row and generates a |
892 | protected int countedSize ( ) throws PersistenceBrokerException { Query countQuery = getBroker ( ) . serviceBrokerHelper ( ) . getCountQuery ( getQueryObject ( ) . getQuery ( ) ) ; ResultSetAndStatement rsStmt ; ClassDescriptor cld = getQueryObject ( ) . getClassDescriptor ( ) ; int count = 0 ; if ( countQuery instance... | Answer the counted size |
893 | public boolean absolute ( int row ) throws PersistenceBrokerException { boolean retval ; if ( supportsAdvancedJDBCCursorControl ( ) ) { retval = absoluteAdvanced ( row ) ; } else { retval = absoluteBasic ( row ) ; } return retval ; } | Moves the cursor to the given row number in the iterator . If the row number is positive the cursor moves to the given row number with respect to the beginning of the iterator . The first row is row 1 the second is row 2 and so on . |
894 | private boolean absoluteBasic ( int row ) { boolean retval = false ; if ( row > m_current_row ) { try { while ( m_current_row < row && getRsAndStmt ( ) . m_rs . next ( ) ) { m_current_row ++ ; } if ( m_current_row == row ) { retval = true ; } else { setHasCalledCheck ( true ) ; setHasNext ( false ) ; retval = false ; a... | absolute for basicJDBCSupport |
895 | private boolean absoluteAdvanced ( int row ) { boolean retval = false ; try { if ( getRsAndStmt ( ) . m_rs != null ) { if ( row == 0 ) { getRsAndStmt ( ) . m_rs . beforeFirst ( ) ; } else { retval = getRsAndStmt ( ) . m_rs . absolute ( row ) ; } m_current_row = row ; setHasCalledCheck ( false ) ; } } catch ( SQLExcepti... | absolute for advancedJDBCSupport |
896 | private String safeToString ( Object obj ) { String toString = null ; if ( obj != null ) { try { toString = obj . toString ( ) ; } catch ( Throwable ex ) { toString = "BAD toString() impl for " + obj . getClass ( ) . getName ( ) ; } } return toString ; } | provides a safe toString |
897 | public void setRowReader ( String newReaderClassName ) { try { m_rowReader = ( RowReader ) ClassHelper . newInstance ( newReaderClassName , ClassDescriptor . class , this ) ; } catch ( Exception e ) { throw new MetadataException ( "Instantiating of current set RowReader failed" , e ) ; } } | sets the row reader class name for thie class descriptor |
898 | public void setClassOfObject ( Class c ) { m_Class = c ; isAbstract = Modifier . isAbstract ( m_Class . getModifiers ( ) ) ; } | sets the class object described by this descriptor . |
899 | public void addFieldDescriptor ( FieldDescriptor fld ) { fld . setClassDescriptor ( this ) ; if ( m_FieldDescriptions == null ) { m_FieldDescriptions = new FieldDescriptor [ 1 ] ; m_FieldDescriptions [ 0 ] = fld ; } else { int size = m_FieldDescriptions . length ; FieldDescriptor [ ] tmpArray = new FieldDescriptor [ si... | adds a FIELDDESCRIPTOR to this ClassDescriptor . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.