Re: [cf-orm-dev] A CFC with entityname model.Account could not be found.

18 views
Skip to first unread message

Andrew Scott

unread,
Mar 10, 2013, 3:37:02 AM3/10/13
to cf-or...@googlegroups.com
Dale,

Change

Account = entityNew('model.Account');

to

Account = entityNew('Account');

And you should be fine.


Regards,
Andrew Scott
WebSite: http://www.andyscott.id.au/



On Sun, Mar 10, 2013 at 4:44 PM, <da...@fraser.id.au> wrote:
I have a very simple orm mapping.

// account model
component name='Account' persistent='true' accessors='true' {
property name='accountId' ormtype='int' fieldtype='id' generator='identity';
property name='company' ormtype='string' length='20';
property name='password' ormtype='string' length='20';    
property name='firstName' ormtype='string' length='50';
property name='lastName' ormtype='string' length='50';
property name='email' ormtype='string' length='100';
}

and I'm trying to populate it

component 
{
// default action
public struct function default() {
Account = entityNew('model.Account');
Account.setCompany = 'fraser';
Account.setPassword = 'letmein';
Account.setFirstName = 'Dale';
Account.setLastName = 'Fraser';
Account.setEmail = 'm...@email.com
';
entitySave(Account);
return(arguments);
}
}

All I get is

A CFC with entityname model.Account could not be found.

I've googled around a bit and only can find error in model or restart cf.

If I do a new model.Account it doesn't error

--
You received this message because you are subscribed to the Google Groups "cf-orm-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cf-orm-dev+...@googlegroups.com.
To post to this group, send email to cf-or...@googlegroups.com.
Visit this group at http://groups.google.com/group/cf-orm-dev?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

da...@fraser.id.au

unread,
Mar 10, 2013, 7:17:15 PM3/10/13
to cf-or...@googlegroups.com
model is just a mapping to where the models are

Without it, I don't think it will find the cfc, but I tried anyway

A CFC with entityname Account could not be found.

I even tried moving Account to the same folder, same error. Clearly im doing something dumb

Jason Durham

unread,
Mar 10, 2013, 7:20:44 PM3/10/13
to cf-or...@googlegroups.com
Do you have persistent=true at the top of your entity?

Jason Durham


--

Jason Durham

unread,
Mar 10, 2013, 7:21:45 PM3/10/13
to cf-or...@googlegroups.com
Whoops.. sorry for not reading your original post completely.

Is this your only entity?

Jason Durham

Andrew Scott

unread,
Mar 10, 2013, 7:34:07 PM3/10/13
to cf-or...@googlegroups.com
Is the models mapping in the cfclocation?


Regards,
Andrew Scott
WebSite: http://www.andyscott.id.au/



--

da...@fraser.id.au

unread,
Mar 10, 2013, 8:19:09 PM3/10/13
to cf-or...@googlegroups.com
Thanks Andrew,

Problem was I didn't specify a cfclocation which I thought meant it checks eveywhere

Adding that and removing models. and it works

Inserts all nulls, so now I'll move onto that issue.

da...@fraser.id.au

unread,
Mar 10, 2013, 8:22:12 PM3/10/13
to cf-or...@googlegroups.com
which of course my setters were wrong

Thanks to the folks helping me on skype also :)

Account.setCompany = 'fraser';

should have been

Account.setCompany('fraser');

noob am I

Andrew Scott

unread,
Mar 10, 2013, 8:28:35 PM3/10/13
to cf-or...@googlegroups.com
Not 100% sure, but I thought the same as you.

Just one other thing that I noticed, it makes no difference to execution. But the accessors = true is already the default option for ORM entities.

Accessors was only added for normal components so that one could use the getters/setters in non entity components.


Regards,
Andrew Scott
WebSite: http://www.andyscott.id.au/



Reply all
Reply to author
Forward
0 new messages