| Summary: | Generated Java code got error when action target of SQL GET statement is SQLResultSet | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | Xin Wu <cdlwuxin> |
| Component: | EDT | Assignee: | Justin Spadea <jspadea> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | jvincens, tww, zhuzhi |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
A target for a GET is scalar_expr or entity_expr or list_expr. -scalar_expr is an expression of a type which maps to a single data base column type. -entity_expr is of an type that contains a set of fields each of which map to a column in a row of a result set or table. -list_expr is an egl.lang.List whose element type is one of the three kinds described above. If the target is an entity and defined as nullable then it must have a public default constructor. This is because the code will attempt to create a new instance if the target is null. SQLResultSet has a private default constructor so it must be defined as nullable, but it's constructor is private so it can't be instantiated. Fixed GetByKeyStatementValidator.java to require a nullable target has a default constructor. Verified in build 20111108 |
Build Identifier: 20111107 nightly build Generated Java code got error when action target of SQL GET statement is SQLResultSet Reproducible: Always Steps to Reproduce: 1. Create a Basic Project 2. Create a DB connection 3. Write SQL GET statement with action target set to variable type of SQLRestultSet. 4. There is no EGL compile error, and the generated Java code got compile error 5. The error generated code as follow, and the error message is "The constructor SQLResultSet() is undefined" try { java.sql.PreparedStatement ezeStatement = (java.sql.PreparedStatement)ds.getStatement("test.TestOpen", 2); if (ezeStatement== null) { String stmtStr = "SELECT * FROM ACT WHERE id = ?"; ezeStatement = ds.getConnection().prepareStatement(stmtStr); ds.registerStatement("test.TestOpen", 2, ezeStatement); } ezeStatement.setShort(1, (short) 1); java.sql.ResultSet eze$Temp2 = ezeStatement.executeQuery(); if(eze$Temp2.next()) { if (rs1 == null) { rs1 = new SQLResultSet(); //got compile error } ; } eze$Temp2.close(); }