[#1199] Table.getFields() returns an internal representation of a table's field list. Make generated tables immutable instead!
This commit is contained in:
parent
d511a29230
commit
700d88bb08
@ -62,7 +62,8 @@ public interface UpdatableTable<R extends Record> extends Updatable<R>, Table<R>
|
||||
* Retrieve all of the table's unique keys.
|
||||
*
|
||||
* @return All keys. This is never <code>null</code> or empty, because
|
||||
* {@link UpdatableTable}'s always have at least one key.
|
||||
* {@link UpdatableTable}'s always have at least one key. This
|
||||
* method returns an unmodifiable list.
|
||||
*/
|
||||
List<UniqueKey<R>> getKeys();
|
||||
|
||||
@ -73,7 +74,8 @@ public interface UpdatableTable<R extends Record> extends Updatable<R>, Table<R>
|
||||
* @param <O> The other table's record type
|
||||
* @param other The other table of the foreign key relationship
|
||||
* @return Some other table's <code>FOREIGN KEY</code>'s towards an this
|
||||
* table. This is never <code>null</code>.
|
||||
* table. This is never <code>null</code>. This method returns an
|
||||
* unmodifiable list.
|
||||
*/
|
||||
<O extends Record> List<ForeignKey<O, R>> getReferencesFrom(Table<O> other);
|
||||
|
||||
|
||||
@ -35,6 +35,7 @@
|
||||
*/
|
||||
package org.jooq.impl;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.jooq.AliasProvider;
|
||||
@ -60,7 +61,7 @@ abstract class AbstractType<R extends Record> extends AbstractSchemaProviderQuer
|
||||
|
||||
@Override
|
||||
public final List<Field<?>> getFields() {
|
||||
return getFieldList();
|
||||
return Collections.unmodifiableList(getFieldList());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Loading…
Reference in New Issue
Block a user