public class PredefinedQuery extends Object
This class is used for reading XML files with information about predefined queries. The file should be located at the path returned by
Application.getQueryFile. The format of the XML file is forced by a DTD. In summary:
<?xml version="1.0" ?> <!DOCTYPE predefined-queries SYSTEM "predefined.dtd" > <predefined-queries> <query id="GET_GROUPS_FOR_USER" type="HQL"> <sql> SELECT ug.groupId FROM UserGroups ug WHERE ug.userId = :user_id </sql> <description> Loads the group ID for all groups where the user is a member </description> </query> </predefined-queries>
- 2.0, 2.13 (made public)
Fields Modifier and Type Field Description
private static DocumentHolds the XML document containing the common queries.
private static StringThe path to the query file with common queries.
private static DocumentHolds the XML document containing the dialect-specific queries.
private static StringThe path to the query file with dialect-specific queries.
private static URLThe DTD which is used to validate the XML file.
private static boolean
private static org.slf4j.LoggerLog core events.
Constructors Constructor Description
logprivate static final org.slf4j.Logger logLog core events.
commonDomprivate static Document commonDomHolds the XML document containing the common queries.
dialectDomprivate static Document dialectDomHolds the XML document containing the dialect-specific queries.
commonQueryFileprivate static final String commonQueryFileThe path to the query file with common queries.
- See Also:
- Constant Field Values
dialectQueryFileprivate static String dialectQueryFileThe path to the query file with dialect-specific queries.
dtdFileprivate static final URL dtdFileThe DTD which is used to validate the XML file.
isInitialisedprivate static boolean isInitialised
initstatic void init() throws BaseExceptionLoad and parse the file with predefined queries.
unloadstatic void unload()Unload all settings.
getQueryStringGet the query string for the predefined query with the specified name. This method was made public in BASE 2.13.
BaseException- If the query is not found or there is any other error