當前位置: 首頁>>代碼示例>>Java>>正文


Java DatabaseMeta.setChanged方法代碼示例

本文整理匯總了Java中org.pentaho.di.core.database.DatabaseMeta.setChanged方法的典型用法代碼示例。如果您正苦於以下問題:Java DatabaseMeta.setChanged方法的具體用法?Java DatabaseMeta.setChanged怎麽用?Java DatabaseMeta.setChanged使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.pentaho.di.core.database.DatabaseMeta的用法示例。


在下文中一共展示了DatabaseMeta.setChanged方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: clearChanged

import org.pentaho.di.core.database.DatabaseMeta; //導入方法依賴的package包/類
public void clearChanged() {
	changedEntries = false;
	changedHops = false;
	changedNotes = false;
	changedDatabases = false;

	for (int i = 0; i < nrJobEntries(); i++) {
		JobEntryCopy entry = getJobEntry(i);
		entry.setChanged(false);
	}
	for (JobHopMeta hi : jobhops) // Look at all the hops
	{
		hi.setChanged(false);
	}
	for (int i = 0; i < nrDatabases(); i++) {
		DatabaseMeta db = getDatabase(i);
		db.setChanged(false);
	}
	for (int i = 0; i < nrNotes(); i++) {
		NotePadMeta note = getNote(i);
		note.setChanged(false);
	}
	super.clearChanged();
}
 
開發者ID:icholy,項目名稱:geokettle-2.0,代碼行數:25,代碼來源:JobMeta.java

示例2: readDatabases

import org.pentaho.di.core.database.DatabaseMeta; //導入方法依賴的package包/類
public void readDatabases(Repository rep, boolean overWriteShared) throws KettleException {
	try {
		long dbids[] = rep.getDatabaseIDs();
		for (int i = 0; i < dbids.length; i++) {
			DatabaseMeta databaseMeta = RepositoryUtil.loadDatabaseMeta(rep, dbids[i]);
			databaseMeta.shareVariablesWith(this);

			DatabaseMeta check = findDatabase(databaseMeta.getName()); // Check
																		// if
																		// there
																		// already
																		// is
																		// one
																		// in
																		// the
			// transformation
			if (check == null || overWriteShared) // We only add, never
													// overwrite database
													// connections.
			{
				if (databaseMeta.getName() != null) {
					addOrReplaceDatabase(databaseMeta);
					if (!overWriteShared)
						databaseMeta.setChanged(false);
				}
			}
		}
		setChanged(false);
	} catch (KettleDatabaseException dbe) {
		throw new KettleException(Messages.getString("JobMeta.Log.UnableToReadDatabaseIDSFromRepository"), dbe); //$NON-NLS-1$
	} catch (KettleException ke) {
		throw new KettleException(Messages.getString("JobMeta.Log.UnableToReadDatabasesFromRepository"), ke); //$NON-NLS-1$
	}
}
 
開發者ID:icholy,項目名稱:geokettle-2.0,代碼行數:35,代碼來源:JobMeta.java

示例3: readDatabases

import org.pentaho.di.core.database.DatabaseMeta; //導入方法依賴的package包/類
public void readDatabases(Repository rep, boolean overWriteShared) throws KettleException
{
    try
    {
        long dbids[] = rep.getDatabaseIDs();
        for (int i = 0; i < dbids.length; i++)
        {
            DatabaseMeta databaseMeta = RepositoryUtil.loadDatabaseMeta(rep, dbids[i]);
            databaseMeta.shareVariablesWith(this);
            
            DatabaseMeta check = findDatabase(databaseMeta.getName()); // Check if there already is one in the transformation
            if (check==null || overWriteShared) // We only add, never overwrite database connections. 
            {
                if (databaseMeta.getName() != null)
                {
                    addOrReplaceDatabase(databaseMeta);
                    if (!overWriteShared) databaseMeta.setChanged(false);
                }
            }
        }
        changed_databases = false;
    }
    catch (KettleDatabaseException dbe)
    {
        throw new KettleException(Messages.getString("TransMeta.Log.UnableToReadDatabaseIDSFromRepository"), dbe); //$NON-NLS-1$
    }
    catch (KettleException ke)
    {
        throw new KettleException(Messages.getString("TransMeta.Log.UnableToReadDatabasesFromRepository"), ke); //$NON-NLS-1$
    }
}
 
開發者ID:icholy,項目名稱:geokettle-2.0,代碼行數:32,代碼來源:TransMeta.java

