/**
* For tags, we won't know the refcount till all the data is loaded.
* So we update the table at postload.
*/
public void postLoad() {
ThreadConnection c = ThreadConnection.getInstance();
try {
c.prepareStatement("update SOCIALEVENTTAG set refcount = " +
"(select count(*) from SOCIALEVENTTAG_SOCIALEVENT " +
"where socialeventtagid = " +
"SOCIALEVENTTAG.socialeventtagid)");
c.executeUpdate();
//update id
logger.fine("updating Tag ID_GEN ID");
/*
c.prepareStatement("update ID_GEN set GEN_VALUE = " +
"(select count(*) +1 from SOCIALEVENTTAG) " +
"where GEN_KEY='SOCIAL_EVENT_TAG_ID'");
c.executeUpdate();
*/
c.prepareStatement("INSERT INTO ID_GEN " +
"(GEN_KEY, GEN_VALUE) " +
"VALUES ('SOCIAL_EVENT_TAG_ID', "+ ScaleFactors.tagCount + ")");
c.executeUpdate();
logger.fine("After updating Tag ID_GEN ID");
} catch (SQLException e) {
logger.log(Level.SEVERE, e.getMessage(), e);
}