-
Notifications
You must be signed in to change notification settings - Fork 356
Support for inline queries #1018
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
`InlineQuery` can be used whereever a `Table` was used up to now. ``` Table one = ...; Select select = Select.builder() .select(one.column("id"), employee.column("name")) .from(one) .build(); InlineQuery inline = InlineQuery.create(select, "inline"); Select select = Select.builder() .select(inline.column("id"), inline.column("name")) .from(inline) .build(); ``` Join and From renderer now use the same FromTableVisitor. Also the SelectListVisitor reuses now the ExpressionVisitor. Fixes #1003
* prefix a {@link Column}. | ||
* <p/> | ||
* Renders to: {@code <name>} or {@code <name> AS <name>}. | ||
* | ||
* @author Mark Paluch | ||
* @since 1.1 | ||
*/ | ||
public class Table extends AbstractSegment { | ||
public class Table extends AbstractSegment implements TableLike { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extraneous space before Table
.
* @author Jens Schauder | ||
* @Since 2.3 | ||
*/ | ||
public interface TableLike extends Segment { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The whole name TableLike
sounds weird to me. It's as if this is a "like" a Table
but not quite. And your almost defining an interface in light of a concrete impl below it.
Feels as if this interface should be the core type Table
and the concrete instance below it needs a qualifier embedded into its name. Perhaps class SegmentedTable extends AbstractSegment implements Table
I realize we are trying to come up with a class hierarchy that aligns our types against definitions pursuant to a relational database. Just a thought.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's as if this is a "like" a Table but not quite.
But that is exactly what it is: It is used just like a table, but it might not be one.
SegmentedTable
to me sounds like "partitioned table" or something :-/
* | ||
* @author Jens Schauder | ||
*/ | ||
public class TestFrom extends From{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Insert space before {
Fixed the spaces issue. |
`InlineQuery` can be used wherever a `Table` was used up to now. ``` Table one = ...; Select select = Select.builder() .select(one.column("id"), employee.column("name")) .from(one) .build(); InlineQuery inline = InlineQuery.create(select, "inline"); Select select = Select.builder() .select(inline.column("id"), inline.column("name")) .from(inline) .build(); ``` Join and From renderer now use the same FromTableVisitor. Also the SelectListVisitor reuses now the ExpressionVisitor. Fixes #1003 Original pull request: #1018.
That's merged and polished now. |
InlineQuery
can be used wherever aTable
was used up to now.Join
andFrom
renderer now use the sameFromTableVisitor
.Also the
SelectListVisitor
reuses now theExpressionVisitor
.Fixes #1003