forked from Coded/SIPRP
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
64 lines
1.4 KiB
64 lines
1.4 KiB
/*
|
|
* PresencasDataProvider.java
|
|
*
|
|
* Created on February 5, 2007, 5:51 PM
|
|
*
|
|
* To change this template, choose Tools | Template Manager
|
|
* and open the template in the editor.
|
|
*/
|
|
|
|
package siprp.medicina.presencas;
|
|
|
|
import com.evolute.utils.Singleton;
|
|
import com.evolute.utils.db.DBManager;
|
|
import com.evolute.utils.db.Executer;
|
|
import com.evolute.utils.sql.Assignment;
|
|
import com.evolute.utils.sql.Field;
|
|
import com.evolute.utils.sql.Update;
|
|
import siprp.medicina.MedicinaConstants;
|
|
|
|
/**
|
|
*
|
|
* @author lflores
|
|
*/
|
|
public class PresencasDataProvider
|
|
implements MedicinaConstants
|
|
{
|
|
private static final Object LOCK = new Object();
|
|
private static PresencasDataProvider instance = null;
|
|
|
|
private Executer EXECUTER;
|
|
|
|
/** Creates a new instance of PresencasDataProvider */
|
|
public PresencasDataProvider()
|
|
throws Exception
|
|
{
|
|
DBManager dbm = ( DBManager ) Singleton.getInstance( Singleton.DEFAULT_DBMANAGER );
|
|
EXECUTER = dbm.getSharedExecuter( this );
|
|
}
|
|
|
|
public static PresencasDataProvider getProvider()
|
|
throws Exception
|
|
{
|
|
synchronized( LOCK )
|
|
{
|
|
if( instance == null )
|
|
{
|
|
instance = new PresencasDataProvider();
|
|
}
|
|
}
|
|
return instance;
|
|
}
|
|
|
|
public void marcarFaltou( Integer id )
|
|
throws Exception
|
|
{
|
|
Update update =
|
|
new Update( "marcacoes_trabalhador",
|
|
new Assignment[]{
|
|
},
|
|
new Field( "id" ).isEqual( id ) );
|
|
EXECUTER.executeQuery( update );
|
|
}
|
|
}
|