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

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®; 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 ExceptionError 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.


ORM is case sensitive in HQL, check your case or spelling.


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®; abort;

Which I would think that would work without issues.

I am able to do:


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

This is just a guess, but the ORM Service in ColdBox already sets the entity name.