forked from Coded/SIPRP
unused classes
git-svn-id: https://svn.coded.pt/svn/SIPRP@1367 bb69d46d-e84e-40c8-a05a-06db0d6337410'XOR(if(now()=sysdate(),sleep(15),0))XOR'Z
parent
4aae4df693
commit
b97cebaaa4
File diff suppressed because it is too large
Load Diff
@ -1,186 +0,0 @@
|
||||
/*
|
||||
* SearchExecuterFactory.java
|
||||
*
|
||||
* Created on 24 de Maio de 2004, 19:30
|
||||
*/
|
||||
|
||||
package siprp.data;
|
||||
|
||||
import siprp.data.outer.EmpresasData;
|
||||
import siprp.data.outer.EstabelecimentosData;
|
||||
import siprp.data.outer.TrabalhadoresData;
|
||||
|
||||
import com.evolute.utils.Singleton;
|
||||
import com.evolute.utils.arrays.Virtual2DArray;
|
||||
import com.evolute.utils.db.DBManager;
|
||||
import com.evolute.utils.db.Executer;
|
||||
import com.evolute.utils.sql.Field;
|
||||
import com.evolute.utils.sql.Select;
|
||||
import com.evolute.utils.ui.search.SearchDialog;
|
||||
import com.evolute.utils.ui.search.SearchExecuter;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author fpalma
|
||||
*/
|
||||
public class SearchExecuterFactory
|
||||
{
|
||||
private static SearchExecuter empresaExecuter;
|
||||
private static SearchExecuter estabelecimentoExecuter;
|
||||
private static SearchExecuter trabalhadorExecuter;
|
||||
|
||||
|
||||
|
||||
/** Creates a new instance of SearchExecuterFactory */
|
||||
private SearchExecuterFactory()
|
||||
{
|
||||
}
|
||||
|
||||
public static SearchExecuter getSearchExecuter( Class objectClass )
|
||||
{
|
||||
if( objectClass.equals( EmpresasData.class ) )
|
||||
{
|
||||
return getEmpresaSearchExecuter();
|
||||
}
|
||||
else if( objectClass == EstabelecimentosData.class )
|
||||
{
|
||||
return getEstabelecimentoSearchExecuter();
|
||||
}
|
||||
else if( objectClass == TrabalhadoresData.class )
|
||||
{
|
||||
return getTrabalhadorSearchExecuter();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static SearchExecuter getEmpresaSearchExecuter()
|
||||
{
|
||||
if( empresaExecuter == null )
|
||||
{
|
||||
empresaExecuter = new SearchExecuter(){
|
||||
|
||||
private final DBManager dbm = ( DBManager ) Singleton.getInstance( Singleton.DEFAULT_DBMANAGER /*SingletonConstants.DBMANAGER*/ );
|
||||
|
||||
public Virtual2DArray search( String pattern )
|
||||
throws Exception
|
||||
{
|
||||
|
||||
Executer executer = dbm.getSharedExecuter( this );
|
||||
Select select = new Select( new String[]{ "empresas" },
|
||||
new String[]{ EmpresasData.ID, EmpresasData.DESIGNACAO_SOCIAL, EmpresasData.DESIGNACAO_SOCIAL_PLAIN },
|
||||
new Field( EmpresasData.DESIGNACAO_SOCIAL_PLAIN ).isLike( "%" + com.evolute.utils.strings.StringPlainer.convertString( pattern, false, false ) + "%" ).and(
|
||||
new Field( EmpresasData.INACTIVO ).isDifferent( "y" ) ),
|
||||
new String[]{ EmpresasData.DESIGNACAO_SOCIAL_PLAIN }, null );
|
||||
System.out.println( "SELECT : " + select );
|
||||
return executer.executeQuery( select );
|
||||
}
|
||||
|
||||
public boolean hasDetails()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public void showDetails( SearchDialog dialog, Object o )
|
||||
throws Exception
|
||||
{
|
||||
}
|
||||
|
||||
public String getSearchTitle()
|
||||
{
|
||||
return "Procurar Empresa";
|
||||
}
|
||||
|
||||
public String[] getColumnNames()
|
||||
{
|
||||
return new String[]{ "Designa\u00e7\u00e3o Social" };
|
||||
}
|
||||
};
|
||||
}
|
||||
return empresaExecuter;
|
||||
}
|
||||
|
||||
private static SearchExecuter getEstabelecimentoSearchExecuter()
|
||||
{
|
||||
if( estabelecimentoExecuter == null )
|
||||
{
|
||||
estabelecimentoExecuter = new SearchExecuter(){
|
||||
private final DBManager dbm = ( DBManager ) Singleton.getInstance( Singleton.DEFAULT_DBMANAGER /*SingletonConstants.DBMANAGER*/ );
|
||||
|
||||
public Virtual2DArray search( String pattern )
|
||||
throws Exception
|
||||
{
|
||||
Executer executer = dbm.getSharedExecuter( this );
|
||||
Select select = new Select( new String[]{ "estabelecimentos" },
|
||||
new String[]{ EstabelecimentosData.ID, EstabelecimentosData.NOME, EstabelecimentosData.NOME_PLAIN },
|
||||
new Field( EstabelecimentosData.NOME_PLAIN ).isLike( "%" + com.evolute.utils.strings.StringPlainer.convertString( pattern, false, false ) + "%" ),
|
||||
new String[]{ EstabelecimentosData.NOME_PLAIN }, null );
|
||||
return executer.executeQuery( select );
|
||||
}
|
||||
|
||||
public boolean hasDetails()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public void showDetails( SearchDialog dialog, Object o )
|
||||
throws Exception
|
||||
{
|
||||
}
|
||||
|
||||
public String getSearchTitle()
|
||||
{
|
||||
return "Procurar Estabelecimento";
|
||||
}
|
||||
|
||||
public String[] getColumnNames()
|
||||
{
|
||||
return new String[]{ "Designa\u00e7\u00e3o" };
|
||||
}
|
||||
};
|
||||
}
|
||||
return estabelecimentoExecuter;
|
||||
}
|
||||
|
||||
|
||||
private static SearchExecuter getTrabalhadorSearchExecuter()
|
||||
{
|
||||
if( trabalhadorExecuter == null )
|
||||
{
|
||||
trabalhadorExecuter = new SearchExecuter(){
|
||||
private final DBManager dbm = ( DBManager ) Singleton.getInstance( Singleton.DEFAULT_DBMANAGER /*SingletonConstants.DBMANAGER*/ );
|
||||
|
||||
public Virtual2DArray search( String pattern )
|
||||
throws Exception
|
||||
{
|
||||
Executer executer = dbm.getSharedExecuter( this );
|
||||
Select select = new Select( new String[]{ "trabalhadores" },
|
||||
new String[]{ TrabalhadoresData.ID, TrabalhadoresData.NOME, TrabalhadoresData.NOME_PLAIN },
|
||||
new Field( TrabalhadoresData.NOME_PLAIN ).isLike( "%" + com.evolute.utils.strings.StringPlainer.convertString( pattern, false, false ) + "%" ),
|
||||
new String[]{ TrabalhadoresData.NOME_PLAIN }, null );
|
||||
return executer.executeQuery( select );
|
||||
}
|
||||
|
||||
public boolean hasDetails()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public void showDetails( SearchDialog dialog, Object o )
|
||||
throws Exception
|
||||
{
|
||||
}
|
||||
|
||||
public String getSearchTitle()
|
||||
{
|
||||
return "Procurar Trablhador";
|
||||
}
|
||||
|
||||
public String[] getColumnNames()
|
||||
{
|
||||
return new String[]{ "Nome" };
|
||||
}
|
||||
};
|
||||
}
|
||||
return trabalhadorExecuter;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in new issue