<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head><style type="text/css"><!-- #msg DL { border : 1px #006 solid; background-color : #369; padding : 6px; color : #fff; } #msg DT { float : left; width : 6em; font-weight : bold; } #msg DL, #msg DT, #msg UL, #msg LI { font-family : arial,helvetica,sans-serif; font-size : 10pt; } h3 { font-family : arial,helvetica,sans-serif; font-size : 10pt; font-weight : bold; } #msg PRE { overflow : auto; white-space : normal; background-color : #ffc; border : 1px #fc0 solid; padding : 6px; } #msg UL, PRE, .diff { overflow : auto; } #patch h4 { font-family : arial,helvetica,sans-serif; font-size : 10pt; } #patch h4 { padding: 8px; background : #369; color : #fff; margin : 0; } #patch .propset h4, #patch .binary h4 {margin: 0;} #patch pre {padding:0;line-height:1.2em;margin:0;} #patch .diff {background:#eeeeee;padding: 0 0 10px 0;} #patch .propset .diff, #patch .binary .diff {padding: 10px 0;} #patch span {display:block;padding:0 10px;} #patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;} #patch .add {background:#ddffdd;} #patch .rem {background:#ffdddd;} #patch .lines, .info {color:#888888;background:#ffffff;} .diff { width : 100%; } #msg DL { border : 1px #006 solid; background-color : #369; padding : 6px; color : #fff; } #msg DT { float : left; width : 6em; font-weight : bold; } #msg DL, #msg DT, #msg UL, #msg LI { font-family : arial,helvetica,sans-serif; font-size : 10pt; } h3 { font-family : arial,helvetica,sans-serif; font-size : 10pt; font-weight : bold; } #msg PRE { overflow : auto; white-space : normal; background-color : #ffc; border : 1px #fc0 solid; padding : 6px; } #msg UL, PRE, .diff { overflow : auto; } #patch h4 { font-family : arial,helvetica,sans-serif; font-size : 10pt; } #patch h4 { padding: 8px; background : #369; color : #fff; margin : 0; } #patch .propset h4, #patch .binary h4 {margin: 0;} #patch pre {padding:0;line-height:1.2em;margin:0;} #patch .diff {background:#eeeeee;padding: 0 0 10px 0;} #patch .propset .diff, #patch .binary .diff {padding: 10px 0;} #patch span {display:block;padding:0 10px;} #patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;} #patch .add {background:#ddffdd;} #patch .rem {background:#ffdddd;} #patch .lines, .info {color:#888888;background:#ffffff;} .diff { width : 100%; } --></style> <title>[rhq-project.org rhq] [4456] add ResourceCriteria filtering on resourceTypeId (in case users already have the id and they don't want to specify type name and plugin name); </title> </head> <body> <div id="msg"> <dl> <dt>Revision</dt> <dd>4456</dd> <dt>Author</dt> <dd>jmarques</dd> <dt>Date</dt> <dd>2009-07-17 09:42:30 -0500 (Fri, 17 Jul 2009)</dd> </dl> <h3>Log Message</h3> <pre>add ResourceCriteria filtering on resourceTypeId (in case users already have the id and they don't want to specify type name and plugin name); add ResourceCriteria filtering on resourceParentId, so they can find children through the criteria API (they could alternately do fetchChildrenResources(true)); </pre> <h3>Modified Paths</h3> <ul> <li><a href="#rhqtrunkmodulescoredomainsrcmainjavaorgrhqcoredomaincriteriaResourceCriteriajava">rhq/trunk/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceCriteria.java</a></li> </ul> </div> <div id="patch"> <h3>Diff</h3> <a id="rhqtrunkmodulescoredomainsrcmainjavaorgrhqcoredomaincriteriaResourceCriteriajava"></a> <div class="modfile"><h4>Modified: rhq/trunk/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceCriteria.java (4455 => 4456)</h4> <pre class="diff"> <span class="info">--- rhq/trunk/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceCriteria.java 2009-07-17 08:25:40 UTC (rev 4455) +++ rhq/trunk/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/ResourceCriteria.java 2009-07-17 14:42:30 UTC (rev 4456) </span><span class="lines">@@ -37,9 +37,11 @@ </span><span class="cx"> private InventoryStatus filterInventoryStatus; private String filterVersion; private String filterDescription; </span><span class="add">+ private String filterResourceTypeId; // needs overrides </span><span class="cx"> private String filterResourceTypeName; // needs overrides private ResourceCategory filterResourceCategory; // needs overrides private String filterPluginName; // needs overrides </span><span class="add">+ private String filterParentResourceId; // needs overrides </span><span class="cx"> private String filterParentResourceName; // needs overrides private String filterAgentName; // needs overrides </span><span class="lines">@@ -80,9 +82,11 @@ </span><span class="cx"> public ResourceCriteria() { super(); </span><span class="add">+ filterOverrides.put("resourceTypeId", "resourceType.id = ?"); </span><span class="cx"> filterOverrides.put("resourceTypeName", "resourceType.name like ?"); filterOverrides.put("resourceCategory", "resourceType.category like ?"); filterOverrides.put("plugin", "resourceType.plugin = ?"); </span><span class="add">+ filterOverrides.put("parentResourceId", "parentResource.id = ?"); </span><span class="cx"> filterOverrides.put("parentResourceName", "parentResource.name like ?"); filterOverrides.put("agentName", "agent.name like ?"); </span><span class="lines">@@ -118,6 +122,10 @@ </span><span class="cx"> this.filterDescription = filterDescription; } </span><span class="add">+ public void addFilterResourceTypeId(String filterResourceTypeId) { + this.filterResourceTypeId = filterResourceTypeId; + } + </span><span class="cx"> public void addFilterResourceTypeName(String filterResourceTypeName) { this.filterResourceTypeName = filterResourceTypeName; } </span><span class="lines">@@ -130,6 +138,10 @@ </span><span class="cx"> this.filterPluginName = filterPluginName; } </span><span class="add">+ public void addFilterParentResourceId(String filterParentResourceId) { + this.filterParentResourceId = filterParentResourceId; + } + </span><span class="cx"> public void addFilterParentResourceName(String filterParentResourceName) { this.filterParentResourceName = filterParentResourceName; } </span> </pre> </div> </div> </body> </html> |