Omaha #3454 Upgrading to Hibernate 4.2.15

Change-Id: I4ab0970abf9755f69e09ad3d9c79084b76761c29

Former-commit-id: 293e59403b6d6e1d792d9fc6d8a0ac106a490bf5
This commit is contained in:
Benjamin Phillippe 2014-10-16 10:50:22 -05:00
parent 0c5f1c0f78
commit fdd16051e8
59 changed files with 301 additions and 270 deletions

View file

@ -31,7 +31,7 @@
org.postgresql.Driver
</property>
<property name="dialect">
org.hibernatespatial.postgis.PostgisDialect
org.hibernate.spatial.dialect.postgis.PostgisDialect
</property>
<property name="connection.url">
jdbc:postgresql://${db.addr}:${db.port}/maps

View file

@ -31,7 +31,7 @@
org.postgresql.Driver
</property>
<property name="dialect">
org.hibernatespatial.postgis.PostgisDialect
org.hibernate.spatial.dialect.postgis.PostgisDialect
</property>
<property name="connection.url">
jdbc:postgresql://${db.addr}:${db.port}/metadata

View file

@ -37,7 +37,7 @@
</bean>
<bean id="metadataTxManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
class="org.springframework.orm.hibernate4.HibernateTransactionManager">
<property name="sessionFactory" ref="metadataSessionFactory" />
</bean>
@ -55,7 +55,7 @@
</bean>
<bean id="mapsTxManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
class="org.springframework.orm.hibernate4.HibernateTransactionManager">
<property name="sessionFactory" ref="mapsSessionFactory" />
</bean>

View file

