gavinbaumanis
09/21/2023, 7:08 AMbdw429s
09/21/2023, 3:01 PMbdw429s
09/21/2023, 3:01 PMbdw429s
09/21/2023, 3:02 PMbdw429s
09/21/2023, 3:03 PMbdw429s
09/21/2023, 3:05 PMgavinbaumanis
09/21/2023, 10:55 PMbdw429s
09/22/2023, 2:16 AMgavinbaumanis
09/22/2023, 2:17 AMbdw429s
09/22/2023, 2:18 AMbdw429s
09/22/2023, 2:18 AMbdw429s
09/22/2023, 2:18 AMgavinbaumanis
09/22/2023, 2:23 AMgavinbaumanis
09/22/2023, 2:23 AMgavinbaumanis
09/22/2023, 2:41 AMgavinbaumanis
09/22/2023, 2:44 AMbdw429s
09/22/2023, 2:45 AMbdw429s
09/22/2023, 2:45 AMgavinbaumanis
09/22/2023, 2:46 AMjclausen
09/25/2023, 5:08 PM:lucee5
tag, which uses Lucee 5.4, the Ortus ORM extension is present. That is due to Lucee no longer bundling the ORM extension and wanting to make sure the ORM functionality is available - so as not to break existing implementations. The 3.5 Lucee extension has a number of know CVE’s and, as such, it presents a vulnerability. Same with Lucee’s 5.x version.
If I may ask, what’s preventing you from moving to the newer Hibernate version?gavinbaumanis
09/25/2023, 11:38 PMgavinbaumanis
09/25/2023, 11:38 PMgavinbaumanis
09/25/2023, 11:50 PM"ERROR","XNIO-1 task-3","09/25/2023","23:47:34","","No data type for node: org.hibernate.hql.ast.tree.IdentNode
+-[IDENT] IdentNode: 'received_date' {originalText=received_date}
;lucee.runtime.exp.NativeException: No data type for node: org.hibernate.hql.ast.tree.IdentNode
+-[IDENT] IdentNode: 'received_date' {originalText=received_date}
at org.hibernate.hql.ast.tree.SelectClause.initializeExplicitSelectClause(SelectClause.java:154)
at org.hibernate.hql.ast.HqlSqlWalker.useSelectClause(HqlSqlWalker.java:845)
at org.hibernate.hql.ast.HqlSqlWalker.processQuery(HqlSqlWalker.java:633)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:678)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:294)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:237)
at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:254)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:185)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:136)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:101)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:80)
at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:98)
at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:156)
at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:135)
at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1760)
at org.lucee.extension.orm.hibernate.HibernateORMSession.__executeQuery(HibernateORMSession.java:452)
at org.lucee.extension.orm.hibernate.HibernateORMSession._executeQuery(HibernateORMSession.java:431)
at org.lucee.extension.orm.hibernate.HibernateORMSession.executeQuery(HibernateORMSession.java:421)
at ortus.extension.orm.functions.ORMExecuteQuery._call(ORMExecuteQuery.java:85)
at ortus.extension.orm.functions.ORMExecuteQuery.call(ORMExecuteQuery.java:70)
at ortus.extension.orm.functions.ORMExecuteQuery.invoke(ORMExecuteQuery.java:121)
at lucee.runtime.functions.FunctionHandlerPool.invoke(FunctionHandlerPool.java:40)
at model.uploadsmodel_cfc$cf.udfCall(/gsncfc/model/uploadsModel.cfc:136)
at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:112)
at lucee.runtime.type.UDFImpl._call(UDFImpl.java:350)
at lucee.runtime.type.UDFImpl.call(UDFImpl.java:223)
at lucee.runtime.ComponentImpl._call(ComponentImpl.java:698)
at lucee.runtime.ComponentImpl._call(ComponentImpl.java:586)
at lucee.runtime.ComponentImpl.call(ComponentImpl.java:1933)
at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:787)
at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1775)
at service.uploadsservice_cfc$cf.udfCall(/gsncfc/service/uploadsService.cfc:28)
at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:112)
at lucee.runtime.type.UDFImpl._call(UDFImpl.java:350)
at lucee.runtime.type.UDFImpl.call(UDFImpl.java:223)
at lucee.runtime.ComponentImpl._call(ComponentImpl.java:698)
at lucee.runtime.ComponentImpl._call(ComponentImpl.java:586)
...
"
jclausen
09/25/2023, 11:52 PMjclausen
09/25/2023, 11:53 PMmodel/uploadsModel.cfc:136
?gavinbaumanis
09/25/2023, 11:54 PMlocal.b = ORMExecuteQuery("
SELECT #local.fieldNames#
FROM #local.emailRecipientsDS.getInternalName()#
WHERE dataSourceRecord = :fileId
", {fileId = local.p.fileId}, false, {datasource=entityLoadByPK('customer',local.p.customerId).getDataSource()});
return {headings: local.fieldNames, data: local.b, fileName: #listLAst(local.a[1],"/\")#};
jclausen
09/25/2023, 11:56 PMlocal.fieldNames
all the correct property casing and is local.emailRecipientsDS.getInternalName()
the same with the casing?gavinbaumanis
09/25/2023, 11:57 PMjclausen
09/25/2023, 11:58 PMgavinbaumanis
09/25/2023, 11:58 PMpublic struct function getRecipientsForFile(required struct formStruct) {
local.p = {
customerId = arguments.formStruct["customerId"]
};
if(isNumeric(arguments.formStruct["datasourceId"]) && arguments.formStruct["datasourceId"] != 0
&& isNumeric(arguments.formStruct["fileId"]) && arguments.formStruct["fileId"] != 0 ) {
// Use the dataSourceId to find the survey
local.lookUp = ORMExecuteQuery("
FROM ws_survey s
WHERE s.sysDataSourceId = :dataSourceId
", {dataSourceId = arguments.formStruct["dataSourceId"]}, false, {dataSource = "GSN_WebSurvey"} );
if(arrayLen(local.lookUp) != 1) {
// This should not happen: every DS is for a (deployed) survey
return {headings:"", data:[], fileName:""};
} else {
local.surveyId = local.lookUp[1].getSurveyId();
local.q = " AND ds1.dataSourceId = :dataSourceId AND dsr.fileName LIKE '%_sid_#local.surveyId#%' AND dsr.dataSourceRecordId = :fileId";
local.p.dataSourceId = arguments.formStruct["dataSourceId"];
local.p.fileId = arguments.formStruct["fileId"];
}
// Nothing more than a sanity check, really...
local.a = ORMExecuteQuery("
SELECT dsr.fileName
FROM dataSourceRecord dsr
JOIN dsr.dataSource ds
JOIN ds.customer c
JOIN c.datasources ds1
WHERE c.customerId = :customerId #local.q#
", local.p);
if(arrayLen(local.a) == 1) {
// Every tenant has a single one of these.
local.emailRecipientsDS = entityLoadByPK('customer',local.p.customerId).getEmailRecipientDS()[1];
// What are the fields of interest?
local.fieldNames = "";
for(local.f in local.emailRecipientsDS.getOriginalDataFields()) {
local.fieldNames = listAppend(local.fieldNames, local.f[1]);
}
// Pull the data
local.b = ORMExecuteQuery("
SELECT #local.fieldNames#
FROM #local.emailRecipientsDS.getInternalName()#
WHERE dataSourceRecord = :fileId
", {fileId = local.p.fileId}, false, {datasource=entityLoadByPK('customer',local.p.customerId).getDataSource()});
return {headings: local.fieldNames, data: local.b, fileName: #listLAst(local.a[1],"/\")#};
} else {
// This should not happen: we should be able to identify a unique dataSourceRecord record!
return {headings:"", data:[], fileName:""};
}
}
}
jclausen
09/26/2023, 12:04 AMlocal.fieldNames
and make sure they are all:
1. actual properties of the local.emailRecipientsDS.getInternalName()
entity and not column names
2. have exactly the same casing as the defined property names in the component.
Hibernate 3 would allow you to get by with column names HQL. Versions 4+ ( The Ortus extension is on 5 ) are much more strict.gavinbaumanis
09/26/2023, 12:10 AMgavinbaumanis
09/26/2023, 12:31 AMorg.hibernate.exception.GenericJDBCException: Could not read entity state from ResultSet : EntityKey[license#1]
jclausen
09/26/2023, 1:28 AMlicense
property in the first result that is blowing up. Is that a formula property or a standard column property?jclausen
09/26/2023, 1:29 AMgavinbaumanis
09/26/2023, 1:30 AMgavinbaumanis
09/26/2023, 1:33 AMgavinbaumanis
09/26/2023, 1:44 AMjclausen
09/26/2023, 1:55 AMmborn
09/26/2023, 2:11 AMgavinbaumanis
09/26/2023, 3:47 AMmborn
09/26/2023, 4:09 AMAnd just to clarify please that v6 (or 7) of the ortus ORM extension is for Hibernate v5.x?Correct: "the Ortus ORM Extension has been on Hibernate 5.6 since v6.2.0." We broke away from synced version numbers in extension v6.2.0 to allow us to make breaking changes in the extension. (Not that there have been many... see the release notes.) Extension v7 is not out/stable yet, only snapshot builds are up, but you definitely won't see a jump to Hibernate 6 for some time.
mborn
09/26/2023, 4:23 AM