gpt4 book ai didi

org.apache.openjpa.persistence.XMLPersistenceMetaDataParser.getException()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-20 11:25:40 24 4
gpt4 key购买 nike

本文整理了Java中org.apache.openjpa.persistence.XMLPersistenceMetaDataParser.getException()方法的一些代码示例,展示了XMLPersistenceMetaDataParser.getException()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLPersistenceMetaDataParser.getException()方法的具体详情如下:
包路径:org.apache.openjpa.persistence.XMLPersistenceMetaDataParser
类名称:XMLPersistenceMetaDataParser
方法名:getException

XMLPersistenceMetaDataParser.getException介绍

暂无

代码示例

代码示例来源:origin: org.apache.openjpa/openjpa-persistence

/**
 * Throw proper exception if given value is not possibly persistence
 * capable.
 */
private void assertPC(FieldMetaData fmd, String attr)
  throws SAXException {
  if (!JavaTypes.maybePC(fmd))
    throw getException(_loc.get("bad-meta-anno", fmd, attr));
}

代码示例来源:origin: org.apache.openejb.patch/openjpa-persistence

/**
 * Throw proper exception if given value is not possibly persistence
 * capable.
 */
private void assertPC(FieldMetaData fmd, String attr)
  throws SAXException {
  if (!JavaTypes.maybePC(fmd))
    throw getException(_loc.get("bad-meta-anno", fmd, attr));
}

代码示例来源:origin: org.apache.openjpa/com.springsource.org.apache.openjpa

/**
 * Throw proper exception if given value is not possibly persistence
 * capable.
 */
private void assertPC(FieldMetaData fmd, String attr)
  throws SAXException {
  if (!JavaTypes.maybePC(fmd))
    throw getException(_loc.get("bad-meta-anno", fmd, attr));
}

代码示例来源:origin: org.apache.openejb.patch/openjpa

/**
 * Throw proper exception if given value is not possibly persistence
 * capable.
 */
private void assertPC(FieldMetaData fmd, String attr)
  throws SAXException {
  if (!JavaTypes.maybePC(fmd))
    throw getException(_loc.get("bad-meta-anno", fmd, attr));
}

代码示例来源:origin: org.apache.openjpa/openjpa-all

/**
 * Throw proper exception if given value is not possibly persistence
 * capable.
 */
private void assertPC(FieldMetaData fmd, String attr)
  throws SAXException {
  if (!JavaTypes.maybePC(fmd))
    throw getException(_loc.get("bad-meta-anno", fmd, attr));
}

代码示例来源:origin: org.apache.openjpa/com.springsource.org.apache.openjpa

/**
 * Parse id-class.
 */
protected boolean startIdClass(Attributes attrs)
  throws SAXException {
  if (!isMetaDataMode())
    return false;
  ClassMetaData meta = (ClassMetaData) currentElement();
  String cls = attrs.getValue("class");
  Class idCls = null;
  try {
    idCls = classForName(cls);
  } catch (Throwable t) {
    throw getException(_loc.get("invalid-id-class", meta, cls), t);
  }
  meta.setObjectIdType(idCls, true);
  return true;
}

代码示例来源:origin: org.apache.openejb.patch/openjpa

/**
 * Throw exception if given field not a collection of possible persistence
 * capables.
 */
private void assertPCCollection(FieldMetaData fmd, String attr)
  throws SAXException {
  switch (fmd.getDeclaredTypeCode()) {
    case JavaTypes.ARRAY:
    case JavaTypes.COLLECTION:
    case JavaTypes.MAP:
      if (JavaTypes.maybePC(fmd.getElement()))
        break;
      // no break
    default:
      throw getException(_loc.get("bad-meta-anno", fmd, attr));
  }
}

代码示例来源:origin: org.apache.openjpa/openjpa-all

/**
 * Throw exception if given field not a collection of possible persistence
 * capables.
 */
private void assertPCCollection(FieldMetaData fmd, String attr)
  throws SAXException {
  switch (fmd.getDeclaredTypeCode()) {
    case JavaTypes.ARRAY:
    case JavaTypes.COLLECTION:
    case JavaTypes.MAP:
      if (JavaTypes.maybePC(fmd.getElement()))
        break;
      // no break
    default:
      throw getException(_loc.get("bad-meta-anno", fmd, attr));
  }
}

代码示例来源:origin: org.apache.openejb.patch/openjpa-persistence

/**
 * Throw exception if given field not a collection of possible persistence
 * capables.
 */
private void assertPCCollection(FieldMetaData fmd, String attr)
  throws SAXException {
  switch (fmd.getDeclaredTypeCode()) {
    case JavaTypes.ARRAY:
    case JavaTypes.COLLECTION:
    case JavaTypes.MAP:
      if (JavaTypes.maybePC(fmd.getElement()))
        break;
      // no break
    default:
      throw getException(_loc.get("bad-meta-anno", fmd, attr));
  }
}

