deanlaw / cfcgenerator

Automatically exported from code.google.com/p/cfcgenerator
8 stars 6 forks source link

Not working properly with Oracle 12C #73

Open murpg opened 8 years ago

murpg commented 8 years ago

Hi Dean, thanks for your work on this. Currently I am working on converting this to cfscript. So far I have had very good results. When I create beans I am getting multiple properties, getters and setters with the beans. This is only happening with Oracle 12. Here is a sample code of what I am getting. My question to you is what file needs modification to stop this?

`

    <cfproperty name="id" type="string" default="" />
    <cfproperty name="id" type="string" default="" />
    <cfproperty name="id" type="string" default="" />
    <cfproperty name="id" type="string" default="" />
    <cfproperty name="id" type="string" default="" />
    <cfproperty name="id" type="string" default="" />
    <cfproperty name="severity" type="string" default="" />
    <cfproperty name="severity" type="string" default="" />
    <cfproperty name="category" type="string" default="" />
    <cfproperty name="category" type="string" default="" />
    <cfproperty name="logdate" type="date" default="" />
    <cfproperty name="logdate" type="date" default="" />
    <cfproperty name="appendername" type="string" default="" />
    <cfproperty name="appendername" type="string" default="" />
    <cfproperty name="message" type="string" default="" />
    <cfproperty name="message" type="string" default="" />
    <cfproperty name="extrainfo" type="string" default="" />
           <cfproperty name="extrainfo" type="string" default="" />`
murpg commented 8 years ago

The fix for this is in Oracle.cfc. The query qTable is returning multiple rows. I fixed this by doing a query of queries. select distinct column_name, default, identity, length, nullable, type_name from qTable order by column_id

sample-bean.txt

deanlaw commented 8 years ago

Hi George,

I have been traveling the last few days, so my apologies for not responding sooner. I do not have access to Oracle 12C to test this myself, so could you help me? Can you please add the following line to the qTable query in the com/cf/model/datasource/oracle.cfc file and let me know if it fixes the issue?

'AND col.owner = USER' (minus the quotes)

This would go right before the order by clause (line 227). Also make sure that you comment out your QoQ workaround.

Thanks.