Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  * Copyright 2014 Christophe Pollet
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
  *     http://www.apache.org/licenses/LICENSE-2.0
  *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package net.cpollet.jixture.fixtures;
Load data from SQL queries.

Author(s):
Christophe Pollet
public class SqlFixture implements RawFixtureCleanableFixture {
	private String[] queries;

Parameters:
queries SQL queries to execute.
	public SqlFixture(String[] queries) {
		this. = queries;
	}

Parameters:
queries SQL queries to execute.
classes mapping classes representing the tables to truncate before executing the SQL queries.
	public SqlFixture(String[] queriesClass... classes) {
		this. = new CleaningFixture(classes);
		this. = queries;
	}

Returns an ordered iterator of mapping classes to delete from database.

Returns:
an ordered iterator of mapping classes to delete from database.
	}

Execute the SQL queries.

Parameters:
unitDaoFactory the net.cpollet.jixture.dao.UnitDaoFactory to use.
	public void load(UnitDaoFactory unitDaoFactory) {
		for (String query : ) {
			unitDaoFactory.getUnitDao().execute(query);
		}
	}
New to GrepCode? Check out our FAQ X