Skip to content
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

Plain SQL queries should read the ResultSetMetaData.getTableName() property if it is available, and produce DSL.field(Name) for better disambiguation #4283

Closed
lukaseder opened this issue May 15, 2015 · 0 comments

Comments

@lukaseder
Copy link
Member

As reported by a jOOQ user in a private message:

        // when
        Result<Record> result = getDSL()
                .select()
                .from("sys_user")
                .join("sys_user_group")
                .on(field("sys_user_group.user_id").equal(field("sys_user.id"))
                )
                .fetch();

        //then
        Record record = result.get(0);
        assertTrue(record.size() > 0);

        System.out.println(record.field(name("schema", "sys_user_group", "id")));
        System.out.println(record.field(name("schema", "sys_user", "id")));
        System.out.println(record.field(name("id")));

We should add Record.field(Name) methods, where org.jooq.Name arguments can be passed to contain fully qualified column names.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant