db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Derek Hardy" <derek.ha...@teknosys.co.uk>
Subject RE: Adding new columns
Date Thu, 12 Jun 2003 12:54:33 GMT
Hi Eric

This is the only column that isn't being saved, but it's not the only date
column in the table.

The java code is as follows :-

.
.
.
    try {
      Property p = new Property();

      if (UsefulFunctions.toInt(f.getPropertyId()) != 0) {
        Criteria c = new Criteria();
        c.add(PropertyPeer.PROPERTY_ID, f.getPropertyId());

        List v = PropertyPeer.doSelect(c);

        if (v.size() > 0) {
          p = (Property) v.get(0);
        }
      }
      else {
        p.setStatusCode(f.getStatusCode());
        p.setDatePosted(new java.util.Date(System.currentTimeMillis()));
        p.setStatusChangeDate(new
java.util.Date(System.currentTimeMillis()));
      }

      p.setCategoryId(f.getCategoryId());
      p.setContact(f.getContact());
      p.setDateFound(UsefulFunctions.stringToDate(f.getDateFound()));
      p.setDescription(f.getDescription());
      p.setHighlightItem(f.getHighlightItem());
      p.setPropertyName(f.getPropertyName());
      p.setPropertyRef(f.getPropertyRef());
      p.setStoreId(f.getStoreId());
      p.setTelephone(f.getTelephone());

      if (!f.getStatusCode().equals(f.getOldStatusCode())) {
        p.setStatusCode(f.getStatusCode());

        p.setStatusChangeDate(new
java.util.Date(System.currentTimeMillis()));
      }


      p.save();
    }
.
.
.

I've got Torque set to debug, but it doesn't output the update statements in
any detail, just the select statements, but I'll take a look at p6spy.

Thanks

Derek


Mime
View raw message