super(oprop);
}
protected Any (Attribute... field) {
-// ----------------------------------
for (int i=0; i<field.length; i++) {
if (field[i] == null) continue; // Happen when newing an Any object without property
if (field[i].getFrom().equals(this)) getAttributes().add(field[i]);
// ==============================================================================================================================
public Attribute getAttribute (Class<? extends Attribute> type) {
-// ---------------------------------------------------------------
for (Iterator<Attribute> i=getAttributes().iterator(); i.hasNext(); ) {
Attribute field = i.next();
if (field.getClass().equals(type)) return field;
// ==============================================================================================================================
protected boolean removeAttribute (Attribute field) {
-// ---------------------------------------------------
for (Iterator<Attribute> i=getAttributes().iterator(); i.hasNext(); ) {
if (!i.next().equals(field)) continue;
i.remove();
- //RKV if (this.isSaved()) Database.getCurSession().update(this);
return true;
}
return false;
}
public boolean setAttribute (Attribute field) {
-// ------------------------------------------------
Class<?> type = field.getClass();
-//RKV Session session = Database.getCurSession();
if (!field.getFrom().equals(this)) return false;
for (Iterator<Attribute> i=getAttributes().iterator(); i.hasNext(); ) {
break;
}
getAttributes().add(field);
- //RKVif (this.isSaved()) {
- //RKV if (!field.isSaved()) session.save(field);
- //RKV session.update(this);
- //RKV} // Else, when saving this, Hibernate will propagate the operation
return true;
}
/**