示例4: readDatabases

import org.pentaho.di.core.database.DatabaseMeta; //導入方法依賴的package包/類
/**
 * Read the database connections in the repository and add them to this job
 * if they are not yet present.
 * 
 * @param jobMeta the job to put the database connections in
 * @param overWriteShared set to true if you want to overwrite shared connections while loading.
 * @throws KettleException
 */
public void readDatabases(JobMeta jobMeta, boolean overWriteShared) throws KettleException {
	try {
		ObjectId dbids[] = repository.getDatabaseIDs(false);
		for (int i = 0; i < dbids.length; i++) {
			DatabaseMeta databaseMeta = repository.loadDatabaseMeta(dbids[i], null); // reads last version
			databaseMeta.shareVariablesWith(jobMeta);

			// See if there already is one in the transformation
			//
			DatabaseMeta check = jobMeta.findDatabase(databaseMeta.getName());
			
			// We only add, never overwrite database connections.
			//
			if (check == null || overWriteShared) 
			{
				if (databaseMeta.getName() != null) {
					jobMeta.addOrReplaceDatabase(databaseMeta);
					if (!overWriteShared)
						databaseMeta.setChanged(false);
				}
			}
		}
		jobMeta.setChanged(false);
	} catch (KettleDatabaseException dbe) {
		throw new KettleException(BaseMessages.getString(PKG, "JobMeta.Log.UnableToReadDatabaseIDSFromRepository"), dbe); //$NON-NLS-1$
	} catch (KettleException ke) {
		throw new KettleException(BaseMessages.getString(PKG, "JobMeta.Log.UnableToReadDatabasesFromRepository"), ke); //$NON-NLS-1$
	}
}
 
開發者ID:yintaoxue,項目名稱:read-open-source-code,代碼行數:38,代碼來源:KettleDatabaseRepositoryJobDelegate.java

示例5: readDatabases

import org.pentaho.di.core.database.DatabaseMeta; //導入方法依賴的package包/類
/**
 * Read all the databases from the repository, insert into the TransMeta object, overwriting optionally
 * 
 * @param TransMeta The transformation to load into.
 * @param overWriteShared if an object with the same name exists, overwrite
 * @throws KettleException 
 */
public void readDatabases(TransMeta transMeta, boolean overWriteShared) throws KettleException
{
    try
    {
        ObjectId dbids[] = repository.getDatabaseIDs(false);
        for (int i = 0; i < dbids.length; i++)
        {
            DatabaseMeta databaseMeta = repository.loadDatabaseMeta(dbids[i], null); // reads last version
            databaseMeta.shareVariablesWith(transMeta);
            
            DatabaseMeta check = transMeta.findDatabase(databaseMeta.getName()); // Check if there already is one in the transformation
            if (check==null || overWriteShared) // We only add, never overwrite database connections. 
            {
                if (databaseMeta.getName() != null)
                {
             	   transMeta.addOrReplaceDatabase(databaseMeta);
                    if (!overWriteShared) databaseMeta.setChanged(false);
                }
            }
        }
        transMeta.clearChangedDatabases();
    }
    catch (KettleDatabaseException dbe)
    {
        throw new KettleException(BaseMessages.getString(PKG, "TransMeta.Log.UnableToReadDatabaseIDSFromRepository"), dbe); //$NON-NLS-1$
    }
    catch (KettleException ke)
    {
        throw new KettleException(BaseMessages.getString(PKG, "TransMeta.Log.UnableToReadDatabasesFromRepository"), ke); //$NON-NLS-1$
    }
}
 
開發者ID:yintaoxue,項目名稱:read-open-source-code,代碼行數:39,代碼來源:KettleDatabaseRepositoryTransDelegate.java

示例6: readDatabases

import org.pentaho.di.core.database.DatabaseMeta; //導入方法依賴的package包/類
/**
 * Read all the databases from the repository, insert into the has databases object, overwriting optionally
 * 
 * @param TransMeta The transformation to load into.
 * @param overWriteShared if an object with the same name exists, overwrite
 * @throws KettleException 
 */
