Helper method to lookup a DAO if it has already been associated with the table-config. Otherwise this returns
null.
13
public synchronized static <D extends Dao<T, ?>, T> D lookupDao(ConnectionSource connectionSource,
			DatabaseTableConfig<T> tableConfig) {
		if (connectionSource == null) {
			throw new IllegalArgumentException("connectionSource argument cannot be null");
		}
		TableConfigConnectionSource key = new TableConfigConnectionSource(connectionSource, tableConfig);
		Dao<?, ?> dao = lookupDao(key);
		if (dao == null) {
			return null;
		} else {
			@SuppressWarnings("unchecked")
			D castDao = (D) dao;
			return castDao;
		}
	}
217412
private GeometryIndexDao getGeometryIndexDao() throws SQLException {
		if (geometryIndexDao == null) {
			geometryIndexDao = DaoManager.createDao(connectionSource,
					GeometryIndex.class);
		}
		return geometryIndexDao;
	}
439563
@Bean
	public DaoConfig daoConfig() {
		DaoConfig retVal = new DaoConfig();
		retVal.setAllowMultipleDelete(true);
		return retVal;
	}
893792
function(executionStep) {
    // In order to use and index for implementing a join, the entire relation
    // must be fed to the JoinStep, otherwise the index can't be used.
    if (!(executionStep instanceof lf.proc.TableAccessFullStep)) {
      return null;
    }
    var candidateColumn = getColumnForTable(executionStep.table);
    return goog.isNull(candidateColumn.getIndex()) ? null : candidateColumn;
  }
238932
private Entity lookupEntity(String sid) {
        for (Integer i = 0; i < getEntities().size(); i++) {
            Entity e = getEntities().get(i);
            if (e != null && sid.compareTo(EntityContainer.buildId(e.getId())) == 0) {
                return getEntity(e.getId());
            }
        }
        return null;
    }
988090
private JdbcType lookupJdbcType()
    {
        JdbcType result = null;
        String columnType = getColumnType();
        // if sql type was not set in metadata we use reflection
        // to determine sql type by reflection
        if (columnType == null)
        {
            try
            {
                result = JdbcTypesHelper.getJdbcTypeByReflection(m_PersistentField.getType().getName());
            }
            catch(Exception e)
            {
                String eol = SystemUtils.LINE_SEPARATOR;
                throw new OJBRuntimeException("Can't automatically assign a jdbc field-type for field: "
                        + eol + this.toXML() + eol + "in class: " + eol + getClassDescriptor(), e);
            }
        }
        else
        {
            try
            {
                result = JdbcTypesHelper.getJdbcTypeByName(columnType);
            }
            catch(Exception e)
            {
                String eol = SystemUtils.LINE_SEPARATOR;
                throw new OJBRuntimeException("Can't assign the specified jdbc field-type '"+columnType+"' for field: "
                        + eol + this.toXML() + eol + "in class: " + eol + getClassDescriptor(), e);
            }
        }
        return result;
    }
760854
public EntityConfig getEntityConfigByTableName(String tableName) {
        for (EntityConfig entityConfig : entityConfigs) {
            if (tableName.equalsIgnoreCase(entityConfig.getTableName())) {
                return entityConfig;
            }
        }
        return null;
    }
1320411
@Override
	public synchronized String lookup(String id)
	{
		if(this.properties == null)
			this.setUp();
		
		String associated = this.properties.getProperty(id);
		
		if(associated == null)
		{
			associated = this.next();
			
			//Est. new association
			register(id,associated);
		}
		
		return associated;
			
	}
880338
private Object[] findIdsByColumn(String tableName, String columnName, Object columnValue)
    {
        Object connection = null;

        try
        {
            connection = getConnection();
            String valueAsStr = PropertyAccessorHelper.getString(columnValue);

            Set<String> results = null;

            if (resource != null && resource.isActive())
            {
                Response response = ((Transaction) connection).zrangeByScore(getHashKey(tableName, columnName),
                        getDouble(valueAsStr), getDouble(valueAsStr));
                // ((Transaction) connection).exec();
                ((RedisTransaction) resource).onExecute(((Transaction) connection));

                results = (Set<String>) response.get();
            }
            else
            {
                results = ((Jedis) connection).zrangeByScore(getHashKey(tableName, columnName), getDouble(valueAsStr),
                        getDouble(valueAsStr));

            }
            if (results != null)
            {
                return results.toArray(new Object[0]);
            }

        }
        finally
        {
            onCleanup(connection);
        }

        return null;
    }
133315
def _try_lookup(table, value, default = ""):
    
    try:
        string = table[ value ]
    except KeyError:
        string = default
    return string
441502
private MetadataReferenceDao getMetadataReferenceDao() throws SQLException {
		if (metadataReferenceDao == null) {
			metadataReferenceDao = DaoManager.createDao(connectionSource,
					MetadataReference.class);
		}
		return metadataReferenceDao;
	}
979210
private TileMatrixSetDao getTileMatrixSetDao() throws SQLException {
		if (tileMatrixSetDao == null) {
			tileMatrixSetDao = DaoManager.createDao(connectionSource,
					TileMatrixSet.class);
		}
		return tileMatrixSetDao;
	}
159677
public synchronized static <D extends Dao<T, ?>, T> D lookupDao(ConnectionSource connectionSource, Class<T> clazz) {
		if (connectionSource == null) {
			throw new IllegalArgumentException("connectionSource argument cannot be null");
		}
		ClassConnectionSource key = new ClassConnectionSource(connectionSource, clazz);
		Dao<?, ?> dao = lookupDao(key);
		@SuppressWarnings("unchecked")
		D castDao = (D) dao;
		return castDao;
	}
669016
public static void unregisterDao(ConnectionSource connectionSource,
			Class<?> clazz) {

		Dao<?, ?> dao = DaoManager.lookupDao(connectionSource, clazz);
		if (dao != null) {
			DaoManager.unregisterDao(connectionSource, dao);
		}

	}
202323
@Override
    public Object find(Class entityClass, Object key)
    {

        EntityMetadata entityMetadata = KunderaMetadataManager.getEntityMetadata(kunderaMetadata, entityClass);

        Object e = r.db(entityMetadata.getSchema()).table(entityMetadata.getTableName()).get(key).run(connection,
                entityClass);

        PropertyAccessorHelper.setId(e, entityMetadata, key);

        return e;
    }
21132
public Object[] findIdsByColumn(String schemaName, String tableName, String pKeyName, String columnName,
            Object columnValue, Class entityClazz)
    {
        // TODO Auto-generated method stub
        return null;
    }
324418
private static <D, T> D createDaoFromConfig(ConnectionSource connectionSource, Class<T> clazz) throws SQLException {
		// no loaded configs
		if (configMap == null) {
			return null;
		}

		@SuppressWarnings("unchecked")
		DatabaseTableConfig<T> config = (DatabaseTableConfig<T>) configMap.get(clazz);
		// if we don't config information cached return null
		if (config == null) {
			return null;
		}

		// else create a DAO using configuration
		Dao<T, ?> configedDao = doCreateDao(connectionSource, config);
		@SuppressWarnings("unchecked")
		D castDao = (D) configedDao;
		return castDao;
	}