public interface FieldLike
Modifier and Type | Method and Description |
---|---|
<T> Field<T> |
asField()
The underlying field representation of this object.
|
<T> Field<T> |
asField(java.util.function.Function<? super Field<T>,? extends java.lang.String> aliasFunction)
The underlying field representation of this object.
|
<T> Field<T> |
asField(java.lang.String alias)
The underlying field representation of this object.
|
<T> Field<T> asField()
This method is useful for things like
SELECT y.*, (SELECT a FROM x) FROM y
<T> Field<T> asField(java.lang.String alias)
This method is useful for things like
SELECT y.*, (SELECT a FROM x) [alias] FROM y
Note that the case-sensitivity of the returned field depends on
Settings.getRenderNameStyle()
. By default, field aliases are
quoted, and thus case-sensitive!
@Support <T> Field<T> asField(java.util.function.Function<? super Field<T>,? extends java.lang.String> aliasFunction)
This method is useful for things like
SELECT y.*, (SELECT a FROM x) [alias] FROM y
Note that the case-sensitivity of the returned field depends on
Settings.getRenderNameStyle()
. By default, field aliases are
quoted, and thus case-sensitive!
This works like asField(String)
, except that field aliases are
provided by a function. This is useful, for instance, to prefix all
columns with a common prefix (on Table.as(String, Function)
):
MY_TABLE.as("t1", f -> "prefix_" + f.getName());
And then to use the same function also for individual fields:
MY_TABLE.MY_COLUMN.as(f -> "prefix_" + f.getName());
Copyright © 2018. All Rights Reserved.