我正在开发一个连接到documentum的Java项目。我试图使用以下内容从我的dm_acl对象表中获取一些数据:
String fetchAclsInfoQuery = "select * from dm_acl where description = '@aclname0' or description = '@aclname1' or description = '@aclname2' enable (ROW_BASED) ";
fetchAclsInfoQuery = fetchAclsInfoQuery.replace("@aclname0", list.get(0));
fetchAclsInfoQuery = fetchAclsInfoQuery.replace("@aclname1", newAcl1.toString().toLowerCase());
fetchAclsInfoQuery = fetchAclsInfoQuery.replace("@aclname2", newAcl2.toString().toLowerCase());
System.out.println(fetchAclsInfoQuery);
//The problem starts from here ==>
IDfQuery aclDetailsFetching = new DfQuery();
//IDfCollection col = UpdateQuery.execute(_session, IDfQuery.DF_QUERY);
IDfCollection details = aclDetailsFetching.execute(_session, DfQuery.DF_READ_QUERY);
while(details.next()){
System.out.println(details.getString("owner_name"));
}
一旦我打印出“fetchAclsInfoQuery”的结果并在DQL测试器中运行它,它完全正常,当我尝试输出存储在“owner_name”列中的值时,我得到的只是null。 知道我的错误在哪里? :)
答案 0 :(得分:2)
您忘记将DQL语句设置为查询对象
添加<?php echo '<?xml version="1.0" encoding="UTF-8"?>'; ?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>http://www.example.com/</loc>
<lastmod>2005-01-01</lastmod>
<changefreq>monthly</changefreq>
<priority>0.8</priority>
</url>
</urlset>
答案 1 :(得分:0)
尝试写作
String fetchAclsInfoQuery = "select owner_name from dm_acl where description = '@aclname0' or description = '@aclname1' or description = '@aclname2' enable (ROW_BASED) ";
而不是
String fetchAclsInfoQuery = "select * from dm_acl where description = '@aclname0' or description = '@aclname1' or description = '@aclname2' enable (ROW_BASED) ";
我很确定星号而不是真实的属性名称存在问题。
您可以使用方法hasAttr("<attribute_name>")
来检查您在集合中加载了所需的属性(属性)。