代码示例来源:origin: org.apache.openjpa/openjpa-persistence

/**
 * Throw exception if given field not a collection of possible persistence
 * capables.
 */
private void assertPCCollection(FieldMetaData fmd, String attr)
  throws SAXException {
  switch (fmd.getDeclaredTypeCode()) {
    case JavaTypes.ARRAY:
    case JavaTypes.COLLECTION:
    case JavaTypes.MAP:
      if (JavaTypes.maybePC(fmd.getElement()))
        break;
      // no break
    default:
      throw getException(_loc.get("bad-meta-anno", fmd, attr));
  }
}

代码示例来源:origin: org.apache.openjpa/com.springsource.org.apache.openjpa

/**
 * Throw exception if given field not a collection of possible persistence
 * capables.
 */
private void assertPCCollection(FieldMetaData fmd, String attr)
  throws SAXException {
  switch (fmd.getDeclaredTypeCode()) {
    case JavaTypes.ARRAY:
    case JavaTypes.COLLECTION:
    case JavaTypes.MAP:
      if (JavaTypes.maybePC(fmd.getElement()))
        break;
      // no break
    default:
      throw getException(_loc.get("bad-meta-anno", fmd, attr));
  }
}

代码示例来源:origin: org.apache.openjpa/openjpa-persistence

/**
 * Parse id-class.
 */
protected boolean startIdClass(Attributes attrs)
  throws SAXException {
  if (!isMetaDataMode())
    return false;
  ClassMetaData meta = (ClassMetaData) currentElement();
  String cls = attrs.getValue("class");
  Class<?> idCls = null;
  try {
    idCls = classForName(cls);
  } catch (Throwable t) {
    throw getException(_loc.get("invalid-id-class", meta, cls), t);
  }
  if (!Serializable.class.isAssignableFrom(idCls)) {
    _conf.getConfigurationLog().warn(_loc.get("id-class-not-serializable", idCls, _cls));
  }
  meta.setObjectIdType(idCls, true);
  return true;
}

代码示例来源:origin: org.apache.openjpa/openjpa-all

/**
 * Parse id-class.
 */
protected boolean startIdClass(Attributes attrs)
  throws SAXException {
  if (!isMetaDataMode())
    return false;
  ClassMetaData meta = (ClassMetaData) currentElement();
  String cls = attrs.getValue("class");
  Class<?> idCls = null;
  try {
    idCls = classForName(cls);
  } catch (Throwable t) {
    throw getException(_loc.get("invalid-id-class", meta, cls), t);
  }
  if (!Serializable.class.isAssignableFrom(idCls)) {
    _conf.getConfigurationLog().warn(_loc.get("id-class-not-serializable", idCls, _cls));
  }
  meta.setObjectIdType(idCls, true);
  return true;
}

代码示例来源:origin: org.apache.openejb.patch/openjpa-persistence

/**
 * Parse id-class.
 */
protected boolean startIdClass(Attributes attrs)
  throws SAXException {
  if (!isMetaDataMode())
    return false;
  ClassMetaData meta = (ClassMetaData) currentElement();
  String cls = attrs.getValue("class");
  Class<?> idCls = null;
  try {
    idCls = classForName(cls);
  } catch (Throwable t) {
    throw getException(_loc.get("invalid-id-class", meta, cls), t);
  }
  if (!Serializable.class.isAssignableFrom(idCls)) {
    _conf.getConfigurationLog().warn(_loc.get("id-class-not-serializable", idCls, _cls));
  }
  meta.setObjectIdType(idCls, true);
  return true;
}

代码示例来源:origin: org.apache.openejb.patch/openjpa

/**
 * Parse id-class.
 */
protected boolean startIdClass(Attributes attrs)
  throws SAXException {
  if (!isMetaDataMode())
    return false;
  ClassMetaData meta = (ClassMetaData) currentElement();
  String cls = attrs.getValue("class");
  Class<?> idCls = null;
  try {
    idCls = classForName(cls);
  } catch (Throwable t) {
    throw getException(_loc.get("invalid-id-class", meta, cls), t);
  }
  if (!Serializable.class.isAssignableFrom(idCls)) {
    _conf.getConfigurationLog().warn(_loc.get("id-class-not-serializable", idCls, _cls));
  }
  meta.setObjectIdType(idCls, true);
  return true;
}

代码示例来源:origin: org.apache.openejb.patch/openjpa