@ -59,6 +59,7 @@ import com.raytheon.uf.edex.plugin.grid.dao.GridDao;
* where query for T (T%hr) returned TP6hr
* Jun 13, 2013 2044 randerso Cleaned up JavaDoc
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
*
* </pre>
*
@ -130,7 +131,7 @@ public class GFED2DDao extends GridDao {
Session s = null;
try {
s = getHibernateTemplate().getSessionFactory().openSession();
s = getSession();
// TODO: clean up so we only make one db query
SortedMap<Integer, Integer> rawTimes = queryByParmId(d2dModelName,
refTime, d2dParmName, d2dLevel, s);
@ -150,7 +151,7 @@ public class GFED2DDao extends GridDao {
try {
s.close();
} catch (Exception e) {
statusHandler.error(
logger.error(
"Error occurred closing database session", e);
}
}
@ -278,7 +279,7 @@ public class GFED2DDao extends GridDao {
List<Integer> timeList = new ArrayList<Integer>();
Session s = null;
try {
s = getHibernateTemplate().getSessionFactory().openSession();
s = getSession();
SortedMap<Integer, Integer> results = queryByParmId(d2dModelName,
refTime, d2dParmName, d2dLevel, s);
@ -290,7 +291,7 @@ public class GFED2DDao extends GridDao {
try {
s.close();
} catch (Exception e) {
statusHandler.error(
logger.error(
"Error occurred closing database session", e);
}
}

View file

@ -106,6 +106,7 @@ import com.raytheon.uf.edex.database.query.DatabaseQuery;
* 10/15/2013 #2446 randerso Added ORDER BY clause to getOverlappingTimes
* 06/12/14 #3244 randerso Improved error handling
* 09/21/2014 #3648 randerso Changed to do version purging when new databases are added
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
*
* </pre>
*
@ -153,7 +154,7 @@ public class GFEDao extends DefaultPluginDao {
Session sess = null;
try {
sess = getHibernateTemplate().getSessionFactory().openSession();
sess = getSession();
sess.setDefaultReadOnly(true);
int tries = 0;
Transaction tx = null;
@ -202,7 +203,7 @@ public class GFEDao extends DefaultPluginDao {
try {
sess.close();
} catch (Exception e) {
statusHandler.error(
logger.error(
"Error occurred closing database session", e);
}
}
@ -242,7 +243,7 @@ public class GFEDao extends DefaultPluginDao {
Transaction tx = null;
try {
sess = getHibernateTemplate().getSessionFactory().openSession();
sess = getSession();
sess.setDefaultReadOnly(true);
tx = sess.beginTransaction();
@ -280,7 +281,7 @@ public class GFEDao extends DefaultPluginDao {
try {
sess.close();
} catch (Exception e) {
statusHandler.error(
logger.error(
"Error occurred closing database session", e);
}
}
@ -304,8 +305,7 @@ public class GFEDao extends DefaultPluginDao {
Transaction tx = null;
try {
sess = getHibernateTemplate().getSessionFactory()
.openStatelessSession();
sess = getSessionFactory().openStatelessSession();
tx = sess.beginTransaction();
for (ParmStorageInfo psi : psiList) {
@ -331,7 +331,7 @@ public class GFEDao extends DefaultPluginDao {
try {
sess.close();
} catch (Exception e) {
statusHandler.error(
logger.error(
"Error occurred closing database session", e);
}
}
@ -351,8 +351,7 @@ public class GFEDao extends DefaultPluginDao {
Transaction tx = null;
try {
sess = getHibernateTemplate().getSessionFactory()
.openStatelessSession();
sess = getSessionFactory().openStatelessSession();
tx = sess.beginTransaction();
sess.update(psi);
tx.commit();
@ -374,7 +373,7 @@ public class GFEDao extends DefaultPluginDao {
try {
sess.close();
} catch (Exception e) {
statusHandler.error(
logger.error(
"Error occurred closing database session", e);
}
}
@ -395,7 +394,7 @@ public class GFEDao extends DefaultPluginDao {
Session sess = null;
try {
sess = getHibernateTemplate().getSessionFactory().openSession();
sess = getSession();
sess.setDefaultReadOnly(true);
// reattach so dbId doesn't requery
@ -450,7 +449,7 @@ public class GFEDao extends DefaultPluginDao {
try {
sess.close();
} catch (Exception e) {
statusHandler.error(
logger.error(
"Error occurred closing database session", e);
}
}
@ -515,18 +514,18 @@ public class GFEDao extends DefaultPluginDao {
try {
removed = txTemplate
.execute(new TransactionCallback<List<DatabaseID>>() {
@SuppressWarnings("unchecked")
@Override
public List<DatabaseID> doInTransaction(
TransactionStatus status) {
Date purgeDate = new Date(
System.currentTimeMillis()
- (REMOVED_DB_PURGE_TIME * TimeUtil.MILLIS_PER_DAY));
@SuppressWarnings("unchecked")
List<DatabaseID> removed = getHibernateTemplate()
.find("FROM DatabaseID where removedDate < ?",
purgeDate);
return removed;
return getCurrentSession()
.createQuery(
"FROM DatabaseID where removedDate < :removedDate")
.setParameter("removedDate", purgeDate)
.list();
}
});
} catch (Exception e) {
@ -555,8 +554,10 @@ public class GFEDao extends DefaultPluginDao {
return txTemplate.execute(new TransactionCallback<Integer>() {
@Override
public Integer doInTransaction(TransactionStatus status) {
return getHibernateTemplate().bulkUpdate(
"DELETE FROM DatabaseID WHERE siteId = ?", siteID);
return getCurrentSession()
.createQuery(
"DELETE FROM DatabaseID WHERE siteId = :siteId")
.setParameter("siteId", siteID).executeUpdate();
}
});
}
@ -579,8 +580,7 @@ public class GFEDao extends DefaultPluginDao {
Transaction tx = null;
try {
sess = getHibernateTemplate().getSessionFactory()
.openStatelessSession();
sess = getSessionFactory().openStatelessSession();
tx = sess.beginTransaction();
for (GFERecord rec : records) {
// TODO: Update saving a record, currently causes 2 inserts and
@ -608,7 +608,7 @@ public class GFEDao extends DefaultPluginDao {
try {
sess.close();
} catch (Exception e) {
statusHandler.error(
logger.error(
"Error occurred closing database session", e);
}
}
@ -632,8 +632,7 @@ public class GFEDao extends DefaultPluginDao {
}
try {
sess = getHibernateTemplate().getSessionFactory()
.openStatelessSession();
sess = getSessionFactory().openStatelessSession();
tx = sess.beginTransaction();
// Update insert time
@ -690,7 +689,7 @@ public class GFEDao extends DefaultPluginDao {
try {
sess.close();
} catch (Exception e) {
statusHandler.error(
logger.error(
"Error occurred closing database session", e);
}
}
@ -713,15 +712,14 @@ public class GFEDao extends DefaultPluginDao {
try {
return txTemplate
.execute(new TransactionCallback<List<DatabaseID>>() {
@SuppressWarnings("unchecked")
@Override
public List<DatabaseID> doInTransaction(
TransactionStatus status) {
@SuppressWarnings("unchecked")
List<DatabaseID> result = getHibernateTemplate()
.find("FROM DatabaseID WHERE siteId = ? AND removeddate is null",
siteId);
return result;
return getCurrentSession()
.createQuery(
"FROM DatabaseID WHERE siteId = :siteId AND removeddate is null")
.setParameter("siteId", siteId).list();
}
});
} catch (Exception e) {
@ -746,7 +744,7 @@ public class GFEDao extends DefaultPluginDao {
Transaction tx = null;
try {
sess = getHibernateTemplate().getSessionFactory().openSession();
sess = getSession();
sess.setDefaultReadOnly(true);
tx = sess.beginTransaction();
@ -776,7 +774,7 @@ public class GFEDao extends DefaultPluginDao {
try {
sess.close();
} catch (Exception e) {
statusHandler.error(
logger.error(
"Error occurred closing database session", e);
}
}
@ -801,7 +799,7 @@ public class GFEDao extends DefaultPluginDao {
try {
// stateless session so we can bulk query histories instead of once
// per record via hibernate
sess = getHibernateTemplate().getSessionFactory().openSession();
sess = getSession();
sess.setDefaultReadOnly(true);
tx = sess.beginTransaction();
@ -837,7 +835,7 @@ public class GFEDao extends DefaultPluginDao {
try {
sess.close();
} catch (Exception e) {
statusHandler.error(
logger.error(
"Error occurred closing database session", e);
}
}
@ -867,8 +865,7 @@ public class GFEDao extends DefaultPluginDao {
Transaction tx = null;
try {
sess = getHibernateTemplate().getSessionFactory()
.openStatelessSession();
sess = getSessionFactory().openStatelessSession();
tx = sess.beginTransaction();
Query query = sess
.createQuery("DELETE FROM GFERecord WHERE parmId = :parmId"
@ -878,7 +875,7 @@ public class GFEDao extends DefaultPluginDao {
int rowsDeleted = query.executeUpdate();
tx.commit();
tx = null;
statusHandler.info("Deleted " + rowsDeleted
logger.info("Deleted " + rowsDeleted
+ " records from the database.");
Map<File, Pair<List<TimeRange>, String[]>> fileMap = GfeUtil
@ -893,19 +890,19 @@ public class GFEDao extends DefaultPluginDao {
try {
dataStore.deleteGroups(groupsToDelete);
if (statusHandler.isPriorityEnabled(Priority.DEBUG)) {
statusHandler.handle(Priority.DEBUG, "Deleted: "
if (logger.isPriorityEnabled(Priority.DEBUG)) {
logger.handle(Priority.DEBUG, "Deleted: "
+ Arrays.toString(groupsToDelete) + " from "
+ hdf5File.getName());
}
} catch (Exception e) {
statusHandler.handle(Priority.WARN,
logger.handle(Priority.WARN,
"Error deleting hdf5 record(s) from file: "
+ hdf5File.getPath(), e);
}
}
} catch (Exception e) {
statusHandler.error("Error deleting database record(s) for parmId "
logger.error("Error deleting database record(s) for parmId "
+ parmId + " timeRanges " + times, e);
if (tx != null) {
@ -920,7 +917,7 @@ public class GFEDao extends DefaultPluginDao {
try {
sess.close();
} catch (Exception e) {
statusHandler.error(
logger.error(
"Error occurred closing database session", e);
}
}
@ -940,14 +937,14 @@ public class GFEDao extends DefaultPluginDao {
try {
return txTemplate
.execute(new TransactionCallback<List<TimeRange>>() {
@SuppressWarnings("unchecked")
@Override
public List<TimeRange> doInTransaction(
TransactionStatus status) {
@SuppressWarnings("unchecked")
List<TimeRange> result = getHibernateTemplate()
.find("SELECT dataTime.validPeriod FROM GFERecord WHERE parmId = ? ORDER BY dataTime.validPeriod.start",
parmId);
return result;
return getCurrentSession()
.createQuery(
"SELECT dataTime.validPeriod FROM GFERecord WHERE parmId = :parmId ORDER BY dataTime.validPeriod.start")
.setParameter("parmId", parmId).list();
}
});
} catch (Exception e) {
@ -972,19 +969,19 @@ public class GFEDao extends DefaultPluginDao {
try {
return txTemplate
.execute(new TransactionCallback<List<TimeRange>>() {
@SuppressWarnings("unchecked")
@Override
public List<TimeRange> doInTransaction(
TransactionStatus status) {
@SuppressWarnings("unchecked")
List<TimeRange> rval = getHibernateTemplate()
.find("SELECT dataTime.validPeriod"
+ " FROM GFERecord WHERE parmId = ?"
+ " AND dataTime.validPeriod.start < ?"
+ " AND dataTime.validPeriod.end > ?"
+ " ORDER BY dataTime.validPeriod.start",
new Object[] { parmId, tr.getEnd(),
tr.getStart() });
return rval;
Query query = getCurrentSession().createQuery("SELECT dataTime.validPeriod"
+ " FROM GFERecord WHERE parmId = :parmId"
+ " AND dataTime.validPeriod.start < :start"
+ " AND dataTime.validPeriod.end > :end"
+ " ORDER BY dataTime.validPeriod.start");
query.setParameter("parmId", parmId);
query.setParameter("start", tr.getEnd());
query.setParameter("end", tr.getStart());
return query.list();
}
});
} catch (Exception e) {
@ -1020,7 +1017,7 @@ public class GFEDao extends DefaultPluginDao {
Transaction tx = null;
try {
sess = getHibernateTemplate().getSessionFactory()
sess = getSessionFactory()
.openStatelessSession();
tx = sess.beginTransaction();
@ -1059,7 +1056,7 @@ public class GFEDao extends DefaultPluginDao {
try {
sess.close();
} catch (Exception e) {
statusHandler.error(
logger.error(
"Error occurred closing database session", e);
}
}
@ -1080,7 +1077,7 @@ public class GFEDao extends DefaultPluginDao {
Session sess = null;
boolean purged = false;
try {
sess = getHibernateTemplate().getSessionFactory().openSession();
sess = getSessionFactory().openSession();
Transaction tx = sess.beginTransaction();
Object toDelete = sess.get(DatabaseID.class, dbId.getId(),
LockOptions.UPGRADE);
@ -1092,13 +1089,13 @@ public class GFEDao extends DefaultPluginDao {
tx.commit();
purged = true;
} catch (Exception e) {
statusHandler.error("Error purging " + dbId, e);
logger.error("Error purging " + dbId, e);
} finally {
if (sess != null) {
try {
sess.close();
} catch (Exception e) {
statusHandler.error(
logger.error(
"Error occurred closing database session", e);
}
}
@ -1159,7 +1156,7 @@ public class GFEDao extends DefaultPluginDao {
Transaction tx = null;
try {
sess = getHibernateTemplate().getSessionFactory()
sess = getSessionFactory()
.openStatelessSession();
tx = sess.beginTransaction();
Query q = sess
@ -1182,7 +1179,7 @@ public class GFEDao extends DefaultPluginDao {
try {
sess.close();
} catch (Exception e) {
statusHandler.error(
logger.error(
"Error occurred closing database session", e);
}
}
@ -1208,7 +1205,7 @@ public class GFEDao extends DefaultPluginDao {
List<Object[]> rows = null;
try {
sess = getHibernateTemplate().getSessionFactory()
sess = getSessionFactory()
.openStatelessSession();
tx = sess.beginTransaction();
// use intersection of time range, UPDATE statement don't auto join
@ -1253,7 +1250,7 @@ public class GFEDao extends DefaultPluginDao {
try {
sess.close();
} catch (Exception e) {
statusHandler.error(
logger.error(
"Error occurred closing database session", e);
}
}
@ -1293,7 +1290,7 @@ public class GFEDao extends DefaultPluginDao {
Transaction tx = null;
try {
sess = getHibernateTemplate().getSessionFactory()
sess = getSessionFactory()
.openStatelessSession();
tx = sess.beginTransaction();
Query q = sess
@ -1316,7 +1313,7 @@ public class GFEDao extends DefaultPluginDao {
try {
sess.close();
} catch (Exception e) {
statusHandler.error(
logger.error(
"Error occurred closing database session", e);
}
}
@ -1368,17 +1365,17 @@ public class GFEDao extends DefaultPluginDao {
// TODO: Should this be done from GridParmManager?
List<DatabaseID> results = Collections.emptyList();
try {
final String[] queryParams = { siteId, modelName };
results = txTemplate
.execute(new TransactionCallback<List<DatabaseID>>() {
@SuppressWarnings("unchecked")
@Override
public List<DatabaseID> doInTransaction(
TransactionStatus status) {
@SuppressWarnings("unchecked")
List<DatabaseID> result = getHibernateTemplate()
.find("FROM DatabaseID WHERE siteId = ? AND modelName = ? ORDER BY modelTime DESC LIMIT 1",
(Object[]) queryParams);
return result;
Query query = getCurrentSession().createQuery("FROM DatabaseID WHERE siteId = :siteId AND modelName = :modelName ORDER BY modelTime DESC LIMIT 1");
query.setParameter("siteId", siteId);
query.setParameter("modelName",modelName);
return query.list();
}
});
} catch (Exception e) {
@ -1409,7 +1406,7 @@ public class GFEDao extends DefaultPluginDao {
dbId.setRemovedDate(removedDate);
Session sess = null;
try {
sess = getHibernateTemplate().getSessionFactory().openSession();
sess = getSession();
int tries = 0;
Transaction tx = null;
try {
@ -1445,7 +1442,7 @@ public class GFEDao extends DefaultPluginDao {
try {
sess.close();
} catch (Exception e) {
statusHandler.error(
logger.error(
"Error occurred closing database session", e);
}
}
@ -1465,7 +1462,7 @@ public class GFEDao extends DefaultPluginDao {
Transaction tx = null;
try {
sess = getHibernateTemplate().getSessionFactory().openSession();
sess = getSession();
tx = sess.beginTransaction();
sess.saveOrUpdate(gloc);
tx.commit();
@ -1486,7 +1483,7 @@ public class GFEDao extends DefaultPluginDao {
try {
sess.close();
} catch (Exception e) {
statusHandler.error(
logger.error(
"Error occurred closing database session", e);
}
}

View file

@ -52,6 +52,7 @@ import com.raytheon.uf.edex.database.dao.DaoConfig;
* 06/17/08 #940 bphillip Initial Creation
* 04/19/13 #1949 rjpeter Normalized GFE Database.
* 06/20/13 #2127 rjpeter Set session to read only.
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
* </pre>
*
* @author bphillip
@ -98,7 +99,7 @@ public class GFELockDao extends CoreDao {
Transaction tx = null;
try {
sess = getHibernateTemplate().getSessionFactory().openSession();
sess = getSession();
sess.setDefaultReadOnly(true);
tx = sess.beginTransaction();
@ -137,7 +138,7 @@ public class GFELockDao extends CoreDao {
try {
sess.close();
} catch (Exception e) {
statusHandler.error(
logger.error(
"Error occurred closing database session", e);
}
}
@ -159,7 +160,7 @@ public class GFELockDao extends CoreDao {
Transaction tx = null;
try {
s = this.getHibernateTemplate().getSessionFactory()
s = getSessionFactory()
.openStatelessSession();
tx = s.beginTransaction();
@ -185,7 +186,7 @@ public class GFELockDao extends CoreDao {
try {
s.close();
} catch (Exception e) {
statusHandler.error(
logger.error(
"Error occurred closing database session", e);
}
}

View file

@ -63,6 +63,7 @@ import com.raytheon.uf.edex.database.dao.DaoConfig;
* May 08, 2012 600 dgilling Re-work logic for handling PENDING
* records.
* Feb 07, 2014 2357 rjpeter iscSendNotification uri.
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
*
* </pre>
*
@ -333,7 +334,7 @@ public class IscSendQueue {
for (IscSendRecord record : newJobs) {
try {
s = cd.getHibernateTemplate().getSessionFactory().openSession();
s = cd.getSession();
tx = s.beginTransaction();
boolean foundDupe = false;
boolean foundMerge = false;
@ -575,7 +576,7 @@ public class IscSendQueue {
CoreDao dao = new CoreDao(DaoConfig.DEFAULT);
List<IscSendRecord> pendingToSending = null;
try {
lookupSess = dao.getHibernateTemplate().getSessionFactory()
lookupSess = dao.getSessionFactory()
.openStatelessSession();
Criteria pendingCrit = lookupSess
@ -607,8 +608,7 @@ public class IscSendQueue {
Transaction tx = null;
try {
dbModSess = dao.getHibernateTemplate().getSessionFactory()
.openSession();
dbModSess = dao.getSession();
tx = dbModSess.beginTransaction();
IscSendRecord oldRecord = (IscSendRecord) dbModSess.get(

View file

@ -37,7 +37,7 @@ import org.geotools.data.simple.SimpleFeatureIterator;
import org.geotools.data.simple.SimpleFeatureSource;
import org.geotools.factory.CommonFactoryFinder;
import org.geotools.factory.GeoTools;
import org.hibernate.engine.SessionFactoryImplementor;
import org.hibernate.engine.spi.SessionFactoryImplementor;
import org.opengis.feature.IllegalAttributeException;
import org.opengis.feature.simple.SimpleFeature;
import org.opengis.feature.simple.SimpleFeatureType;
@ -71,6 +71,7 @@ import com.vividsolutions.jts.geom.Polygon;
* Mar 28, 2013 #1837 dgilling Change error handling in
* getLastUpdated().
* Mar 11, 2014 #2718 randerso Changes for GeoTools 10.5
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
*
* </pre>
*

View file

@ -56,6 +56,7 @@ import com.raytheon.uf.edex.database.dao.DaoConfig;
* Jun 13, 2013 #2044 randerso Refactored to use IFPServer,
* moved smartInit queuing code here
* from other modules, general code cleanup
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
* </pre>
*
* @author njensen
@ -217,7 +218,7 @@ public class SmartInitQueue {
CoreDao cd = new CoreDao(DaoConfig.DEFAULT);
Session s = null;
try {
s = cd.getHibernateTemplate().getSessionFactory().openSession();
s = cd.getSession();
Transaction tx = null;
SmartInitRecord oldRecord = null;

View file

@ -23,6 +23,7 @@ package com.raytheon.edex.plugin.radar.dao;
import java.util.ArrayList;
import java.util.List;
import org.hibernate.Session;
import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Disjunction;
import org.hibernate.criterion.Expression;
@ -45,6 +46,7 @@ import com.vividsolutions.jts.geom.Coordinate;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 7/24/07 353 bphillip Initial Check in
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
*
* </pre>
*
@ -167,10 +169,8 @@ public class RadarStationDao extends CoreDao {
}
}
crit.add(stationEq);
List<RadarStation> stations = getHibernateTemplate()
.findByCriteria(crit);
return stations;
Session session = getSession();
return crit.getExecutableCriteria(session).list();
} else {
logger.warn("Cannot execute spatial query with less than 3 points");
return new ArrayList<RadarStation>();

View file

@ -29,8 +29,8 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.hibernate.connection.ConnectionProvider;
import org.hibernate.engine.SessionFactoryImplementor;
import org.hibernate.engine.spi.SessionFactoryImplementor;
import org.hibernate.service.jdbc.connections.spi.ConnectionProvider;
import com.raytheon.edex.plugin.shef.data.ShefData;
import com.raytheon.edex.plugin.shef.data.ShefRecord;
@ -87,6 +87,7 @@ import com.raytheon.uf.edex.database.dao.DaoConfig;
* 04/29/2014 3088 mpduff Change logging class, clean up/optimization.
* More performance fixes.
* 09/03/2014 mpduff postRiverStatus() writes directly, not via batch
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
*
* </pre>
*

View file

@ -55,6 +55,7 @@ import com.vividsolutions.jts.geom.Geometry;
* May 10, 2013 1951 rjpeter Added own id sequence tagging
* Jul 16, 2013 2181 bsteffen Convert geometry types to use hibernate-
* spatial
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
* </pre>
*
* @author njensen
@ -144,7 +145,7 @@ public abstract class ActiveTableRecord extends PersistableDataObject {
protected boolean ufn;
@Column
@Type(type = "org.hibernatespatial.GeometryUserType")
@Type(type = "org.hibernate.spatial.GeometryType")
@DynamicSerializeElement
protected Geometry geometry;

View file

@ -48,6 +48,7 @@ import com.vividsolutions.jts.geom.Geometry;
* Nov 01, 2013 2361 njensen Remove XML annotations
* Apr 15, 2014 3001 bgonzale Refactored to common package,
* com.raytheon.uf.common.dataplugin.ccfp.
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
*
*
* </pre>
@ -62,7 +63,7 @@ public class CcfpLocation implements ISpatialObject {
private static final long serialVersionUID = 8890315829188793187L;
@Column(name = "location")
@Type(type = "org.hibernatespatial.GeometryUserType")
@Type(type = "org.hibernate.spatial.GeometryType")
@DynamicSerializeElement
private Geometry geometry;

View file

@ -27,6 +27,7 @@ import java.sql.SQLException;
import java.sql.Types;
import org.hibernate.HibernateException;
import org.hibernate.engine.spi.SessionImplementor;
import org.hibernate.usertype.UserType;
import com.raytheon.uf.common.dataplugin.gfe.GridDataHistory;
@ -42,6 +43,7 @@ import com.raytheon.uf.common.dataplugin.gfe.GridDataHistory;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 4/18/08 875 bphillip Initial Creation
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
*
* </pre>
*
@ -87,29 +89,30 @@ public class OriginHibType implements UserType {
public boolean isMutable() {
return false;
}
@Override
public Object nullSafeGet(ResultSet resultSet, String[] names, Object owner)
public Object nullSafeGet(ResultSet rs, String[] names,
SessionImplementor session, Object owner)
throws HibernateException, SQLException {
return GridDataHistory.OriginType
.valueOf(resultSet.getString(names[0]));
.valueOf(rs.getString(names[0]));
}
@Override
public void nullSafeSet(PreparedStatement statement, Object value, int index)
throws HibernateException, SQLException {
public void nullSafeSet(PreparedStatement st, Object value, int index,
SessionImplementor session) throws HibernateException, SQLException {
if (value == null) {
statement.setString(index, null);
st.setString(index, null);
} else {
if (value instanceof GridDataHistory.OriginType) {
statement.setString(index, ((GridDataHistory.OriginType) value)
st.setString(index, ((GridDataHistory.OriginType) value)
.name());
} else {
throw new HibernateException("value is not of type "
+ GridDataHistory.OriginType.class.getName());
}
}
}
@Override
@ -127,5 +130,4 @@ public class OriginHibType implements UserType {
public int[] sqlTypes() {
return OriginHibType.SQL_TYPES;
}
}

View file

@ -27,6 +27,7 @@ import java.sql.SQLException;
import java.sql.Types;
import org.hibernate.HibernateException;
import org.hibernate.engine.spi.SessionImplementor;
import org.hibernate.usertype.UserType;
import com.raytheon.uf.common.dataplugin.gfe.db.objects.ParmID;
@ -41,6 +42,7 @@ import com.raytheon.uf.common.dataplugin.gfe.db.objects.ParmID;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 4/18/08 875 bphillip Initial Creation
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
*
* </pre>
*
@ -85,20 +87,21 @@ public class ParmIdType implements UserType{
public boolean isMutable() {
return false;
}
@Override
public Object nullSafeGet(ResultSet resultSet, String[] names, Object owner)
public Object nullSafeGet(ResultSet rs, String[] names,
SessionImplementor session, Object owner)
throws HibernateException, SQLException {
return new ParmID(resultSet.getString(names[0]));
return new ParmID(rs.getString(names[0]));
}
@Override
public void nullSafeSet(PreparedStatement statement, Object value, int index)
throws HibernateException, SQLException {
public void nullSafeSet(PreparedStatement st, Object value, int index,
SessionImplementor session) throws HibernateException, SQLException {
if(value == null){
statement.setString(index, null);
st.setString(index, null);
}else{
statement.setString(index, value.toString());
st.setString(index, value.toString());
}
}
@ -118,6 +121,4 @@ public class ParmIdType implements UserType{
public int[] sqlTypes() {
return ParmIdType.SQL_TYPES;
}
}

View file

@ -26,6 +26,7 @@ import java.sql.SQLException;
import java.sql.Types;
import org.hibernate.HibernateException;
import org.hibernate.engine.spi.SessionImplementor;
import org.hibernate.usertype.UserType;
import com.raytheon.uf.common.message.WsId;
@ -39,6 +40,7 @@ import com.raytheon.uf.common.message.WsId;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jun 10, 2009 randerso Initial creation
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
*
* </pre>
*
@ -116,40 +118,28 @@ public class WsIdType implements UserType {
public boolean isMutable() {
return false;
}
/*
* (non-Javadoc)
*
* @see org.hibernate.usertype.UserType#nullSafeGet(java.sql.ResultSet,
* java.lang.String[], java.lang.Object)
*/
@Override
public Object nullSafeGet(ResultSet resultSet, String[] names, Object owner)
public Object nullSafeGet(ResultSet rs, String[] names,
SessionImplementor session, Object owner)
throws HibernateException, SQLException {
String s = resultSet.getString(names[0]);
String s = rs.getString(names[0]);
if (s == null) {
return null;
}
return new WsId(resultSet.getString(names[0]));
return new WsId(rs.getString(names[0]));
}
/*
* (non-Javadoc)
*
* @see
* org.hibernate.usertype.UserType#nullSafeSet(java.sql.PreparedStatement,
* java.lang.Object, int)
*/
@Override
public void nullSafeSet(PreparedStatement statement, Object value, int index)
throws HibernateException, SQLException {
public void nullSafeSet(PreparedStatement st, Object value, int index,
SessionImplementor session) throws HibernateException, SQLException {
if (value == null) {
statement.setString(index, null);
st.setString(index, null);
} else {
statement.setString(index, value.toString());
st.setString(index, value.toString());
}
}
/*
@ -183,5 +173,4 @@ public class WsIdType implements UserType {
public int[] sqlTypes() {
return WsIdType.SQL_TYPES;
}
}

View file

@ -65,6 +65,7 @@ import com.vividsolutions.jts.geom.Geometry;
* Jul 16, 2013 2181 bsteffen Convert geometry types to use hibernate-
* spatial
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
*
* </pre>
*
@ -94,7 +95,7 @@ public class GOESSounding extends PersistablePluginDataObject implements
// The bounding box that contains this observation.
@Column
@Type(type = "org.hibernatespatial.GeometryUserType")
@Type(type = "org.hibernate.spatial.GeometryType")
@DynamicSerializeElement
private Geometry boxGeometry;

View file

@ -54,6 +54,7 @@ import com.vividsolutions.jts.geom.Point;
* Jul 24, 2007 353 bphillip Initial Check in
* Jul 16, 2013 2181 bsteffen Convert geometry types to use hibernate-
* spatial
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
*
* </pre>
*
@ -118,7 +119,7 @@ public class RadarStation extends PersistableDataObject implements
private Float lon;
@Column(name = "the_geom")
@Type(type = "org.hibernatespatial.GeometryUserType")
@Type(type = "org.hibernate.spatial.GeometryType")
@XmlJavaTypeAdapter(value = GeometryAdapter.class)
@DynamicSerializeElement
private Point station;

View file

@ -74,6 +74,7 @@ import com.vividsolutions.jts.geom.Polygon;
* Sep 30, 2013 2333 mschenke Refactored to store coordinates in CRS
* space
* Apr 11, 2014 2947 bsteffen Fix equals
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
*
*
* </pre>
@ -151,7 +152,7 @@ public class SatMapCoverage extends PersistableDataObject<Object> implements
/** The map coverage */
@Column(name = "the_geom")
@Type(type = "org.hibernatespatial.GeometryUserType")
@Type(type = "org.hibernate.spatial.GeometryType")
@XmlJavaTypeAdapter(value = GeometryAdapter.class)
@DynamicSerializeElement
private Geometry location;

View file

@ -57,6 +57,7 @@ import com.vividsolutions.jts.geom.Geometry;
* Aug 08, 2013 2243 jsanchez Removed super method in copy constructor.
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
* Jun 11, 2014 2061 bsteffen Remove IDecoderGettable
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
*
* </pre>
*
@ -150,7 +151,7 @@ public abstract class AbstractWarningRecord extends PluginDataObject {
private boolean ufn;
@Column
@Type(type = "org.hibernatespatial.GeometryUserType")
@Type(type = "org.hibernate.spatial.GeometryType")
@DynamicSerializeElement
private Geometry geometry;

View file

@ -79,6 +79,7 @@ import com.vividsolutions.jts.geom.Geometry;
* Oct 15, 2013 2473 bsteffen add @XmlSeeAlso for self contained JAXB
* context.
* Apr 11, 2014 2947 bsteffen Implement IGridGeometryProvider.
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
*
* </pre>
*
@ -124,7 +125,7 @@ public abstract class GridCoverage extends PersistableDataObject<Integer>
/** Geometry object holding the corner points of the grid */
@Column(name = "the_geom")
@Type(type = "org.hibernatespatial.GeometryUserType")
@Type(type = "org.hibernate.spatial.GeometryType")
@XmlJavaTypeAdapter(value = GeometryAdapter.class)
@DynamicSerializeElement
protected Geometry geometry;

View file

@ -30,6 +30,7 @@ import javax.xml.datatype.DatatypeFactory;
import javax.xml.datatype.Duration;
import org.hibernate.HibernateException;
import org.hibernate.engine.spi.SessionImplementor;
import org.hibernate.usertype.UserType;
/**
@ -44,6 +45,7 @@ import org.hibernate.usertype.UserType;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 6, 2012 bphillip Initial creation
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
*
* </pre>
*
@ -89,11 +91,12 @@ public class DurationType implements UserType {
public boolean isMutable() {
return false;
}
@Override
public Object nullSafeGet(ResultSet resultSet, String[] names, Object owner)
public Object nullSafeGet(ResultSet rs, String[] names,
SessionImplementor session, Object owner)
throws HibernateException, SQLException {
long durationInMilliSeconds = resultSet.getLong((names[0]));
long durationInMilliSeconds = rs.getLong((names[0]));
try {
return DatatypeFactory.newInstance().newDuration(
@ -105,15 +108,15 @@ public class DurationType implements UserType {
}
@Override
public void nullSafeSet(PreparedStatement statement, Object value, int index)
throws HibernateException, SQLException {
public void nullSafeSet(PreparedStatement st, Object value, int index,
SessionImplementor session) throws HibernateException, SQLException {
if (value == null) {
statement.setLong(index, 0);
st.setLong(index, 0);
} else {
Duration dur = (Duration) value;
statement.setLong(index, dur.getTimeInMillis(new java.util.Date()));
st.setLong(index, dur.getTimeInMillis(new java.util.Date()));
}
}
@Override

View file

@ -20,7 +20,7 @@
package com.raytheon.uf.common.registry.schemas.ebxml.util;
import org.hibernate.HibernateException;
import org.hibernate.engine.SessionImplementor;
import org.hibernate.engine.spi.SessionImplementor;
import org.hibernate.id.IdentifierGenerator;
/**
@ -33,6 +33,7 @@ import org.hibernate.id.IdentifierGenerator;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jan 11, 2012 bphillip Initial creation
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
*
* </pre>
*

View file

@ -29,6 +29,7 @@ import java.sql.Types;
import javax.xml.datatype.XMLGregorianCalendar;
import org.hibernate.HibernateException;
import org.hibernate.engine.spi.SessionImplementor;
import org.hibernate.usertype.UserType;
/**
@ -44,6 +45,7 @@ import org.hibernate.usertype.UserType;
* Oct 31, 2013 2361 njensen Use specific JAXBManager instead of SerializationUtil
* Nov 14, 2013 2552 bkowal EbxmlJaxbManager is now accessed via getInstance
* Dec 04, 2013 2584 dhladky Version based EbxmlJaxbManager
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
*
* </pre>
*
@ -89,9 +91,10 @@ public class SerializedType implements UserType {
}
@Override
public Object nullSafeGet(ResultSet resultSet, String[] names, Object owner)
public Object nullSafeGet(ResultSet rs, String[] names,
SessionImplementor session, Object owner)
throws HibernateException, SQLException {
String obj = resultSet.getString(names[0]);
String obj = rs.getString(names[0]);
if (obj != null) {
try { // We always marshall to current version for to XML conversions
@ -106,18 +109,19 @@ public class SerializedType implements UserType {
}
@Override
public void nullSafeSet(PreparedStatement statement, Object value, int index)
throws HibernateException, SQLException {
public void nullSafeSet(PreparedStatement st, Object value, int index,
SessionImplementor session) throws HibernateException, SQLException {
if (value == null) {
statement.setString(index, null);
st.setString(index, null);
} else {
try { // We always marshall to current version for to XML conversions
statement.setString(index, EbxmlJaxbManager.getInstance()
st.setString(index, EbxmlJaxbManager.getInstance()
.getJaxbManager().marshalToXml(value));
} catch (Exception e) {
throw new HibernateException("Error storing AnyType data", e);
}
}
}
@Override
@ -135,5 +139,4 @@ public class SerializedType implements UserType {
public int[] sqlTypes() {
return SerializedType.SQL_TYPES;
}
}

View file

@ -32,6 +32,7 @@ import javax.xml.datatype.DatatypeFactory;
import javax.xml.datatype.XMLGregorianCalendar;
import org.hibernate.HibernateException;
import org.hibernate.engine.spi.SessionImplementor;
import org.hibernate.usertype.UserType;
/**
@ -47,6 +48,7 @@ import org.hibernate.usertype.UserType;
* Feb 21, 2012 #184 bphillip Initial creation
* 4/9/2013 1802 bphillip Added null check
* 7/29/2013 2191 bphillip Fixed equals method
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
*
* </pre>
*
@ -99,10 +101,11 @@ public class XMLGregorianCalendarType implements UserType {
}
@Override
public Object nullSafeGet(ResultSet resultSet, String[] names, Object owner)
public Object nullSafeGet(ResultSet rs, String[] names,
SessionImplementor session, Object owner)
throws HibernateException, SQLException {
GregorianCalendar cal = new GregorianCalendar();
Timestamp date = resultSet.getTimestamp(names[0]);
Timestamp date = rs.getTimestamp(names[0]);
if (date == null) {
return null;
}
@ -117,16 +120,16 @@ public class XMLGregorianCalendarType implements UserType {
}
@Override
public void nullSafeSet(PreparedStatement statement, Object value, int index)
throws HibernateException, SQLException {
public void nullSafeSet(PreparedStatement st, Object value, int index,
SessionImplementor session) throws HibernateException, SQLException {
if (value == null) {
statement.setDate(index, null);
st.setDate(index, null);
} else {
XMLGregorianCalendar cal = (XMLGregorianCalendar) value;
statement.setTimestamp(index, new Timestamp(cal
st.setTimestamp(index, new Timestamp(cal
.toGregorianCalendar().getTime().getTime()));
}
}
@Override
@ -144,5 +147,4 @@ public class XMLGregorianCalendarType implements UserType {
public int[] sqlTypes() {
return XMLGregorianCalendarType.SQL_TYPES;
}
}

View file

@ -9,7 +9,8 @@ Require-Bundle: com.raytheon.edex.common;bundle-version="1.11.1",
com.raytheon.uf.edex.decodertools;bundle-version="1.0.0",
org.geotools,
javax.persistence,
javax.measure
javax.measure,
com.raytheon.uf.common.status;bundle-version="1.14.1"
Import-Package: com.raytheon.edex.plugin.obs.metar,
com.raytheon.uf.common.dataplugin.obs.metar,
com.raytheon.uf.common.wmo,

View file

@ -15,7 +15,7 @@
</bean>
<bean id="hmdbTxManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
class="org.springframework.orm.hibernate4.HibernateTransactionManager">
<property name="sessionFactory" ref="hmdbSessionFactory" />
</bean>

View file

@ -16,7 +16,7 @@ import org.hibernate.Criteria;
import org.hibernate.HibernateException;
import org.hibernate.criterion.CriteriaQuery;
import org.hibernate.criterion.Criterion;
import org.hibernate.engine.TypedValue;
import org.hibernate.engine.spi.TypedValue;
/**
* Hibernate criterion that allows for direct SQL restrictions
@ -28,6 +28,7 @@ import org.hibernate.engine.TypedValue;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Feb 20, 2013 bclement Initial creation
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
*
* </pre>
*

View file

@ -22,7 +22,7 @@
</bean>
<bean id="ihfsTxManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
class="org.springframework.orm.hibernate4.HibernateTransactionManager">
<property name="sessionFactory" ref="ihfsSessionFactory" />
</bean>
@ -36,7 +36,7 @@
</bean>
<bean id="damTxManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
class="org.springframework.orm.hibernate4.HibernateTransactionManager">
<property name="sessionFactory" ref="damSessionFactory" />
</bean>
</beans>

View file

@ -11,7 +11,8 @@ Require-Bundle: com.raytheon.uf.edex.plugin.acars;bundle-version="1.11.4",
javax.measure,
com.raytheon.edex.common,
javax.persistence,
com.raytheon.uf.edex.pointdata;bundle-version="1.12.1174"
com.raytheon.uf.edex.pointdata;bundle-version="1.12.1174",
com.raytheon.uf.common.status;bundle-version="1.14.1"
Import-Package: com.raytheon.uf.common.dataplugin.acars,
com.raytheon.uf.common.dataplugin.acarssounding,
com.raytheon.uf.common.pointdata.spatial,

View file

@ -29,6 +29,7 @@ import org.springframework.transaction.support.TransactionCallback;
import com.raytheon.edex.db.dao.DefaultPluginDao;
import com.raytheon.uf.common.dataplugin.PluginException;
import com.raytheon.uf.common.dataplugin.acarssounding.ACARSSoundingRecord;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.edex.database.DataAccessLayerException;
import com.raytheon.uf.edex.plugin.acarssounding.tools.ACARSSoundingTools;
@ -126,7 +127,7 @@ public class ACARSSoundingDao extends DefaultPluginDao {
String query = String.format(QUERY_TIMELIMITS, tailNumber, startTime,
stopTime);
if (logger.isDebugEnabled()) {
if (logger.isPriorityEnabled(Priority.DEBUG)) {
logger.debug(query);
}

View file

@ -242,7 +242,7 @@ public class GridDao extends PluginDao {
record.setInfo(GridInfoCache.getInstance().getGridInfo(
record.getInfo()));
} catch (DataAccessLayerException e) {
statusHandler.handle(Priority.PROBLEM,
logger.handle(Priority.PROBLEM,
"Cannot load GridInfoRecord from DB for: "
+ record.getDataURI(), e);
return false;
@ -398,14 +398,14 @@ public class GridDao extends PluginDao {
} else {
GridInfoCache.getInstance().purgeCache(
new ArrayList<Integer>(orphanedIds));
statusHandler
logger
.warn("Unable to purge model cache of clustered edices");
}
}
} catch (DataAccessLayerException e1) {
statusHandler.error("Error purging orphaned grid info entries", e1);
logger.error("Error purging orphaned grid info entries", e1);
} catch (EdexException e) {
statusHandler.error(
logger.error(
"Error sending message to purge grid info topic", e);
}
}

View file

@ -110,7 +110,7 @@ public class VIIRSDao extends PluginDao {
coverage = (VIIRSSpatialCoverage) obj;
break;
} else {
statusHandler.handle(Priority.WARN,
logger.handle(Priority.WARN,
"VIIRSSpatialCoverage lookup returned type of: "
+ obj != null ? obj.getClass()
.getSimpleName() : null);
@ -118,7 +118,7 @@ public class VIIRSDao extends PluginDao {
}
}
} catch (DataAccessLayerException e) {
statusHandler.handle(Priority.PROBLEM,
logger.handle(Priority.PROBLEM,
"Error querying for viirs spatial object", e);
}
return coverage;

View file

@ -46,7 +46,7 @@
</bean>
<bean id="fxaTxManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
class="org.springframework.orm.hibernate4.HibernateTransactionManager">
<property name="sessionFactory" ref="fxaSessionFactory" />
</bean>

View file

@ -47,6 +47,7 @@ import org.hibernate.criterion.Order;
import org.hibernate.criterion.ProjectionList;
import org.hibernate.criterion.Projections;
import org.hibernate.criterion.Restrictions;
import org.springframework.orm.hibernate4.SessionFactoryUtils;
import com.raytheon.uf.common.dataplugin.text.db.OperationalStdTextProduct;
import com.raytheon.uf.common.dataplugin.text.db.PracticeStdTextProduct;
@ -91,6 +92,7 @@ import com.raytheon.uf.edex.decodertools.time.TimeTools;
* (operational or practice)
* May 20, 2014 2536 bclement moved from edex.textdb to edex.plugin.text
* Sep 18, 2014 3627 mapeters Updated deprecated {@link TimeTools} usage.
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
* </pre>
*
* @author garmendariz
@ -907,7 +909,7 @@ public class StdTextProductDao extends CoreDao {
try {
session = getSession();
conn = session.connection();
conn = SessionFactoryUtils.getDataSource(getSessionFactory()).getConnection();
String ccc = null;
@ -1122,7 +1124,7 @@ public class StdTextProductDao extends CoreDao {
try {
session = getSession();
c = session.connection();
c = SessionFactoryUtils.getDataSource(getSessionFactory()).getConnection();
ps1 = c.prepareStatement(query1);
ps2 = c.prepareStatement(query2);
ps3 = c.prepareStatement(query3);
@ -1246,7 +1248,7 @@ public class StdTextProductDao extends CoreDao {
try {
session = getSession();
c = session.connection();
c = SessionFactoryUtils.getDataSource(getSessionFactory()).getConnection();
ps1 = c.prepareStatement(query);
ps1.setString(1, wmoId);
ps1.setInt(2, startTimeSeconds);
@ -1313,7 +1315,7 @@ public class StdTextProductDao extends CoreDao {
try {
session = getSession();
c = session.connection();
c = SessionFactoryUtils.getDataSource(getSessionFactory()).getConnection();
ps1 = c.prepareStatement(query1);
ps2 = c.prepareStatement(query2);
ps3 = c.prepareStatement(query3);
@ -1437,7 +1439,7 @@ public class StdTextProductDao extends CoreDao {
try {
session = getSession();
c = session.connection();
c = SessionFactoryUtils.getDataSource(getSessionFactory()).getConnection();
ps1 = c.prepareStatement(query);
ps1.setString(1, site);
ps1.setInt(2, startTimeSeconds);
@ -1504,7 +1506,7 @@ public class StdTextProductDao extends CoreDao {
try {
session = getSession();
c = session.connection();
c = SessionFactoryUtils.getDataSource(getSessionFactory()).getConnection();
ps1 = c.prepareStatement(query1);
ps2 = c.prepareStatement(query2);
ps1.setString(1, nnnId);
@ -1600,7 +1602,7 @@ public class StdTextProductDao extends CoreDao {
try {
session = getSession();
c = session.connection();
c = SessionFactoryUtils.getDataSource(getSessionFactory()).getConnection();
ps1 = c.prepareStatement(query1);
ps1.setString(1, wmoId);
ps1.setString(2, site);
@ -1667,7 +1669,7 @@ public class StdTextProductDao extends CoreDao {
try {
session = getSession();
c = session.connection();
c = SessionFactoryUtils.getDataSource(getSessionFactory()).getConnection();
ps1 = c.prepareStatement(query1);
ps1.setString(1, wmoId);
ps1.setString(2, site);
@ -1760,7 +1762,7 @@ public class StdTextProductDao extends CoreDao {
try {
session = getSession();
c = session.connection();
c = SessionFactoryUtils.getDataSource(getSessionFactory()).getConnection();
int count = 0;
/*
@ -1909,7 +1911,7 @@ public class StdTextProductDao extends CoreDao {
try {
session = getSession();
c = session.connection();
c = SessionFactoryUtils.getDataSource(getSessionFactory()).getConnection();
ps1 = c.prepareStatement(query);
ps1.setString(1, wmoId);
ps1.setString(2, site);
@ -1967,7 +1969,7 @@ public class StdTextProductDao extends CoreDao {
try {
session = getSession();
c = session.connection();
c = SessionFactoryUtils.getDataSource(getSessionFactory()).getConnection();
ps1 = c.prepareStatement(hdrQuery);
ps1.setString(1, wmoId);
ps1.setString(2, site);
@ -2057,7 +2059,7 @@ public class StdTextProductDao extends CoreDao {
try {
session = getSession();
c = session.connection();
c = SessionFactoryUtils.getDataSource(getSessionFactory()).getConnection();
ps1 = c.prepareStatement(hdrQuery);
ps1.setString(1, wmoId);
ps1.setString(2, site);
@ -2154,7 +2156,7 @@ public class StdTextProductDao extends CoreDao {
try {
session = getSession();
c = session.connection();
c = SessionFactoryUtils.getDataSource(getSessionFactory()).getConnection();
if (xxxId == null || xxxId.length() > 0) {
ps1 = c.prepareStatement(noXxxQuery);
@ -2255,7 +2257,7 @@ public class StdTextProductDao extends CoreDao {
try {
session = getSession();
c = session.connection();
c = SessionFactoryUtils.getDataSource(getSessionFactory()).getConnection();
ps1 = c.prepareStatement(hdrQuery);
ps1.setString(1, wmoId);
@ -2352,7 +2354,7 @@ public class StdTextProductDao extends CoreDao {
try {
session = getSession();
c = session.connection();
c = SessionFactoryUtils.getDataSource(getSessionFactory()).getConnection();
ps1 = c.prepareStatement(hdrQuery);
ps1.setString(1, wmoId);
@ -2452,7 +2454,7 @@ public class StdTextProductDao extends CoreDao {
try {
session = getSession();
c = session.connection();
c = SessionFactoryUtils.getDataSource(getSessionFactory()).getConnection();
switch (intlProd) {
case 0: // fall through
@ -2576,7 +2578,7 @@ public class StdTextProductDao extends CoreDao {
try {
session = getSession();
c = session.connection();
c = SessionFactoryUtils.getDataSource(getSessionFactory()).getConnection();
switch (intlProd) {
case 0: // fall through
@ -2681,7 +2683,7 @@ public class StdTextProductDao extends CoreDao {
try {
session = getSession();
c = session.connection();
c = SessionFactoryUtils.getDataSource(getSessionFactory()).getConnection();
ret = read_product(c, wmoId, site, cccId, nnnId, xxxId, version);
} catch (SQLException e) {
// don't need to worry about rolling back transaction

View file

@ -25,7 +25,10 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.hibernate.Criteria;
import org.hibernate.Query;
import org.springframework.transaction.TransactionStatus;
import org.springframework.transaction.support.TransactionCallback;
import com.raytheon.uf.common.dataplugin.persist.PersistableDataObject;
import com.raytheon.uf.common.dataplugin.text.db.SubscriptionRecord;
@ -53,6 +56,7 @@ import com.raytheon.uf.edex.database.query.DatabaseQuery;
* 04/24/13 1949 rjpeter Removed @Override on delete.
* Nov 08, 2013 2361 njensen Chaged method signature of saveOrUpdate(Object)
* May 22, 2014 2536 bclement moved from autobldsrv to edex.plugin.text
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
* </pre>
*
* @author mfegan
@ -146,10 +150,9 @@ public class SubscriptionDAO extends CoreDao {
*
* @return the list of subscriptions
*/
@SuppressWarnings("unchecked")
public List<SubscriptionRecord> getSubscriptions() {
if ((cachedRecords == null) || dirtyRecords) {
List<?> retVal = getHibernateTemplate().loadAll(this.daoClass);
List<SubscriptionRecord> retVal = loadAll();
if (retVal == null) {
logger.info("Unable to perform query, 'null' result returned");
cachedRecords = new ArrayList<SubscriptionRecord>();
@ -162,6 +165,20 @@ public class SubscriptionDAO extends CoreDao {
return cachedRecords;
}
@SuppressWarnings("unchecked")
private List<SubscriptionRecord> loadAll() {
return (List<SubscriptionRecord>) txTemplate
.execute(new TransactionCallback<List<?>>() {
@Override
public List<SubscriptionRecord> doInTransaction(
TransactionStatus status) {
Criteria criteria = getSession().createCriteria(
daoClass);
return criteria.list();
}
});
}
/**
*
* @param props
@ -204,7 +221,7 @@ public class SubscriptionDAO extends CoreDao {
return new ArrayList<SubscriptionRecord>();
}
} catch (DataAccessLayerException e) {
logger.info("Unable to perform query, ", e);
logger.error("Unable to perform query, ", e);
return new ArrayList<SubscriptionRecord>();
}
rval = (List<SubscriptionRecord>) retVal;

View file

@ -70,6 +70,7 @@ import com.raytheon.uf.edex.registry.ebxml.util.EbxmlObjectUtil;
* 10/23/2013 1538 bphillip Changed send time slot to be DateTimeValue instead of integer
* 12/2/2013 1829 bphillip Changed to use non generic getter of value type
* 01/21/2014 2613 bphillip Modified queries to better handle deletes
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
*
* </pre>
*
@ -137,7 +138,7 @@ public class AuditableEventTypeDao extends
@Override
public void create(AuditableEventType event) {
template.save(event);
getCurrentSession().save(event);
}
/**

View file

@ -45,7 +45,7 @@ import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectType;
import org.apache.commons.beanutils.PropertyUtils;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.cfg.Configuration;
import org.hibernate.jdbc.Work;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
@ -95,6 +95,7 @@ import com.raytheon.uf.edex.registry.ebxml.init.RegistryInitializedListener;
* 7/10/2014 1717 bphillip Removed xacml policy admin object
* Jul 10, 2014 2914 garmendariz Remove EnvProperties
* Jul 28, 2014 3474 dhladky Fixed bad ownership settings.
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
* </pre>
*
* @author bphillip
@ -319,12 +320,12 @@ public class DbInit extends com.raytheon.uf.edex.database.init.DbInit implements
* {@inheritDoc}
*/
@Override
protected AnnotationConfiguration getAnnotationConfiguration() {
protected Configuration getConfiguration() {
/*
* Create a new configuration object which holds all the classes that
* this Hibernate SessionFactory is aware of
*/
AnnotationConfiguration aConfig = new AnnotationConfiguration();
Configuration aConfig = new Configuration();
for (Object obj : sessionFactory.getAllClassMetadata().keySet()) {
try {
Class<?> clazz = Class.forName((String) obj);

View file

@ -23,8 +23,8 @@ import java.util.ArrayList;
import java.util.List;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.impl.SessionFactoryImpl;
import org.hibernate.cfg.Configuration;
import org.hibernate.internal.SessionFactoryImpl;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
@ -39,6 +39,7 @@ import com.raytheon.uf.common.status.UFStatus;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Apr 15, 2013 1693 djohnson Initial creation
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
*
* </pre>
*
@ -63,7 +64,7 @@ public class EbxmlPostgresValidationStrategy implements
* {@inheritDoc}
*/
@Override
public boolean isDbValid(AnnotationConfiguration aConfig,
public boolean isDbValid(Configuration aConfig,
SessionFactory sessionFactory) {
statusHandler.info("Verifying RegRep database...");
final List<String> existingTables = new ArrayList<String>();

View file

@ -20,7 +20,7 @@
package com.raytheon.uf.edex.registry.ebxml.dao;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.cfg.Configuration;
/**
* Database validation strategy.
@ -32,6 +32,7 @@ import org.hibernate.cfg.AnnotationConfiguration;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Apr 15, 2013 1693 djohnson Initial creation
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
*
* </pre>
*
@ -51,7 +52,7 @@ public interface IEbxmlDatabaseValidationStrategy {
* the session factory
* @return true if valid
*/
boolean isDbValid(AnnotationConfiguration aConfig,
boolean isDbValid(Configuration aConfig,
SessionFactory sessionFactory);
}

View file

@ -46,6 +46,7 @@ import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException;
* 2/13/2014 2769 bphillip Added read only flags to query methods
* 4/11/2014 3011 bphillip Changed merge to not delete unused slots
* 4/21/2014 2992 dhladky General list of Registry server nodes.
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
*
* </pre>
*
@ -89,7 +90,7 @@ public class RegistryObjectDao extends
public void merge(RegistryObjectType newObject,
RegistryObjectType existingObject) {
newObject.setId(existingObject.getId());
template.merge(newObject);
getCurrentSession().merge(newObject);
}
/**
@ -168,7 +169,7 @@ public class RegistryObjectDao extends
* The persistent object to delete
*/
public void deleteWithoutMerge(RegistryObjectType obj) {
this.template.delete(obj);
getCurrentSession().delete(obj);
}
public void deleteObjectWithoutDeletingChildren(RegistryObjectType obj)

View file

@ -26,7 +26,6 @@ import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectType;
import org.hibernate.SessionFactory;
import org.hibernate.criterion.Property;
import org.springframework.orm.hibernate3.HibernateTemplate;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
@ -47,6 +46,7 @@ import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants;
* 8/1/2013 1693 bphillip Moved the merge method down to RegistryObjectDao
* 10/8/2013 1682 bphillip Added like lid method, changed to use criteria queries for simple operations
* 2/13/2014 2769 bphillip Added read only flags to query methods
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
*
* </pre>
*
@ -245,7 +245,7 @@ public abstract class RegistryObjectTypeDao<ENTITY extends RegistryObjectType>
@Override
public void setSessionFactory(SessionFactory sessionFactory) {
template = new HibernateTemplate(sessionFactory);
this.sessionFactory = sessionFactory;
}
@Override

View file

@ -43,6 +43,7 @@ import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants;
* 7/11/2013 1707 bphillip Initial implementation
* 7/29/2013 2191 bphillip Modified method to get orphaned slots
* 12/2/2013 1829 bphillip Changed how orphans are purged
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
* </pre>
*
* @author bphillip
@ -84,13 +85,15 @@ public class SlotTypeDao extends SessionManagedDao<String, SlotType> {
public void deleteBySlotId(String id) {
SlotType slot = this.getById(id);
if (slot != null) {
this.template.delete(slot);
getCurrentSession().delete(slot);
}
}
public void deleteBySlotId(Collection<String> ids){
template.deleteAll(createCriteria().add(
for(Object obj: createCriteria().add(
Property.forName(QueryConstants.ID).in(ids))
.list());
.list()){
getCurrentSession().delete(obj);
}
}
}

View file

@ -44,6 +44,7 @@ import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException;
* 3/13/2013 1082 bphillip Initial creation
* 9/5/2013 1538 bphillip Added eagerLoadAll method
* 2/13/2014 2769 bphillip Added read only flags to query methods
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
*
* </pre>
*
@ -78,8 +79,7 @@ public class SubscriptionDao extends RegistryObjectTypeDao<SubscriptionType> {
*/
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public List<SubscriptionType> eagerLoadAll() throws EbxmlRegistryException {
List<SubscriptionType> subs = this.template
.loadAll(SubscriptionType.class);
List<SubscriptionType> subs = super.loadAll();
for (SubscriptionType sub : subs) {
try {
/*

View file

@ -71,7 +71,7 @@
<filter>
<filter-name>hibernateFilter</filter-name>
<filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
<filter-class>org.springframework.orm.hibernate4.support.OpenSessionInViewFilter</filter-class>
<init-param>
<param-name>singleSession</param-name>
<param-value>true</param-value>

View file

@ -43,7 +43,7 @@ import org.hibernate.criterion.Disjunction;
import org.hibernate.criterion.Junction;
import org.hibernate.criterion.MatchMode;
import org.hibernate.criterion.Restrictions;
import org.hibernatespatial.criterion.SpatialRestrictions;
import org.hibernate.spatial.criterion.SpatialRestrictions;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
@ -64,6 +64,7 @@ import com.vividsolutions.jts.geom.Geometry;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Apr 22, 2011 bclement Initial creation
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
*
* </pre>
*

View file

@ -42,8 +42,8 @@ import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.Disjunction;
import org.hibernate.criterion.MatchMode;
import org.hibernate.criterion.Restrictions;
import org.hibernatespatial.criterion.SpatialRelateExpression;
import org.hibernatespatial.criterion.SpatialRestrictions;
import org.hibernate.spatial.criterion.SpatialRelateExpression;
import org.hibernate.spatial.criterion.SpatialRestrictions;
import com.raytheon.uf.common.geospatial.MapUtil;
import com.raytheon.uf.edex.ogc.common.db.SQLParamRestriction;
@ -73,6 +73,7 @@ import com.vividsolutions.jts.geom.Geometry;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Oct 17, 2012 bclement Initial creation
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
*
* </pre>
*

View file

@ -29,7 +29,7 @@ import net.opengis.filter.v_1_1_0.FilterType;
import org.geotools.geometry.jts.JTS;
import org.hibernate.criterion.Criterion;
import org.hibernatespatial.criterion.SpatialRestrictions;
import org.hibernate.spatial.criterion.SpatialRestrictions;
import org.opengis.feature.simple.SimpleFeature;
import com.raytheon.uf.common.status.IUFStatusHandler;
@ -62,6 +62,7 @@ import com.vividsolutions.jts.geom.Polygon;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Apr 29, 2011 bclement Initial creation
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
*
* </pre>
*

View file

@ -26,8 +26,8 @@ import java.util.List;
import java.util.Map;
import org.hibernate.Criteria;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.classic.Session;
import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.Order;
import org.hibernate.criterion.Projections;
@ -55,6 +55,7 @@ import com.raytheon.uf.edex.wfs.request.SortBy;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* May 9, 2012 bclement Initial creation
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
*
* </pre>
*

View file

@ -9,7 +9,6 @@ import org.hibernate.Criteria;
import org.hibernate.Session;
import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.Restrictions;
import org.springframework.orm.hibernate3.HibernateTemplate;
import org.springframework.transaction.TransactionStatus;
import org.springframework.transaction.support.TransactionCallback;
@ -27,6 +26,7 @@ import com.raytheon.uf.edex.database.query.DatabaseQuery;
* ------------ ---------- ---------------- --------------------------
* 08/14/2013 T989 qzhou Initial creation.
* 03/13/2014 sgurung Added method purgeDataByRefTime()
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
* </pre>
*
* @author qzhou
@ -63,8 +63,7 @@ public class GeoMagAvgDao extends CoreDao {
return (List<GeoMagAvg>) txTemplate.execute(new TransactionCallback() {
@Override
public Object doInTransaction(TransactionStatus status) {
HibernateTemplate ht = getHibernateTemplate();
Session sess = ht.getSessionFactory().getCurrentSession();
Session sess = getCurrentSession();
Criteria crit = sess.createCriteria(GeoMagAvg.class);
Criterion where1 = Restrictions.eq("stationCode", stationCode);
crit.add(where1);
@ -82,8 +81,7 @@ public class GeoMagAvgDao extends CoreDao {
return (List<GeoMagAvg>) txTemplate.execute(new TransactionCallback() {
@Override
public Object doInTransaction(TransactionStatus status) {
HibernateTemplate ht = getHibernateTemplate();
Session sess = ht.getSessionFactory().getCurrentSession();
Session sess = getCurrentSession();
Criteria crit = sess.createCriteria(GeoMagAvg.class);
Criterion where1 = Restrictions.eq("stationCode", stationCode);
crit.add(where1);

View file

@ -9,7 +9,6 @@ import org.hibernate.Criteria;
import org.hibernate.Session;
import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.Restrictions;
import org.springframework.orm.hibernate3.HibernateTemplate;
import org.springframework.transaction.TransactionStatus;
import org.springframework.transaction.support.TransactionCallback;
@ -28,6 +27,7 @@ import com.raytheon.uf.edex.database.query.DatabaseQuery;
* 08/14/2013 T989 qzhou Initial creation.
* 03/03/2014 #1110 qzhou Added method getRangeK1min(), Cleaned code
* 03/13/2014 sgurung Added method purgeDataByRefTime()
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
* </pre>
*
* @author qzhou
@ -55,9 +55,7 @@ public class GeoMagK1minDao extends CoreDao {
.execute(new TransactionCallback() {
@Override
public Object doInTransaction(TransactionStatus status) {
HibernateTemplate ht = getHibernateTemplate();
Session sess = ht.getSessionFactory()
.getCurrentSession();
Session sess = getCurrentSession();
Criteria crit = sess.createCriteria(GeoMagK1min.class);
Criterion where1 = Restrictions.eq("stationCode",
stationCode);
@ -80,9 +78,7 @@ public class GeoMagK1minDao extends CoreDao {
.execute(new TransactionCallback() {
@Override
public Object doInTransaction(TransactionStatus status) {
HibernateTemplate ht = getHibernateTemplate();
Session sess = ht.getSessionFactory()
.getCurrentSession();
Session sess = getCurrentSession();
Criteria crit = sess.createCriteria(GeoMagK1min.class);
Criterion where1 = Restrictions.eq("stationCode",
stationCode);

View file

@ -9,7 +9,6 @@ import org.hibernate.Criteria;
import org.hibernate.Session;
import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.Restrictions;
import org.springframework.orm.hibernate3.HibernateTemplate;
import org.springframework.transaction.TransactionStatus;
import org.springframework.transaction.support.TransactionCallback;
@ -27,6 +26,7 @@ import com.raytheon.uf.edex.database.query.DatabaseQuery;
* ------------ ---------- ---------------- --------------------------
* 08/14/2013 T989 qzhou Initial creation.
* 03/13/2014 sgurung Added method purgeDataByRefTime()
* 10/16/2014 3454 bphillip Upgrading to Hibernate 4
* </pre>
*
* @author qzhou
@ -52,8 +52,7 @@ public class GeoMagK3hrDao extends CoreDao {
return (List<GeoMagK3hr>) txTemplate.execute(new TransactionCallback() {
@Override
public Object doInTransaction(TransactionStatus status) {
HibernateTemplate ht = getHibernateTemplate();
Session sess = ht.getSessionFactory().getCurrentSession();
Session sess = getCurrentSession();
Criteria crit = sess.createCriteria(GeoMagK3hr.class);
Criterion where1 = Restrictions.eq("stationCode", stationCode);
crit.add(where1);
@ -73,8 +72,7 @@ public class GeoMagK3hrDao extends CoreDao {
return (List<GeoMagK3hr>) txTemplate.execute(new TransactionCallback() {
@Override
public Object doInTransaction(TransactionStatus status) {
HibernateTemplate ht = getHibernateTemplate();
Session sess = ht.getSessionFactory().getCurrentSession();
Session sess = getCurrentSession();
Criteria crit = sess.createCriteria(GeoMagK3hr.class);
Criterion where1 = Restrictions.eq("stationCode", stationCode);
crit.add(where1);

View file

@ -16,7 +16,8 @@ Require-Bundle: com.raytheon.edex.common;bundle-version="1.11.17",
javax.persistence;bundle-version="1.0.0",
org.apache.commons.codec;bundle-version="1.3.0",
edu.wisc.ssec.mcidas;bundle-version="1.0.0",
com.raytheon.uf.common.numeric;bundle-version="1.14.0"
com.raytheon.uf.common.numeric;bundle-version="1.14.0",
com.raytheon.uf.common.status;bundle-version="1.14.1"
Export-Package: gov.noaa.nws.ncep.common.dataplugin.mcidas,
gov.noaa.nws.ncep.common.dataplugin.mcidas.dao,
gov.noaa.nws.ncep.common.dataplugin.mcidas.fixed

View file

@ -198,7 +198,7 @@ public class McidasMapCoverage extends PersistableDataObject implements
/** The map coverage */
@Column(name = "the_geom")
@Type(type = "org.hibernatespatial.GeometryUserType")
@Type(type = "org.hibernate.spatial.GeometryType")
@XmlJavaTypeAdapter(value = GeometryAdapter.class)
@DynamicSerializeElement
private Polygon location;

View file

@ -12,7 +12,7 @@
</bean>
<bean id="ncepTxManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
class="org.springframework.orm.hibernate4.HibernateTransactionManager">
<property name="sessionFactory" ref="ncepSessionFactory" />
</bean>

View file

@ -1,20 +1,15 @@
package gov.noaa.nws.ncep.edex.common.dao;
import java.io.File;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.Transaction;
import com.raytheon.edex.db.dao.DefaultPluginDao;
import com.raytheon.uf.common.dataplugin.PluginException;
import com.raytheon.uf.common.dataplugin.persist.IPersistable;
import com.raytheon.uf.common.datastorage.IDataStore;
import com.raytheon.uf.common.util.FileUtil;
import com.raytheon.uf.edex.core.hdf5.HDF5PluginFilenameFilter;
import com.raytheon.uf.edex.database.plugin.PluginDao;
public class NcepDefaultPluginDao extends PluginDao {
@ -51,8 +46,7 @@ public class NcepDefaultPluginDao extends PluginDao {
+ " plugin. EDEX will not purge data for "
+ this.pluginName + " plugin");
} else {
Session s = this.getHibernateTemplate().getSessionFactory()
.openSession();
Session s = getSession();
Transaction tx = s.beginTransaction();
try {

View file

@ -48,8 +48,7 @@ public abstract class NcepPointDataPluginDao<T extends PluginDataObject> extends
+ " plugin. EDEX will not purge data for "
+ this.pluginName + " plugin");
} else {
Session s = this.getHibernateTemplate().getSessionFactory()
.openSession();
Session s = getSession();
Transaction tx = s.beginTransaction();
try {

View file

@ -13,7 +13,8 @@ Require-Bundle: com.raytheon.edex.common;bundle-version="1.10.13",
com.raytheon.uf.common.pointdata;bundle-version="1.11.8",
com.raytheon.uf.edex.pointdata;bundle-version="1.11.8",
gov.noaa.nws.ncep.common.dataplugin.aww;bundle-version="1.0.0",
org.geotools;bundle-version="2.6.4"
org.geotools;bundle-version="2.6.4",
com.raytheon.uf.common.status;bundle-version="1.14.1"
Import-Package: com.raytheon.uf.common.wmo,
com.raytheon.uf.edex.decodertools.core,
com.raytheon.uf.edex.decodertools.time,

View file

@ -1,5 +1,7 @@
package gov.noaa.nws.ncep.edex.plugin.aww.dao;
import gov.noaa.nws.ncep.common.dataplugin.aww.AwwVtec;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
@ -9,7 +11,7 @@ import java.util.ArrayList;
import java.util.List;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.springframework.orm.hibernate4.SessionFactoryUtils;
import com.raytheon.uf.common.dataquery.db.QueryResult;
import com.raytheon.uf.common.dataquery.db.QueryResultRow;
@ -17,9 +19,6 @@ import com.raytheon.uf.edex.database.DataAccessLayerException;
import com.raytheon.uf.edex.database.dao.CoreDao;
import com.raytheon.uf.edex.database.dao.DaoConfig;
import gov.noaa.nws.ncep.common.dataplugin.aww.AwwVtec;
public class AwwVtecDao extends CoreDao {
public AwwVtecDao() {
@ -73,7 +72,7 @@ public class AwwVtecDao extends CoreDao {
try {
session = getSession(true);
conn = session.connection();
conn = SessionFactoryUtils.getDataSource(getSessionFactory()).getConnection();
stmt = conn.createStatement();
} catch (SQLException e) {