queryUsingConceptProps()
The queryUsingConceptProps() queries database using the property values in a concept instance.
Syntax
Concept[] queryUsingConceptProps(Concept qConcept, boolean queryChildren)
In this example, qConcept indicates that the concept database is queried for matching values from this concept. If queryChildren boolean is set to true, concept properties are recursively queried. The function returns an array of concepts.
Example
Database.setCurrentConnection("/SharedResources/MySQLConnection.sharedjdbc"); Database.beginTransaction(); Concepts.test.test.test testConcept=Instance.createInstance("xslt://{{/Concepts/test/test/test}}<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<xsl:stylesheet xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" version=\"1.0\" exclude-result-prefixes=\"xsl xsd\">\n <xsl:output method=\"xml\"/>\n <xsl:template match=\"/\">\n <createObject>\n <object>\n <col_1>\n <xsl:value-of select=\"1\"/>\n </col_1>\n <col_2>\n <xsl:value-of select=\""Hi"\"/>\n </col_2>\n </object>\n </createObject>\n </xsl:template>\n</xsl:stylesheet>"); Concepts.test.test.test[] result=Database.queryUsingConceptProps(testConcept,true); for (int i=0;i<result@length;i++) { System.debugOut("properties from DB are " + result[i].col_1 + " ," + result[i].col_2); } Database.unsetConnection();
Copyright © Cloud Software Group, Inc. All rights reserved.