public void readDatabases(HasDatabasesInterface transMeta, boolean overWriteShared) throws KettleException
{
    try
    {
        ObjectId dbids[] = getDatabaseIDs(false);
        for (int i = 0; i < dbids.length; i++)
        {
            DatabaseMeta databaseMeta = loadDatabaseMeta(dbids[i], null); // reads last version
            if (transMeta instanceof VariableSpace) {
              databaseMeta.shareVariablesWith((VariableSpace)transMeta);
            }
            
            DatabaseMeta check = transMeta.findDatabase(databaseMeta.getName()); // Check if there already is one in the transformation
            if (check==null || overWriteShared) // We only add, never overwrite database connections. 
            {
                if (databaseMeta.getName() != null)
                {
                  transMeta.addOrReplaceDatabase(databaseMeta);
                    if (!overWriteShared) databaseMeta.setChanged(false);
                }
            }
        }
    }
    catch (KettleException e)
    {
        throw e;
    }
}
 
開發者ID:yintaoxue,項目名稱:read-open-source-code,代碼行數:36,代碼來源:KettleFileRepository.java

示例7: saveConnection

import org.pentaho.di.core.database.DatabaseMeta; //導入方法依賴的package包/類
public void saveConnection(DatabaseMeta db, String versionComment)
{
	// Also add to repository?
	Repository rep = spoon.getRepository();

	if (rep != null)
	{
		if (!rep.getSecurityProvider().isReadOnly())
		{
			try
			{
				
				if (Const.isEmpty(versionComment)) {
					rep.insertLogEntry("Saving database '" + db.getName() + "'");
				} else {
					rep.insertLogEntry("Save database : "+versionComment);
				}
				rep.save(db, versionComment, null);
				spoon.getLog().logDetailed( BaseMessages.getString(PKG, "Spoon.Log.SavedDatabaseConnection", db.getDatabaseName()));

				db.setChanged(false);
			} catch (KettleException ke)
			{
				new ErrorDialog(spoon.getShell(), BaseMessages.getString(PKG, "Spoon.Dialog.ErrorSavingConnection.Title"), BaseMessages.getString(PKG, "Spoon.Dialog.ErrorSavingConnection.Message", db.getDatabaseName()), ke);
			} 
		} else
		{
			// This repository user is read-only!
			//
			new ErrorDialog(
					spoon.getShell(),
					BaseMessages.getString(PKG, "Spoon.Dialog.UnableSave.Title"),
					BaseMessages.getString(PKG, "Spoon.Dialog.ErrorSavingConnection.Message", db.getDatabaseName()),
					new KettleException(BaseMessages.getString(PKG, "Spoon.Dialog.Exception.ReadOnlyRepositoryUser")));
		}
	}
}
 
開發者ID:yintaoxue,項目名稱:read-open-source-code,代碼行數:38,代碼來源:SpoonDBDelegate.java

示例8: saveConnection

import org.pentaho.di.core.database.DatabaseMeta; //導入方法依賴的package包/類
public void saveConnection(DatabaseMeta db)
{
	// Also add to repository?
	Repository rep = spoon.getRepository();

	if (rep != null)
	{
		if (!rep.userinfo.isReadonly())
		{
			try
			{
				rep.lockRepository();
				rep.insertLogEntry("Saving database '" + db.getName() + "'");

				RepositoryUtil.saveDatabaseMeta(db, rep);
				spoon.getLog().logDetailed(toString(),
						Messages.getString("Spoon.Log.SavedDatabaseConnection", db.getDatabaseName()));

				// Put a commit behind it!
				rep.commit();

				db.setChanged(false);
			} catch (KettleException ke)
			{
				rep.rollback(); // In case of failure: undo changes!
				new ErrorDialog(spoon.getShell(), Messages.getString("Spoon.Dialog.ErrorSavingConnection.Title"), Messages.getString("Spoon.Dialog.ErrorSavingConnection.Message", db.getDatabaseName()), ke);
			} 
			finally
			{
				try
				{
					rep.unlockRepository();
				} catch (KettleException e)
				{
					new ErrorDialog(spoon.getShell(), "Error",
							"Unexpected error unlocking the repository database", e);
				}

			}
		} else
		{
			new ErrorDialog(
					spoon.getShell(),
					Messages.getString("Spoon.Dialog.UnableSave.Title"),
					Messages.getString("Spoon.Dialog.ErrorSavingConnection.Message", db.getDatabaseName()),
					new KettleException(Messages.getString("Spoon.Dialog.Exception.ReadOnlyRepositoryUser")));// This
			// repository
			// user
			// is
			// read-only!
		}
	}
}
 
開發者ID:icholy,項目名稱:geokettle-2.0,代碼行數:54,代碼來源:SpoonDBDelegate.java


注:本文中的org.pentaho.di.core.database.DatabaseMeta.setChanged方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。