Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: jOOQ/jOOQ
...
head fork: jOOQ/jOOQ
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 3 files changed
  • 0 commit comments
  • 1 contributor
View
39 jOOQ-test/src/org/jooq/test/_/testcases/JoinTests.java
@@ -96,6 +96,29 @@ public JoinTests(jOOQAbstractTest<A, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, I
}
@Test
+ public void testJoinDuplicateFieldNames() throws Exception {
+
+ // [#783] Result holds wrong data when tables in a cartesian self
+ // product (or self cross join) are not aliased
+ // --------------------------------------------
+
+ // This query selects two different ID fields. It should be possible
+ // to extract both from the resulting records
+ Result<?> result =
+ create().select()
+ .from(TAuthor())
+ .join(TBook()).on(TAuthor_ID().equal(TBook_AUTHOR_ID()))
+ .crossJoin(create().select(one().as("one")))
+ .orderBy(TBook_ID())
+ .fetch();
+
+ assertEquals(4, result.size());
+ assertEquals(BOOK_AUTHOR_IDS, result.getValues(TAuthor_ID()));
+ assertEquals(BOOK_AUTHOR_IDS, result.getValues(TBook_AUTHOR_ID()));
+ assertEquals(BOOK_IDS, result.getValues(TBook_ID()));
+ }
+
+ @Test
public void testJoinQuery() throws Exception {
SimpleSelectQuery<L> q1 = create().selectQuery(VLibrary());
@@ -237,6 +260,22 @@ public void testCrossJoin() throws Exception {
assertEquals(Integer.valueOf(1), result.getValue(0, 1));
assertEquals(Integer.valueOf(1), result.getValue(1, 0));
assertEquals(Integer.valueOf(2), result.getValue(1, 1));
+
+ // [#783] Unqualified (unaliased) self-joins
+ result =
+ create().select()
+ .from(TAuthor().as("x"))
+ .crossJoin(TAuthor())
+ .orderBy(1, 1 + TAuthor().getFields().size())
+ .fetch();
+
+ assertEquals(4, result.size());
+ assertEquals(
+ asList(1, 1, 2, 2),
+ result.getValues(0, Integer.class));
+ assertEquals(
+ asList(1, 2, 1, 2),
+ result.getValues(0 + TAuthor().getFields().size(), Integer.class));
}
@Test
View
5 jOOQ-test/src/org/jooq/test/jOOQAbstractTest.java
@@ -1194,6 +1194,11 @@ public void testOrderByIndirection() throws Exception {
}
@Test
+ public void testJoinDuplicateFieldNames() throws Exception {
+ new JoinTests(this).testJoinDuplicateFieldNames();
+ }
+
+ @Test
public void testJoinQuery() throws Exception {
new JoinTests(this).testJoinQuery();
}
View
4 jOOQ-website/community.php
@@ -62,6 +62,10 @@ function printContent() {
<li>If you are a committer on sourceforge, please commit with the following comment scheme: <br/>[#Trac-ID] Trac-Ticket-Title - Your specific comment</li>
</ul>
+<h3>Hints for new features</h3>
+
+<p>A lot of ideas are around already. Check out this <a href="https://sourceforge.net/apps/trac/jooq/query?milestone=Version+X%3A+User+contribution+candidates">Trac Milestone</a> to see some of them</p>
+
<h3>Hints for new database integrations</h3>
<p>Should you wish to provide an extension/support for a new RDBMS (such as Informix, Firebird, etc) your work would consist of these steps:</p>

No commit comments for this range

Something went wrong with that request. Please try again.