diff --git a/livesupport/products/scheduler/src/PostgresqlPlayLog.cxx b/livesupport/products/scheduler/src/PostgresqlPlayLog.cxx index 1e1f9c5ee..c99004693 100644 --- a/livesupport/products/scheduler/src/PostgresqlPlayLog.cxx +++ b/livesupport/products/scheduler/src/PostgresqlPlayLog.cxx @@ -21,8 +21,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Author : $Author: fgerlits $ - Version : $Revision: 1.5 $ + Author : $Author: maroy $ + Version : $Revision: 1.6 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/PostgresqlPlayLog.cxx,v $ ------------------------------------------------------------------------------*/ @@ -181,9 +181,9 @@ PostgresqlPlayLog :: addPlayLogEntry( Ptr::Ref pstmt(conn->prepareStatement( addPlayLogEntryStmt)); id = UniqueId::generateId(); - pstmt->setString(1, *id->toDecimalString()); + pstmt->setLong(1, id->getId()); - pstmt->setString(2, *audioClipId->toDecimalString()); + pstmt->setLong(2, audioClipId->getId()); timestamp = Conversion::ptimeToTimestamp(clipTimestamp); pstmt->setTimestamp(3, *timestamp); @@ -231,10 +231,8 @@ PostgresqlPlayLog :: getPlayLogEntries( Ptr::Ref rs(pstmt->executeQuery()); while (rs->next()) { - Ptr::Ref id = UniqueId::fromDecimalString( - rs->getString(1)); - Ptr::Ref audioClipId = UniqueId::fromDecimalString( - rs->getString(2)); + Ptr::Ref id(new UniqueId(rs->getLong(1))); + Ptr::Ref audioClipId(new UniqueId(rs->getLong(2))); *timestamp = rs->getTimestamp(3); Ptr::Ref clipTimestamp diff --git a/livesupport/products/scheduler/src/PostgresqlSchedule.cxx b/livesupport/products/scheduler/src/PostgresqlSchedule.cxx index 9cf07a4dc..4345b6233 100644 --- a/livesupport/products/scheduler/src/PostgresqlSchedule.cxx +++ b/livesupport/products/scheduler/src/PostgresqlSchedule.cxx @@ -21,8 +21,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Author : $Author: fgerlits $ - Version : $Revision: 1.10 $ + Author : $Author: maroy $ + Version : $Revision: 1.11 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/PostgresqlSchedule.cxx,v $ ------------------------------------------------------------------------------*/ @@ -275,9 +275,8 @@ PostgresqlSchedule :: schedulePlaylist( Ptr::Ref pstmt(conn->prepareStatement( schedulePlaylistStmt)); id = UniqueId::generateId(); - pstmt->setString(1, *id->toDecimalString()); - - pstmt->setString(2, *playlist->getId()->toDecimalString()); + pstmt->setLong(1, id->getId()); + pstmt->setLong(2, playlist->getId()->getId()); timestamp = Conversion::ptimeToTimestamp(playtime); pstmt->setTimestamp(3, *timestamp); @@ -329,10 +328,8 @@ PostgresqlSchedule :: getScheduleEntries( Ptr::Ref rs(pstmt->executeQuery()); while (rs->next()) { - Ptr::Ref id = UniqueId::fromDecimalString( - rs->getString(1)); - Ptr::Ref playlistId = UniqueId::fromDecimalString( - rs->getString(2)); + Ptr::Ref id(new UniqueId(rs->getLong(1))); + Ptr::Ref playlistId(new UniqueId(rs->getLong(2))); *timestamp = rs->getTimestamp(3); Ptr::Ref startTime = Conversion::timestampToPtime(timestamp); @@ -380,10 +377,8 @@ PostgresqlSchedule :: getNextEntry(Ptr::Ref fromTime) Ptr::Ref rs(pstmt->executeQuery()); if (rs->next()) { - Ptr::Ref id = UniqueId::fromDecimalString( - rs->getString(1)); - Ptr::Ref playlistId = UniqueId::fromDecimalString( - rs->getString(2)); + Ptr::Ref id(new UniqueId(rs->getLong(2))); + Ptr::Ref playlistId(new UniqueId(rs->getLong(2))); *timestamp = rs->getTimestamp(3); Ptr::Ref startTime = Conversion::timestampToPtime(timestamp); @@ -422,7 +417,7 @@ PostgresqlSchedule :: scheduleEntryExists( conn = cm->getConnection(); Ptr::Ref pstmt(conn->prepareStatement( scheduleEntryExistsStmt)); - pstmt->setString(1, *entryId->toDecimalString()); + pstmt->setLong(1, entryId->getId()); Ptr::Ref rs(pstmt->executeQuery()); result = (rs->next()) ? (rs->getLong(1) == 1) : false; @@ -454,7 +449,7 @@ PostgresqlSchedule :: removeFromSchedule( conn = cm->getConnection(); Ptr::Ref pstmt(conn->prepareStatement( removeFromScheduleStmt)); - pstmt->setString(1, *entryId->toDecimalString()); + pstmt->setLong(1, entryId->getId()); result = pstmt->executeUpdate() == 1; @@ -486,16 +481,14 @@ PostgresqlSchedule :: getScheduleEntry(Ptr::Ref entryId) conn = cm->getConnection(); Ptr::Ref pstmt(conn->prepareStatement( getScheduleEntryStmt)); - pstmt->setString(1, *entryId->toDecimalString()); + pstmt->setLong(1, entryId->getId()); Ptr::Ref rs(pstmt->executeQuery()); if (rs->next()) { Ptr::Ref timestamp(new Timestamp()); - Ptr::Ref id = UniqueId::fromDecimalString( - rs->getString(1)); - Ptr::Ref playlistId = UniqueId::fromDecimalString( - rs->getString(2)); + Ptr::Ref id(new UniqueId(rs->getLong(1))); + Ptr::Ref playlistId(new UniqueId(rs->getLong(2))); *timestamp = rs->getTimestamp(3); Ptr::Ref startTime = Conversion::timestampToPtime(timestamp); @@ -555,7 +548,7 @@ PostgresqlSchedule :: reschedule(Ptr::Ref entryId, timestamp = Conversion::ptimeToTimestamp(ends); pstmt->setTimestamp(2, *timestamp); - pstmt->setString(3, *entryId->toDecimalString()); + pstmt->setLong(3, entryId->getId()); result = pstmt->executeUpdate() == 1;