tracker issue : CF-4178506

select a category, or use search below
(searches all categories and all time range)
Title:

The `sqlType` argument in a mappedSuperClass is not being propagated to its inheriting classes

| View in Tracker

Status/Resolution/Reason: To Test//CannotReproduce

Reporter/Name(from Bugbase): Mingo Hagen / Mingo Hagen (Mingo Hagen)

Created: 08/03/2016

Components: ORM Support

Versions: 2016

Failure Type:

Found In Build/Fixed In Build: CF2016_Update2 /

Priority/Frequency: Major / Some users will encounter

Locale/System: ALL / Platforms All

Vote Count: 0

Related Bugs:
CF-4024472 - Similar to
CF-4024472 - Similar to


Problem Description:
A primary key property in a mappedSuperClass will be used by its descendants but its sqlType argument will not.


Steps to Reproduce:
Run files in attachment (using a postgreSQL database)

Comes down to having a primary key property in a mappedSuperClass with sqlType set to "uuid". Add at least two inheriting persistent components that create two tables.

I tested with:
property name="id" generator="uuid" sqlType="uuid";


Actual Result:
Creates two tables:
The first with: id uuid NOT NULL
The second with: id character varying(255) NOT NULL

Which throws an exception on the FK constraint it's trying to make:

Error in executing the DDL.
ERROR: foreign key constraint "fk_rolqfo7wgtqhbgwojlxxg51nf" cannot be implemented 
Detail: Key columns "id" and "id" are of incompatible types: character varying and uuid.


Expected Result:
having the PK adhere to the sqlType set in the mappedSuperClass on all tables generated from components inheriting from it.


Any Workarounds:
Don't have _any_ properties in a mappedSuperClass. Or in this case, don't use sqlType and hope CF matches a datatype that supports the generator in use.

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	4178506

External Customer Info:
External Company:  
External Customer Name: Mingo Hagen
External Customer Email:  
External Test Config: My Hardware and Environment details:

CF2016

Windows 10

IIS

PostgreSQL

Attachments:

  1. August 04, 2016 00:00:00: 1_orm-sqltype.zip

Comments:

I have tried the suggestion but it does not work with UUID type.
Comment by Nimit S.
2055 | March 20, 2017 08:08:25 AM GMT