Exemplo n.º 1
0
  /** INTERNAL: */
  public XMLNamedNativeQuery(Node node, XMLHelper helper) {
    // Set the location where we found this query.
    setLocation(helper.getDocumentName());

    // Process the name.
    setName(helper.getNodeValue(node, XMLConstants.ATT_NAME));

    // Process the query string.
    setEJBQLString(helper.getNodeTextValue(node, XMLConstants.QUERY));

    // Process the query hints.
    NodeList hints = helper.getNodes(node, XMLConstants.QUERY_HINT);
    if (hints != null) {
      for (int i = 0; i < hints.getLength(); i++) {
        Node hintNode = hints.item(i);
        String name = helper.getNodeValue(hintNode, XMLConstants.ATT_NAME);
        String value = helper.getNodeValue(hintNode, XMLConstants.ATT_VALUE);
        addHint(new MetadataQueryHint(name, value));
      }
    }

    // Process the result class.
    setResultClass(helper.getNodeValue(node, XMLConstants.ATT_RESULT_CLASS, void.class));

    // Process the result set mapping.
    setResultSetMapping(helper.getNodeValue(node, XMLConstants.ATT_RESULT_SET_MAPPING, ""));
  }
  /** INTERNAL: */
  public XMLPrimaryKeyJoinColumn(
      Node node, XMLHelper helper, String sourceTableName, String targetTableName) {
    super(sourceTableName, targetTableName);

    if (node != null) {
      // Process the primary key field metadata.
      m_pkField.setName(
          helper.getNodeValue(
              node, XMLConstants.ATT_REFERENCED_COLUMN_NAME, DEFAULT_REFERENCED_COLUMN_NAME));

      // Process the foreign key field metadata.
      m_fkField.setName(helper.getNodeValue(node, XMLConstants.ATT_NAME, DEFAULT_NAME));
      m_fkField.setColumnDefinition(
          helper.getNodeValue(node, XMLConstants.ATT_COLUMN_DEFINITION, DEFAULT_COLUMN_DEFINITION));
    }
  }