protected void parseElementCollection(FieldMetaData fmd, Attributes attrs)
    throws SAXException {
    String val = attrs.getValue("target-class");
    if (val != null)
      fmd.getElement().setDeclaredType(classForName(val));

    if (fmd.getDeclaredTypeCode() != JavaTypes.COLLECTION &&
      fmd.getDeclaredTypeCode() != JavaTypes.MAP)
      throw getException(_loc.get("bad-meta-anno", fmd,
          "ElementCollection"));

    val = attrs.getValue("fetch");
    if (val != null)
      fmd.setInDefaultFetchGroup("EAGER".equals(val));
    fmd.setElementCollection(true);
    fmd.setSerialized(false);
    if (JavaTypes.maybePC(fmd.getElement()) && !fmd.getElement().getDeclaredType().isEnum()) {
      fmd.getElement().setEmbedded(true);
      if (fmd.getElement().getEmbeddedMetaData() == null)
//                fmd.getElement().addEmbeddedMetaData();
        deferEmbeddable(fmd.getElement().getDeclaredType(),
          fmd.getElement());
    }
  }

代码示例来源:origin: org.apache.openjpa/openjpa-persistence

protected void parseElementCollection(FieldMetaData fmd, Attributes attrs)
    throws SAXException {
    String val = attrs.getValue("target-class");
    if (val != null)
      fmd.getElement().setDeclaredType(classForName(val));

    if (fmd.getDeclaredTypeCode() != JavaTypes.COLLECTION &&
      fmd.getDeclaredTypeCode() != JavaTypes.MAP)
      throw getException(_loc.get("bad-meta-anno", fmd,
          "ElementCollection"));

    val = attrs.getValue("fetch");
    if (val != null)
      fmd.setInDefaultFetchGroup("EAGER".equals(val));
    fmd.setElementCollection(true);
    fmd.setSerialized(false);
    if (JavaTypes.maybePC(fmd.getElement()) && !fmd.getElement().getDeclaredType().isEnum()) {
      fmd.getElement().setEmbedded(true);
      if (fmd.getElement().getEmbeddedMetaData() == null)
//                fmd.getElement().addEmbeddedMetaData();
        deferEmbeddable(fmd.getElement().getDeclaredType(),
          fmd.getElement());
    }
  }

代码示例来源:origin: org.apache.openjpa/openjpa-all

protected void parseElementCollection(FieldMetaData fmd, Attributes attrs)
    throws SAXException {
    String val = attrs.getValue("target-class");
    if (val != null)
      fmd.getElement().setDeclaredType(classForName(val));

    if (fmd.getDeclaredTypeCode() != JavaTypes.COLLECTION &&
      fmd.getDeclaredTypeCode() != JavaTypes.MAP)
      throw getException(_loc.get("bad-meta-anno", fmd,
          "ElementCollection"));

    val = attrs.getValue("fetch");
    if (val != null)
      fmd.setInDefaultFetchGroup("EAGER".equals(val));
    fmd.setElementCollection(true);
    fmd.setSerialized(false);
    if (JavaTypes.maybePC(fmd.getElement()) && !fmd.getElement().getDeclaredType().isEnum()) {
      fmd.getElement().setEmbedded(true);
      if (fmd.getElement().getEmbeddedMetaData() == null)
//                fmd.getElement().addEmbeddedMetaData();
        deferEmbeddable(fmd.getElement().getDeclaredType(),
          fmd.getElement());
    }
  }

代码示例来源:origin: org.apache.openejb.patch/openjpa-persistence

protected void parseElementCollection(FieldMetaData fmd, Attributes attrs)
    throws SAXException {
    String val = attrs.getValue("target-class");
    if (val != null)
      fmd.getElement().setDeclaredType(classForName(val));

    if (fmd.getDeclaredTypeCode() != JavaTypes.COLLECTION &&
      fmd.getDeclaredTypeCode() != JavaTypes.MAP)
      throw getException(_loc.get("bad-meta-anno", fmd,
          "ElementCollection"));

    val = attrs.getValue("fetch");
    if (val != null)
      fmd.setInDefaultFetchGroup("EAGER".equals(val));
    fmd.setElementCollection(true);
    fmd.setSerialized(false);
    if (JavaTypes.maybePC(fmd.getElement()) && !fmd.getElement().getDeclaredType().isEnum()) {
      fmd.getElement().setEmbedded(true);
      if (fmd.getElement().getEmbeddedMetaData() == null)
//                fmd.getElement().addEmbeddedMetaData();
        deferEmbeddable(fmd.getElement().getDeclaredType(),
          fmd.getElement());
    }
  }

代码示例来源:origin: org.apache.openjpa/com.springsource.org.apache.openjpa

if (e instanceof PrivilegedActionException)
  e = ((PrivilegedActionException) e).getException();
throw getException(_loc.get("invalid-attr", name, meta), e);

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com