[#2118] Let Row extend Iterable<Field<?>> - Reverted feature
This commit is contained in:
parent
8576e1d56d
commit
047014fe81
@ -1121,7 +1121,6 @@ class Rows extends Generators {
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
|
||||
import javax.annotation.Generated;
|
||||
|
||||
@ -1145,7 +1144,6 @@ class Rows extends Generators {
|
||||
«ENDFOR»
|
||||
import org.jooq.RowN;
|
||||
import org.jooq.Select;
|
||||
import org.jooq.impl.Factory;
|
||||
|
||||
/**
|
||||
* @author Lukas Eder
|
||||
@ -1336,7 +1334,7 @@ class Rows extends Generators {
|
||||
|
||||
@Override
|
||||
public final Condition equal(Record record) {
|
||||
Row row = new RowImpl(Factory.fields(record.intoArray(), record.fields()));
|
||||
Row row = new RowImpl(Utils.fields(record.intoArray(), record.fields()));
|
||||
return new RowCondition(this, row, Comparator.EQUALS);
|
||||
}
|
||||
«FOR degree : (1..Constants::MAX_ROW_DEGREE)»
|
||||
@ -1433,7 +1431,7 @@ class Rows extends Generators {
|
||||
|
||||
@Override
|
||||
public final Condition notEqual(Record record) {
|
||||
Row row = new RowImpl(Factory.fields(record.intoArray(), record.fields()));
|
||||
Row row = new RowImpl(Utils.fields(record.intoArray(), record.fields()));
|
||||
return new RowCondition(this, row, Comparator.NOT_EQUALS);
|
||||
}
|
||||
«FOR degree : (1..Constants::MAX_ROW_DEGREE)»
|
||||
@ -1534,7 +1532,7 @@ class Rows extends Generators {
|
||||
|
||||
@Override
|
||||
public final Condition lessThan(Record record) {
|
||||
Row row = new RowImpl(Factory.fields(record.intoArray(), record.fields()));
|
||||
Row row = new RowImpl(Utils.fields(record.intoArray(), record.fields()));
|
||||
return new RowCondition(this, row, Comparator.LESS);
|
||||
}
|
||||
«FOR degree : (1..Constants::MAX_ROW_DEGREE)»
|
||||
@ -1631,7 +1629,7 @@ class Rows extends Generators {
|
||||
|
||||
@Override
|
||||
public final Condition lessOrEqual(Record record) {
|
||||
Row row = new RowImpl(Factory.fields(record.intoArray(), record.fields()));
|
||||
Row row = new RowImpl(Utils.fields(record.intoArray(), record.fields()));
|
||||
return new RowCondition(this, row, Comparator.LESS_OR_EQUAL);
|
||||
}
|
||||
«FOR degree : (1..Constants::MAX_ROW_DEGREE)»
|
||||
@ -1728,7 +1726,7 @@ class Rows extends Generators {
|
||||
|
||||
@Override
|
||||
public final Condition greaterThan(Record record) {
|
||||
Row row = new RowImpl(Factory.fields(record.intoArray(), record.fields()));
|
||||
Row row = new RowImpl(Utils.fields(record.intoArray(), record.fields()));
|
||||
return new RowCondition(this, row, Comparator.GREATER);
|
||||
}
|
||||
«FOR degree : (1..Constants::MAX_ROW_DEGREE)»
|
||||
@ -1825,7 +1823,7 @@ class Rows extends Generators {
|
||||
|
||||
@Override
|
||||
public final Condition greaterOrEqual(Record record) {
|
||||
Row row = new RowImpl(Factory.fields(record.intoArray(), record.fields()));
|
||||
Row row = new RowImpl(Utils.fields(record.intoArray(), record.fields()));
|
||||
return new RowCondition(this, row, Comparator.GREATER_OR_EQUAL);
|
||||
}
|
||||
«FOR degree : (1..Constants::MAX_ROW_DEGREE)»
|
||||
@ -1951,7 +1949,7 @@ class Rows extends Generators {
|
||||
|
||||
@Override
|
||||
public final BetweenAndStepN «keyword»(Record record) {
|
||||
RowN row = new RowImpl(Factory.fields(record.intoArray(), record.fields()));
|
||||
RowN row = new RowImpl(Utils.fields(record.intoArray(), record.fields()));
|
||||
return «keyword»(row);
|
||||
}
|
||||
«FOR degree : (1..Constants::MAX_ROW_DEGREE)»
|
||||
@ -2018,7 +2016,7 @@ class Rows extends Generators {
|
||||
RowN[] rows = new RowN[records.length];
|
||||
|
||||
for (int i = 0; i < records.length; i++) {
|
||||
rows[i] = new RowImpl(Factory.fields(records[i].intoArray(), records[i].fields()));
|
||||
rows[i] = new RowImpl(Utils.fields(records[i].intoArray(), records[i].fields()));
|
||||
}
|
||||
|
||||
return in(rows);
|
||||
@ -2054,7 +2052,7 @@ class Rows extends Generators {
|
||||
RowN[] rows = new RowN[records.length];
|
||||
|
||||
for (int i = 0; i < records.length; i++) {
|
||||
rows[i] = new RowImpl(Factory.fields(records[i].intoArray(), records[i].fields()));
|
||||
rows[i] = new RowImpl(Utils.fields(records[i].intoArray(), records[i].fields()));
|
||||
}
|
||||
|
||||
return notIn(rows);
|
||||
@ -2164,15 +2162,6 @@ class Rows extends Generators {
|
||||
public final Condition overlaps(Row2<T1, T2> row) {
|
||||
return new RowOverlapsCondition(this, row);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// XXX: Other
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
@Override
|
||||
public final Iterator<Field<?>> iterator() {
|
||||
return fields.iterator();
|
||||
}
|
||||
}
|
||||
''');
|
||||
|
||||
|
||||
@ -44,7 +44,7 @@ package org.jooq;
|
||||
*
|
||||
* @author Lukas Eder
|
||||
*/
|
||||
public interface Row extends QueryPart, Iterable<Field<?>> {
|
||||
public interface Row extends QueryPart {
|
||||
|
||||
/**
|
||||
* Get the degree of this row value expression
|
||||
|
||||
@ -543,7 +543,7 @@ abstract class AbstractRecord extends AbstractStore implements Record {
|
||||
try {
|
||||
boolean useAnnotations = hasColumnAnnotations(type);
|
||||
|
||||
for (Field<?> field : fields) {
|
||||
for (Field<?> field : fields.fields) {
|
||||
List<java.lang.reflect.Field> members;
|
||||
Method method;
|
||||
|
||||
@ -603,7 +603,7 @@ abstract class AbstractRecord extends AbstractStore implements Record {
|
||||
* public for broader use...?
|
||||
*/
|
||||
protected final void from(Record source) {
|
||||
for (Field<?> field : fields) {
|
||||
for (Field<?> field : fields.fields) {
|
||||
Field<?> sourceField = source.field(field);
|
||||
|
||||
if (sourceField != null) {
|
||||
|
||||
@ -39,7 +39,6 @@ import static org.jooq.impl.Factory.row;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
|
||||
import javax.annotation.Generated;
|
||||
|
||||
@ -9557,13 +9556,4 @@ implements
|
||||
public final Condition overlaps(Row2<T1, T2> row) {
|
||||
return new RowOverlapsCondition(this, row);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// XXX: Other
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
@Override
|
||||
public final Iterator<Field<?>> iterator() {
|
||||
return fields.iterator();
|
||||
}
|
||||
}
|
||||
|
||||
@ -87,7 +87,7 @@ public class UpdatableRecordImpl<R extends UpdatableRecord<R>> extends TableReco
|
||||
public Record key() {
|
||||
RecordImpl result = new RecordImpl(getPrimaryKey().getFields());
|
||||
|
||||
for (Field<?> field : result.fields) {
|
||||
for (Field<?> field : result.fields.fields) {
|
||||
result.setValue(field, getValue0(field));
|
||||
}
|
||||
|
||||
@ -240,7 +240,7 @@ public class UpdatableRecordImpl<R extends UpdatableRecord<R>> extends TableReco
|
||||
* Set all changed values of this record to a store query
|
||||
*/
|
||||
private final void addChangedValues(StoreQuery<R> query) {
|
||||
for (Field<?> field : fields) {
|
||||
for (Field<?> field : fields.fields) {
|
||||
if (getValue0(field).isChanged()) {
|
||||
addValue(query, field);
|
||||
}
|
||||
@ -384,7 +384,7 @@ public class UpdatableRecordImpl<R extends UpdatableRecord<R>> extends TableReco
|
||||
|
||||
// Copy all fields. This marks them all as isChanged, which is important
|
||||
List<TableField<R, ?>> key = getPrimaryKey().getFields();
|
||||
for (Field<?> field : fields) {
|
||||
for (Field<?> field : fields.fields) {
|
||||
|
||||
// Don't copy key values
|
||||
if (!key.contains(field)) {
|
||||
@ -448,7 +448,7 @@ public class UpdatableRecordImpl<R extends UpdatableRecord<R>> extends TableReco
|
||||
throw new DataChangedException("Database record no longer exists");
|
||||
}
|
||||
|
||||
for (Field<?> field : fields) {
|
||||
for (Field<?> field : fields.fields) {
|
||||
Value<?> thisValue = getValue0(field);
|
||||
Value<?> thatValue = ((AbstractRecord) record).getValue0(field);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user