I am new to JOOQ and was looking to use it strictly as a query builder (I
already have a spring jdbc implementation, but having to manage a bunch of
giant query strings can be painful). I am having one issue that is throwing
me off though: Generated queries use the field alias in the Where clause,
which of course will not work. For example:
Factory factory = new SybaseFactory();
Field<String> myField =
SybaseFactory.field("myField",SybaseDataType.VARCHAR).as("myAlias");
System.out.println(factory.select(myField).from("myTable").where(myField.equal("someString")).getSQL(true));
Produces:
select myField [myAlias] from myTable where [myAlias] = 'someString'
Is there any way to have the real column name used in the Where clause?
Perhaps something akin to 'myField.realName().equal("someString")'