it.eng.spagobi.mapcatalogue.bo.dao.hibernate
Class SbiGeoMapsDAOHibImpl

java.lang.Object
  extended by it.eng.spagobi.mapcatalogue.bo.dao.hibernate.AbstractHibernateDAO
      extended by it.eng.spagobi.mapcatalogue.bo.dao.hibernate.SbiGeoMapsDAOHibImpl
All Implemented Interfaces:
ISbiGeoMapsDAO

public class SbiGeoMapsDAOHibImpl
extends AbstractHibernateDAO
implements ISbiGeoMapsDAO

Author:
giachino

Constructor Summary
SbiGeoMapsDAOHibImpl()
           
 
Method Summary
 void eraseMap(GeoMap aMap)
          Implements the query to erase a map.
 java.util.List getFeaturesFromSVG(java.lang.String url)
          Gets the features (tag ) from the SVG File.
 boolean hasFeaturesAssociated(java.lang.String mapId)
          Tells if a map is associated to any Features.
 void insertMap(GeoMap aMap)
          Implements the query to insert a map.
 java.util.List loadAllMaps()
          Loads all detail information for all maps.
 GeoMap loadMapByID(java.lang.Integer mapID)
          Loads all detail information for a map identified by its mapID.
 GeoMap loadMapByName(java.lang.String name)
          Loads all detail information for maps whose name is equal to name.
 void modifyMap(GeoMap aMap)
          Implements the query to modify a map.
 GeoMap toGeoMap(SbiGeoMaps hibMap)
          From the Hibernate Map object at input, gives the corrispondent GeoMap object.
 
Methods inherited from class it.eng.spagobi.mapcatalogue.bo.dao.hibernate.AbstractHibernateDAO
getSession, logException
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SbiGeoMapsDAOHibImpl

public SbiGeoMapsDAOHibImpl()
Method Detail

loadMapByID

public GeoMap loadMapByID(java.lang.Integer mapID)
                   throws it.eng.spago.error.EMFUserError
Description copied from interface: ISbiGeoMapsDAO
Loads all detail information for a map identified by its mapID. All these information, achived by a query to the DB, are stored into an map object, which is returned.

Specified by:
loadMapByID in interface ISbiGeoMapsDAO
Parameters:
mapID - The id for the map to load
Returns:
An map object containing all loaded information
Throws:
it.eng.spago.error.EMFUserError - If an Exception occurred
See Also:
it.eng.spagobi.geo.bo.dao.ISbiGeoMapsDAO#loadMapByID(integer)

loadMapByName

public GeoMap loadMapByName(java.lang.String name)
                     throws it.eng.spago.error.EMFUserError
Description copied from interface: ISbiGeoMapsDAO
Loads all detail information for maps whose name is equal to name.

Specified by:
loadMapByName in interface ISbiGeoMapsDAO
Parameters:
name - The name for the map to load
Returns:
An map object containing all loaded information
Throws:
it.eng.spago.error.EMFUserError - If an Exception occurred
See Also:
it.eng.spagobi.geo.bo.dao.ISbiGeoMapsDAO#loadMapByName(string)

modifyMap

public void modifyMap(GeoMap aMap)
               throws it.eng.spago.error.EMFUserError
Description copied from interface: ISbiGeoMapsDAO
Implements the query to modify a map. All information needed is stored into the input map object.

Specified by:
modifyMap in interface ISbiGeoMapsDAO
Parameters:
aMap - The object containing all modify information
Throws:
it.eng.spago.error.EMFUserError - If an Exception occurred
See Also:
it.eng.spagobi.geo.bo.dao.IEngineDAO#modifyEngine(it.eng.spagobi.bo.Engine)

insertMap

public void insertMap(GeoMap aMap)
               throws it.eng.spago.error.EMFUserError
Description copied from interface: ISbiGeoMapsDAO
Implements the query to insert a map. All information needed is stored into the input map object.

Specified by:
insertMap in interface ISbiGeoMapsDAO
Parameters:
aMap - The object containing all insert information
Throws:
it.eng.spago.error.EMFUserError - If an Exception occurred
See Also:
it.eng.spagobi.geo.bo.dao.IEngineDAO#insertEngine(it.eng.spagobi.bo.Engine)

eraseMap

public void eraseMap(GeoMap aMap)
              throws it.eng.spago.error.EMFUserError
Description copied from interface: ISbiGeoMapsDAO
Implements the query to erase a map. All information needed is stored into the input map object.

Specified by:
eraseMap in interface ISbiGeoMapsDAO
Parameters:
aMap - The object containing all delete information
Throws:
it.eng.spago.error.EMFUserError - If an Exception occurred
See Also:
it.eng.spagobi.geo.bo.dao.IEngineDAO#eraseEngine(it.eng.spagobi.bo.Engine)

loadAllMaps

public java.util.List loadAllMaps()
                           throws it.eng.spago.error.EMFUserError
Description copied from interface: ISbiGeoMapsDAO
Loads all detail information for all maps. For each of them, detail information is stored into an map object. After that, all maps are stored into a List, which is returned.

Specified by:
loadAllMaps in interface ISbiGeoMapsDAO
Returns:
A list containing all map objects
Throws:
it.eng.spago.error.EMFUserError - If an Exception occurred
See Also:
it.eng.spagobi.geo.bo.dao.IEngineDAO#loadAllEngines()

hasFeaturesAssociated

public boolean hasFeaturesAssociated(java.lang.String mapId)
                              throws it.eng.spago.error.EMFUserError
Description copied from interface: ISbiGeoMapsDAO
Tells if a map is associated to any Features. It is useful because a map cannot be deleted if it is used by one or more BI Features.

Specified by:
hasFeaturesAssociated in interface ISbiGeoMapsDAO
Parameters:
mapId - The map identifier
Returns:
True if the map is used by one or more objects, else false
Throws:
it.eng.spago.error.EMFUserError - If any exception occurred
See Also:
it.eng.spagobi.geo.bo.dao.ISbiGeoMapsDAO#hasFeaturesAssociated(java.lang.String)

getFeaturesFromSVG

public java.util.List getFeaturesFromSVG(java.lang.String url)
                                  throws java.lang.Exception
Gets the features (tag ) from the SVG File.

Specified by:
getFeaturesFromSVG in interface ISbiGeoMapsDAO
Parameters:
url - The relative url about svg file
Throws:
java.lang.Exception - raised If there are some problems

toGeoMap

public GeoMap toGeoMap(SbiGeoMaps hibMap)
From the Hibernate Map object at input, gives the corrispondent GeoMap object.

Parameters:
hibMap - The Hibernate Map object
recoverFeatures - If true the GeoMap at output will have the list of contained GeoFeatures objects
Returns:
the corrispondent output GeoMap