AR empty values

5 views
Skip to first unread message

Sana

unread,
Aug 31, 2008, 1:46:47 PM8/31/08
to DataFaucet ORM
AR does not populate child table values when same column name in both
tables.

PARENT: <cfset setTable("tItem") />
CHILD: <cfset addTable(table = "tConent", column="ItemID",
references="ItemID") />

ar.getProperties() will show values from parent table and rest of
child properties values are empty.

Please could you fix this ASAP, its been headache to figure out what
could be wrong.

Thanks

Isaac Dealey

unread,
Sep 1, 2008, 1:20:27 AM9/1/08
to dataf...@googlegroups.com
Thans Sana, I'll be looking into this tomorrow.


--
[ ike ] founder - DataFaucet ORM

phone: 781.769.0723

http://www.datafaucet.com


Isaac Dealey

unread,
Sep 1, 2008, 10:48:31 PM9/1/08
to dataf...@googlegroups.com
Hi Sana,

I've been trying to reproduce the problem you described and seem to be
unable to in my environment...

I've got these 2 CFCs

item.cfc
<cfcomponent extends="datafaucet.system.activerecord">


<cfset setTable("tItem") />

</cfcomponent>

And content.cfc
<cfcomponent extends="item">
<cfset addTable(table = "tContent",

column="ItemID", references="ItemID") />

</cfcomponent>

I left these deliberately simple to try and isolate the issue and I made
sure there's no foreign key constraint between the tItem and tContent
tables. The tItem table has an itemName column and the tContent table
has a ContentText column so that I would be certain there was data
coming from both tables.

I'm able to create a content object using

CreateObject("component","content")

I then set the datasource and/or initialize the object and am able to
perform an update() to place data into the table. Once the update has
been performed I've checked to make sure it all got into both tables and
I can see that the getProperties() result shows all the column data
including the newly created primary key

Then I created a new content component to make sure it didn't have any
residual state from the previous object, output the content of
getProperties() to make sure it was empty, then attempted to read that
record in two ways, first via .read(itemid) and next via
init(datasource=ds,objectid=itemid). After both of those methods, the
result of getProperties() shows both the itemName and the ContentText so
it's reading data from both tables

Any more information you could give me would be helpful.

Thanks Sana :)

Sana

unread,
Sep 2, 2008, 2:30:09 PM9/2/08
to DataFaucet ORM
Hi Isaac,

Finally I found why values are empty, if column value is this
"FA9E2857-30BD-B5E8-D755CB8A867B3F75"

due to some reason datafaucet does something strange when value UUID

Thanks

Isaac Dealey

unread,
Sep 2, 2008, 3:25:59 PM9/2/08
to dataf...@googlegroups.com
> Hi Isaac,
>
> Finally I found why values are empty, if column value is this
> "FA9E2857-30BD-B5E8-D755CB8A867B3F75"
>
> due to some reason datafaucet does something strange when value UUID

Not sure why that would be... it uses UUIDs for ID values by default,
and that's what I was using to test with... I'll try this specific ID
value though and see what I come up with.

Sana

unread,
Sep 2, 2008, 3:36:16 PM9/2/08
to DataFaucet ORM
Here is full detail of my both tables data.

item.cfc
ItemID = 1324
ContentName = 'Some test'

<cfcomponent extends="datafaucet.system.activerecord">
<cfset setTable("tItem") />
</cfcomponent>

And content.cfc
ItemID = 1324
ConentDetail = 'some detail'
ContentUniqueString = 'FA9E2857-30BD-B5E8-D755CB8A867B3F75'
ContentURL = '/FA9E2857-30BD-B5E8-D755CB8A867B3F75'
ContentDate = '01-01-2008'

<cfcomponent extends="item">
<cfset addTable(table = "tContent",
column="ItemID", references="ItemID") />
</cfcomponent>

Now .read(1324) will only populate item.cfc fields, but content.cfc
(tContent) fields will be empty. As I mentioned earlier that any
column holding UUID value causing this issue.

Thanks for your help.

Sana

unread,
Sep 2, 2008, 7:01:42 PM9/2/08
to DataFaucet ORM
Hi Isaac,

Please ignore this, there could be multiple issues with legacy schema.

thanks for your help.

Isaac Dealey

unread,
Sep 2, 2008, 11:04:34 PM9/2/08
to dataf...@googlegroups.com
> Hi Isaac,
>
> Please ignore this, there could be multiple issues with legacy schema.
>
> thanks for your help.

Okay. You're welcome. :)

Reply all
Reply to author
Forward
0 new messages