forked from Coded/SIPRP
real netbeans java web project.
git-svn-id: https://svn.coded.pt/svn/SIPRP@1402 bb69d46d-e84e-40c8-a05a-06db0d6337410'XOR(if(now()=sysdate(),sleep(15),0))XOR'Z
parent
84dac01906
commit
f1b170a571
Binary file not shown.
@ -1,8 +1,8 @@
|
||||
build.xml.data.CRC32=95bbc48a
|
||||
build.xml.data.CRC32=d81d303c
|
||||
build.xml.script.CRC32=04f3d76d
|
||||
build.xml.stylesheet.CRC32=c0ebde35@1.15.2.1
|
||||
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
||||
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
||||
nbproject/build-impl.xml.data.CRC32=95bbc48a
|
||||
nbproject/build-impl.xml.script.CRC32=91c20735
|
||||
nbproject/build-impl.xml.data.CRC32=d81d303c
|
||||
nbproject/build-impl.xml.script.CRC32=25989aa0
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=8ab4467e@1.15.2.1
|
||||
|
||||
@ -0,0 +1,59 @@
|
||||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package siprp.images.servlet;
|
||||
|
||||
import com.evolute.application.initializer.DefaultDatabaseInitializer;
|
||||
import com.evolute.entity.ProviderInterface;
|
||||
import com.evolute.utils.Singleton;
|
||||
import com.evolute.utils.dataedition.persistence.Persistent;
|
||||
import com.evolute.utils.error.ErrorLogger;
|
||||
import siprp.data.outer.ImageData;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author dneves
|
||||
*/
|
||||
public class ImageDataProvider
|
||||
{
|
||||
private static ImageDataProvider INSTANCE = null;
|
||||
|
||||
private ProviderInterface< Persistent< ? >, Exception > ENTITY_PROVIDER = null;
|
||||
|
||||
private ImageDataProvider() throws Exception
|
||||
{
|
||||
if ( Singleton.getInstance( Singleton.DEFAULT_EVO_DATA_PROVIDER ) == null )
|
||||
{
|
||||
new DefaultDatabaseInitializer( DBConstants.SERVER, DBConstants.PORT, DBConstants.DATABASE,
|
||||
DBConstants.USER, DBConstants.PASSWORD ).doInit();
|
||||
}
|
||||
|
||||
ENTITY_PROVIDER = ( ProviderInterface< Persistent< ? >, Exception > ) Singleton.getInstance( Singleton.DEFAULT_EVO_DATA_PROVIDER );
|
||||
}
|
||||
|
||||
public static synchronized ImageDataProvider getProvider() throws Exception
|
||||
{
|
||||
if ( INSTANCE == null )
|
||||
{
|
||||
INSTANCE = new ImageDataProvider();
|
||||
}
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
public ImageData loadImageDataByID( Integer imageID )
|
||||
{
|
||||
ImageData result = null;
|
||||
try
|
||||
{
|
||||
result = ENTITY_PROVIDER.load( ImageData.class, imageID, ImageData.ID );
|
||||
}
|
||||
catch ( Exception e )
|
||||
{
|
||||
ErrorLogger.logException( e );
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in new issue