ITeye博客

EJB3的XML Schema第十三讲

yingfang05 · 2010-03-28 13:24 · ejb3 · 编程语言 · EJB · XML · Bean · Markdown

<xsd:complexType name="queryType"> xsd:annotation xsd:documentation queryType 定义了一个finder 或select 查询。它包括:

  • 一个可选的查询描述。
  • finder 或select 方法的规范。
  • 一个可选的返回类型映射的规范,如果查询时用于select 方法且返回的是实体对象。
  • 定义查询的EJB QL 查询字符串。 用EJB QL 表达的查询必须使用ejb-ql 元素来指导查询。如果查询不是用EJBQL 表示,那么description 元素应当被用于描述查询的语义,且不应当指定ejb-ql元素。 result-type-mapping 是一个可选元素。如果query-method 指定一个返回值是实体对象的查询方法,那么它才能出现。result-type-mapping 元素的缺省值是"Local". </xsd:documentation> </xsd:annotation> xsd:sequence <xsd:element name="description" type="javaee:descriptionType" minOccurs="0"/> <xsd:element name="query-method" type="javaee:query-methodType"/> <xsd:element name="result-type-mapping" type="javaee:result-type-mappingType" minOccurs="0"/> <xsd:element name="ejb-ql" type="javaee:xsdStringType"/> </xsd:sequence> <xsd:attribute name="id" type="xsd:ID"/> </xsd:complexType> <xsd:complexType name="relationship-role-sourceType"> xsd:annotation xsd:documentation relationship-role-sourceType 分配了关系中角色的来源。 relationship-role-source 元素使用relationship-role-sourceType 来唯一标识一个实体bean。 </xsd:documentation> </xsd:annotation> xsd:sequence <xsd:element name="description" type="javaee:descriptionType" minOccurs="0" maxOccurs="unbounded"/> <xsd:element name="ejb-name" type="javaee:ejb-nameType"/> </xsd:sequence> <xsd:attribute name="id" type="xsd:ID"/> </xsd:complexType> <xsd:complexType name="relationshipsType"> xsd:annotation xsd:documentation relationshipsType 描述了使用容器管理持久化的实体bean 所参与的关系。 relationshipsType 包含了一个可选的描述;和一个ejb-relation 元素的列表,这些元素指定了容器管理的关系。 </xsd:documentation> </xsd:annotation> xsd:sequence <xsd:element name="description" type="javaee:descriptionType" minOccurs="0" maxOccurs="unbounded"/> <xsd:element name="ejb-relation" type="javaee:ejb-relationType" maxOccurs="unbounded"> <xsd:unique name="role-name-uniqueness"> xsd:annotation xsd:documentation ejb-relationship-role-name 包含了关系角色的名称。这个名称在关系中必须是 唯一的,但可以在不同的关系中重用。 </xsd:documentation> </xsd:annotation> <xsd:selector xpath=".//javaee:ejb-relationship-role-name"/> <xsd:field xpath="."/> </xsd:unique> </xsd:element> </xsd:sequence> <xsd:attribute name="id" type="xsd:ID"/> </xsd:complexType> <xsd:complexType name="remove-methodType"> xsd:sequence <xsd:element name="bean-method" type="javaee:named-methodType"/> <xsd:element name="retain-if-exception" type="javaee:true-falseType" minOccurs="0"/> </xsd:sequence> <xsd:attribute name="id" type="xsd:ID"/> </xsd:complexType> <xsd:complexType name="result-type-mappingType"> xsd:annotation xsd:documentation

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。