I decided to step back and try to just get the query to run with the single Proejct_Number parameter set and I'm not having much luck doing just this. If I change my sql-query to this:
<sql-query name="getAttributes"> <load-collection alias="attributes" role="com.Project.attributes" /> <return alias="attribute" class="com.Attribute"> <return-property name="id" > <return-column name="Project_Property_Number" /> <return-column name="Project_Number" /> <return-column name="Instance" /> </return-property> </return> select distinct * from Project_Properties_List_Inst_Values where Project_Number = :number </sql-query>
I get an exception that the id property is not found in the result set. This makes since but how do I tell it that id is not in the result set, but the property name of the composite embedded object to create when recreating each result? Any ideas on this portion? Thanks
edited, forgot to include the stacktrace....
hibernate.SQL select distinct * from RTMaster.dbo.Project_Properties_List_Inst_Values where Project_Number = ? type.IntegerType binding '39' to parameter: 1 type.IntegerType returning '33' as column: Project_Property_Number type.IntegerType returning '39' as column: Project_Number type.IntegerType returning '1' as column: Instance type.IntegerType returning '33' as column: Project_Property_Number type.IntegerType returning '39' as column: Project_Number type.IntegerType returning '1' as column: Instance type.IntegerType could not read column value from result set: id; The column name id is not valid. util.JDBCExceptionReporter The column name id is not valid. errors.GrailsExceptionResolver The column name id is not valid. com.microsoft.sqlserver.jdbc.SQLServerException: The column name id is not valid. at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:170) at com.microsoft.sqlserver.jdbc.SQLServerResultSet.findColumn(SQLServerResultSet.java:626) at com.microsoft.sqlserver.jdbc.SQLServerResultSet.getInt(SQLServerResultSet.java:2219) at org.apache.commons.dbcp.DelegatingResultSet.getInt(DelegatingResultSet.java:237) at com.cerner.ipsvc.project.ProjectsController$_closure1_closure5.doCall(ProjectsController.groovy:54) at com.cerner.ipsvc.project.ProjectsController$_closure1.doCall(ProjectsController.groovy:53) at com.cerner.ipsvc.project.ProjectsController$_closure1.doCall(ProjectsController.groovy) at java.lang.Thread.run(Thread.java:619) [Tomcat].[localhost] Exception Processing ErrorPage[errorCode=500, location=/grails-errorhandler] java.lang.IllegalStateException: Cannot reset buffer after response has been committed at org.apache.catalina.connector.Response.resetBuffer(Response.java:691) at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:409) at org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java:343) at org.apache.catalina.core.StandardHostValve.throwable(StandardHostValve.java:287) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454) at java.lang.Thread.run(Thread.java:619)
|