[hibernate-dev] HHH-8944 - ColumnTransformer handling is too aggressive in qualifying "column names"

Steve Ebersole steve at hibernate.org
Thu Apr 12 09:55:58 EDT 2018


https://github.com/hibernate/hibernate-orm/pull/2237

On Thu, Apr 12, 2018 at 7:45 AM Steve Ebersole <steve at hibernate.org> wrote:

> Anyone know of places where we document ColumnTransformer read-fragment
> handling as qualifying columns other than the column the transformer is
> attached to?  E.g., consider:
>
> @Column( name="dob" )
> @ColumnTransformer( read="SYSDATE - dob / 365", ... )
> public int getAge() { ... }
>
> Currently, Hibernate will try to qualify both "SYSDATE" and "dob" with
> table alias.  The simple fix is to simply limit the qualification to the
> column that the transformer is attached to ("dob").  Just want to make sure
> that we do not document anywhere that multiple column references will all
> be replaced.  E.g. (contrived):
>
> @Column( name="dob" )
> @ColumnTransformer( read="(SYSDATE - dob / 365) + offset", ... )
> public int getAge() { ... }
>
> The question is whether both "dob" and "offset" columns will get
> qualified.  Allowing this is much more involved, requiring that we somehow
> allow configuration of all the referenced columns that should be qualified
> (which has its own set of difficulties when it comes to multi-table
> structures).
>
> I propose the simple solution, unless there are any objections
>


More information about the hibernate-dev mailing list