Package org.xorm.datastore

Examples of org.xorm.datastore.Row


    }

    /** Initializes or retrieves the working Row. */
    public Row getRow() {
        if (row == null) {
            row = new Row(mapping.getTable());
            initDefaultValues();
        }
        return row;
    }
View Full Code Here


                    }
                    if (otherHandler.isHollow()) {
                        otherHandler.refresh(otherHandler.txn.getInterfaceManager());
                    }
                   
                    Row myRow = row;
                    Row otherRow = otherHandler.row;
                    if (!row.equals(otherHandler.row)) {
                        return false;
                    }
                    // TODO check relationships?
                    return true;
View Full Code Here

                    }
                }
            }
        }

        Row theRow = getRow();
        // Gotta see if we're dealing with a cached instance of the Row
        if (theRow.isCached()) {
            // Yep, let's not modify that instance...now we need to clone.
            theRow = (Row)theRow.clone();
            // Make sure the cached flag is set to false on our copy
            theRow.setCached(false);
            // Update our instance variable or whatever
            setRow(theRow);
        }

        if (txn != null && txn.isActive() && !isDirty()) {
            makeDirty();
        }
        theRow.setValue(c,value);
    }
View Full Code Here

            // Column fault: column was not in default fetch group
            DataFetchGroup dfg = new DataFetchGroup();
            dfg.addColumn(c);
            if (getRow().isCached()) {
                // We need to clone the row so we don't modify the cached Row
                Row theRow = (Row)getRow().clone();
                theRow.setCached(false);
                setRow(theRow);
            }
            txn.getInterfaceManager().refreshColumns(getRow(), dfg);
        }
        Object value = getRow().getValue(c);
View Full Code Here

  if (xmlResults == null) return rows;  // no results

  Iterator i = xmlResults.iterator();
  while (i.hasNext()) {
      Element element = (Element) i.next();
      Row row = new Row(table);
      populate(row, element);
      rows.add(row);
  }
  return rows;
    }
View Full Code Here

        ArrayList list = new ArrayList();
        if (selector.getCondition() instanceof SimpleCondition) {
            SimpleCondition condition = (SimpleCondition) selector.getCondition();
            Table table = selector.getTable();
            Object primaryKey = condition.getValue();
            Row found = factory.getCache().get(table, primaryKey);
            if (found != null) {
                list.add((Row) found.clone());
            }
        }
        return list;
    }
View Full Code Here

         *   that are not instances of org.xorm.Row.
         */
        public void addAll(Collection rows) {
            Iterator i = rows.iterator();
            while (i.hasNext()) {
                Row row = (Row) i.next();
                add(row);
            }
        }
View Full Code Here

        if (primaryKey instanceof TransientKey) {
            return null;
        }

        // Return hollow object
        Row row = new Row(classMapping.getTable(), primaryKey);
        proxy = rowToProxy(classMapping, row);
        return proxy;
    }
View Full Code Here

    void addToCache(Collection rows) {
        DataCache cache = factory.getCache();
        if (cache != null) {
            Iterator i = rows.iterator();
            while (i.hasNext()) {
                Row row = (Row) i.next();
                // Don't need to clone anymore...cached flag instead
                //cache.add((Row) row.clone());
                cache.add(row);
            }
        }
View Full Code Here

    }

    Row getFromCache(Table table, Object primaryKey) {
        DataCache cache = factory.getCache();
        if (cache != null) {
            Row row = cache.get(table, primaryKey);
            return row;
        } else {
            return null;
        }
    }
View Full Code Here

TOP

Related Classes of org.xorm.datastore.Row

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.