XXXXX is not mapped - using ORM - org.hibernate.hql.ast.QuerySyntaxException

2,465 views
Skip to first unread message

Jason

unread,
Sep 14, 2012, 3:39:37 PM9/14/12
to col...@googlegroups.com
I keep getting errors that XXXX is not mapped.  I think I have everything setup correctly but I am obviously missing something.

I am trying to run this: 
var r = ormService.findIt("from StudentAssessment as a where a.StudentId = :StudentId", { studentId=Arguments.oStudent.geStudentId()} );
writeDump(r); abort;


The StudentAssessment object looks like:

component accessors="true" persistent="true" table="StudentAssessments" extends="coldbox.system.orm.hibernate.ActiveEntity" {
property name="StudentId" fieldtype="Id" ormtype="string" length="32" column="StudentId";
property name="AssessmentId" fieldtype="Id" ormtype="string" length="32" column="AssessmentId";
property name="Created" ormtype="timestamp";
}

And the error I continue to get is:

Application Execution Exception

Error Type: org.hibernate.hql.ast.QuerySyntaxException : 0
Error Messages: StudentAssessment is not mapped [from StudentAssessment as a where a.StudentId = :StudentId]

Any help on this would be much appreciated.  I have received this error before but found work arounds, but I kind of want to know what this is caused from.

Thanks!

Andrew Scott

unread,
Sep 14, 2012, 3:51:34 PM9/14/12
to col...@googlegroups.com
ORM is case sensitive in HQL, check your case or spelling.


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



--
--
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
To post to this group, send email to col...@googlegroups.com
To unsubscribe from this group, send email to coldbox-u...@googlegroups.com
For more options, visit this group at http://groups-beta.google.com/group/coldbox
For News, visit http://blog.coldbox.org
For Documentation, visit http://wiki.coldbox.org
 
 
 


Jason Fill

unread,
Sep 14, 2012, 4:03:45 PM9/14/12
to col...@googlegroups.com
Andrew,

Thanks for the prompt reply.  I have looked at case and spelling and I don't see anything odd - I even stripped things out a bit. I am now working with.

var r = ormService.findIt("from StudentAssessment" );
writeDump(r); abort;

Which I would think that would work without issues. 

I am able to do:

writeDump(entityNew("StudentAssessment"));
abort;

Which will give me a new entity.  But I still get that mapped error on the top sample.  Any other thoughts?

Andrew Scott

unread,
Sep 15, 2012, 3:02:48 AM9/15/12
to col...@googlegroups.com
This is just a guess, but the ORM Service in ColdBox already sets the entity name.


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


Reply all
Reply to author
Forward
0 new messages