| Summary: | SQLDataSource defined in Library is not generated with initialization code. | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | Xiao Bin Chen <xiaobinc> |
| Component: | EDT | Assignee: | Project Inbox <edt.javagen-inbox> |
| Status: | CLOSED DUPLICATE | QA Contact: | |
| Severity: | major | ||
| Priority: | P1 | CC: | chenzhh, jspadea, jvincens, svihovec, zhuzhi |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
If you define a SQLDataSource in a Service, it is initialized with the annotation values. However, the same code, if put in a Library, does not have the initialization. It will through an exception when the ds is used. ---EGL code---
library DBLib
ds SQLDataSource?{@Resource {bindingKey = "aaa"}};
function getPosts()
end
end
---Generated Java code---
public class DBLib extends ExecutableBase {
private static final long serialVersionUID = 10L;
@javax.xml.bind.annotation.XmlTransient
public transient SQLDataSource ds;
public DBLib() {
super();
ezeInitialize();
}
public void ezeInitialize() {
ds = null;
}
.....
---Generated Java code if it is a Service----
public class DBService extends ServiceBase {
private static final long serialVersionUID = 10L;
@org.eclipse.edt.javart.json.Json(name="ds", clazz=SQLDataSource.class, asOptions={})
public transient SQLDataSource ds;
public DBService() {
super();
ezeInitialize();
}
public void ezeInitialize() {
ds = org.eclipse.edt.runtime.java.eglx.lang.EAny.ezeCast(SysLib.getResource("aaa"), SQLDataSource.class);
}
duplicate *** This bug has been marked as a duplicate of bug 363691 *** Verify against EGL Web Developer Tools 0.7.0.v201111221542, close it |
If you defined a sqldatasource in a library like below: ads SQLDataSource?{@Resource {bindingkey = "mvclib", propertyFileName = "aProject"}}. You can't use the "ads" in functions of the library. But if it was defined in the function of library. It can be used to do database action. I debug it , and find out the ads is NULL, if defined as a field of library.