public Object loadProjection(JDBCStore store, JDBCFetchConfiguration fetch, Result res, Joins joins) throws SQLException { return res.getString(field.getColumns()[0], joins); }
public Object loadProjection(JDBCStore store, JDBCFetchConfiguration fetch, Result res, Joins joins) throws SQLException { return load(field.getColumns()[0], res, joins); }
public int select(Select sel, OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, int eagerMode) { sel.select(field.getColumns()[0], field.join(sel)); return 1; }
public Object toDataStoreValue(Object val, JDBCStore store) { if (val != null) return val; if (field.getNullValue() != FieldMapping.NULL_DEFAULT) return null; if (field.getColumns()[0].getDefaultString() != null) return null; // honor the user's null-value=default return ""; }
public int select(Select sel, OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, int eagerMode) { sel.select(field.getColumns()[0], field.join(sel)); return 1; }
protected Object getValue(OpenJPAStateManager sm) { String s = sm.fetchString(field.getIndex()); if (s == null || (s.length() > _maxSize && !field.getColumns()[0].isNotNull())) { return null; } return s; } }
public void where(OpenJPAStateManager sm, JDBCStore store, RowManager rm, Object prevValue) throws SQLException { Row row = field.getRow(sm, store, rm, Row.ACTION_UPDATE); if (row == null) return; Column col = field.getColumns()[0]; if (prevValue == null) row.whereNull(col); else row.whereString(col, prevValue.toString()); }
public void appendIsNotNull(SQLBuffer sql, Select sel, Joins joins) { joins = join(joins, false); sql.append(sel.getColumnAlias(field.getColumns()[0], joins)). append(" IS NOT ").appendValue(null, field.getColumns()[0]); }
public void appendIsNull(SQLBuffer sql, Select sel, Joins joins) { joins = join(joins, false); sql.append(sel.getColumnAlias(field.getColumns()[0], joins)). append(" IS ").appendValue(null, field.getColumns()[0]); }
public void appendIsNotNull(SQLBuffer sql, Select sel, Joins joins) { joins = join(joins, false); sql.append(sel.getColumnAlias(field.getColumns()[0], joins)). append(" IS NOT ").appendValue(null, field.getColumns()[0]); }
public Column[] getColumns() { if (_cols.length != 0) return _cols; if (_fk != null) return _fk.getColumns(); if (getValueMappedBy() != null) return getValueMappedByMapping().getColumns(); return _cols; }
public int select(Select sel, OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, int eagerMode) { if (sel.isDistinct() || eagerMode == JDBCFetchConfiguration.EAGER_NONE) return -1; sel.select(field.getColumns()[0], field.join(sel)); return 1; }
public int select(Select sel, OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, int eagerMode) { if (sel.isDistinct() || eagerMode == JDBCFetchConfiguration.EAGER_NONE) return -1; sel.select(field.getColumns()[0], field.join(sel)); return 1; }
public Column[] getColumns() { if (_cols.length != 0) return _cols; if (_fk != null) return _fk.getColumns(); if (getValueMappedBy() != null) return getValueMappedByMapping().getColumns(); return _cols; }
public int select(Select sel, OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, int eagerMode) { if (field.getJoinDirection() == field.JOIN_INVERSE) return -1; // already cached oid? if (sm != null && sm.getIntermediate(field.getIndex()) != null) return -1; if (!Boolean.TRUE.equals(_fkOid)) return -1; sel.select(field.getColumns(), field.join(sel)); return 0; }
public void load(OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, Result res) throws SQLException { Column col = field.getColumns()[0]; if (res.contains(col)) sm.store(field.getIndex(), load(col, res, null)); }
public void order(Select sel, ClassMapping elem, Joins joins) { FieldMapping fm = _fm; if (elem != null) { fm = getOrderByField(elem, fm); if (fm == null) fm = elem.getFieldMapping(_fm.getIndex()); } sel.orderBy(fm.getColumns(), _asc, joins, false); }
protected Object getValue(OpenJPAStateManager sm) { byte[] b = (byte[]) sm.getImplData(field.getIndex()); if (b == null || (b.length > _maxSize && !field.getColumns()[0].isNotNull())) return null; sm.setImplData(field.getIndex(), null); DBDictionary.SerializedData dat = new DBDictionary.SerializedData(b); return dat; } }
private void appendXmlExtractValue(SQLBuffer buf, FilterValue val) { buf.append("extractValue("). append(val.getColumnAlias( val.getFieldMapping().getColumns()[0])). append(",'/*/"); val.appendTo(buf); buf.append("')"); }
private Select createSelect(OpenJPAStateManager sm, JDBCStore store) { Select sel = store.getSQLFactory().newSelect(); sel.select(field.getColumns()[0]); sel.selectPrimaryKey(field.getDefiningMapping()); sel.wherePrimaryKey (sm.getObjectId(), field.getDefiningMapping(), store); sel.setLob(true); return sel; }