예제 #1
0
 /** Retrieve colour for current provider first by querying property table */
 public String getColour() {
   PropertyDao dao = SpringUtils.getBean(PropertyDao.class);
   List<Property> props = dao.findByNameAndProvider(strColName, provider);
   for (Property prop : props) {
     return prop.getValue();
   }
   return "";
 }
예제 #2
0
  /** set colour in property table */
  public boolean setColour(String c) {
    PropertyDao dao = SpringUtils.getBean(PropertyDao.class);
    List<Property> props = dao.findByNameAndProvider(strColName, provider);
    Property property = null;
    for (Property p : props) {
      property = p;
      break;
    }

    if (property == null) {
      property = new Property();
    }

    property.setValue(c);
    property.setName(strColName);
    property.setProviderNo(provider);

    dao.saveEntity(property);

    return true;
  }