tracker issue : CF-3180344

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

EntityToQuery Unknown Data Type for Bit Fields

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/

Reporter/Name(from Bugbase): Joel Watson / Joel Watson (existdissolve)

Created: 05/02/2012

Components: ORM Support

Versions: 9.0.1

Failure Type:

Found In Build/Fixed In Build: 9.0.1 /

Priority/Frequency: Trivial / Unknown

Locale/System: English / Windows 7

Vote Count: 2

Problem Description: When using EntityToQuery(), bit columns are converted to an "UNKNOWN" data type. When trying to use the named column in a Query of Queries (e.g., select mybitcolumn from thequery), the following error occurs: "Query Of Queries runtime error. Unsupported SQL type java.sql.Types.UNKNOWN."

Steps to Reproduce: 

1.) Create an ORM entity: 

component persistent="true" entityname="Test" table="Test" {
	property name="TestID" column="TestID" fieldtype="id" generator="guid";
	property name="ActionDate" column="ActionDate" type="timestamp";	
	property name="BitFlag" column="BitFlag";
}

2.) Load the entity, and convert to query with EntityToQuery()
3.) View metadata of query: writedump( getmetadata( entitytoquery(myentity ) ) ) ... notice that the bit field has a TypeName of "UNKNOWN" 
4.) Try to perform a Query of Queries on the result of EntityToQuery, and explicitly include the name of the Bit column in the select list (problem doesn't occur when "*" is used)

Actual Result: "Query Of Queries runtime error. Unsupported SQL type java.sql.Types.UNKNOWN."

Expected Result: Result of EntityToQuery should properly identify the data type of the Bit column, after which the Query of Query mentioned above will work as expected.

Any Workarounds: The only workaround would seem to be to manually build the query result, not using the EntityToQuery() method whatsoever.

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

Watson Bug ID:	3180344

External Customer Info:
External Company:  
External Customer Name: existdissolve
External Customer Email:  
External Test Config: Windows 7, SQL Server 2008

Attachments:

Comments:

In the QoQ, casting the bit column has no effect. In the entity mapping, explicitly specifying the type, ormtype, etc. has no effect
Comment by External U.
19566 | May 02, 2012 11:47:23 AM GMT
We use bit fields for many scenarios. This bug keeps us from easily dumping data into spreadsheets, CSVs, etc.
Vote by External U.
19569 | May 03, 2012 08:08:46 AM GMT
Yes, this should be fixed. Is this 25 char long yet?
Vote by External U.
19570 | May 03, 2012 04:25:44 PM GMT
This is working fine with MSSQLServer. Please let us know the database you are using.
Comment by Himavanth R.
19567 | June 14, 2012 07:59:20 AM GMT
No reply in over a month. Closing this for now. Please send a note if there is any update and we will re-open this bug.
Comment by Himavanth R.
19568 | July 26, 2012 07:58:48 AM GMT