All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.viaoa.hub.HubDatax Maven / Gradle / Ivy

The newest version!
/*  Copyright 1999 Vince Via [email protected]
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
*/
package com.viaoa.hub;

import java.lang.reflect.Method;
import java.util.Hashtable;
import java.util.Vector;

import com.viaoa.datasource.OASelect;
import com.viaoa.object.OAObjectInfo;

/**
 * Internally used by Hub to store objects. Shared Hubs will use this same object.
* A Vector and Hashtable are used to store the objects. */ public class HubDatax implements java.io.Serializable { static final long serialVersionUID = 1L; // used for object serialization public boolean isNeeded() { if (sortProperty != null) { return true; } if (!sortAsc) { return true; } if (uniqueProperty != null) { return true; } if (vecAdd != null && vecAdd.size() > 0) { return true; } if (vecRemove != null && vecRemove.size() > 0) { return true; } if (sortListener != null) { return true; } if (select != null && select.hasMore()) { return true; } if (refresh) { return true; } if (hashProperty != null && hashProperty.size() > 0) { return true; } if (selectOrder != null) { return true; } if (autoSequence != null) { return true; } if (autoMatch != null) { return true; } if (selectWhereHub != null) { return true; } return false; } public boolean shouldSerialize() { if (sortProperty != null) { return true; } if (!sortAsc) { return true; } if (uniqueProperty != null) { return true; } if (bTrackChanges) { return true; } return false; } /** * Counter that is incremented when a new list of objects is loaded. Incremented by select, setSharedHub, and when detail hubs list is * changed to match the master hub's activeObject.
* This can be used to know if a hub has been changed without requiring the set up of a HubListener. *

* This is used by JSP components to know if a frame should be updated.
* See com.viaoa.html.OATable and com.viaoa.html.OANav */ // protected transient int newListCount; // If bTrackChanges is true, then all objects that are added to Hub are added to this vector. protected transient Vector vecAdd; // only for OAObjects // If bTrackChanges is true, then all objects that are removed from Hub are added to this vector. protected transient Vector vecRemove; // only for OAObjects protected transient HubSortListener sortListener; // info to keep Hub objects sorted when sent to other computers, see HubSerializerDelegate._readResolve - it will set up sorting when received protected String sortProperty; // defaults to linkInfo.sortProperty protected boolean sortAsc = true; // Used to select objects from OADataSource. protected transient OASelect select; /** * Flag used by Hub.setFresh() so that active objects are always refreshed from datasource. *

* Note: this is not implemented. */ protected boolean refresh = false; // Name of property that must be unique for all objects in the Hub. protected String uniqueProperty; protected transient Method uniquePropertyGetMethod; protected transient boolean disabled; /** true if this is for a OAObject */ protected boolean oaObjectFlag; /** * flag set to know if objects can be added or removed. This is false when a detail hub is from an array or non-Hub. Default is true. */ protected boolean dupAllowAddRemove = true; /** OAObjectInfo for the Class of objects in this Hub. */ protected transient OAObjectInfo objectInfo; // /** Misc name/values pairs stored in this Hub. Name is case insensitive. */ protected Hashtable hashProperty; /** property path(s) used for selectOrder */ protected String selectOrder; /** used to update property in objects to match its position within Hub */ protected transient HubAutoSequence autoSequence; /** makes sure that this Hub will have an object with a reference for each object in another Hub. */ protected transient HubAutoMatch autoMatch; // Flag to know if add/insert/remove objects should be tracked. see also datam.getTrackChanges() protected boolean bTrackChanges; // 20200302 /** * Hub and property[Path] used for OASelect.whereHub & propertyFromWhereObject */ protected transient Hub selectWhereHub; /** * Property[Path] from selectWhereHub to this Hub. ex: from hubCompany, this.hub=campaigns, [hubCompany] "clients.products.campaigns" */ protected transient String selectWhereHubPropertyPath; }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy