EJB3的XML Schema第四讲
紧接上文: xsd:sequence <xsd:element name="description" type="javaee:descriptionType" minOccurs="0" maxOccurs="unbounded"/> <xsd:element name="method" type="javaee:methodType" maxOccurs="unbounded"/> <xsd:element name="trans-attribute" type="javaee:trans-attributeType"/> </xsd:sequence> <xsd:attribute name="id" type="xsd:ID"/> </xsd:complexType> <xsd:complexType name="ejb-classType"> xsd:annotation xsd:documentation
</xsd:documentation> </xsd:annotation> xsd:simpleContent <xsd:restriction base="javaee:fully-qualified-classType"/> </xsd:simpleContent> </xsd:complexType> <xsd:complexType name="ejb-jarType"> xsd:annotation xsd:documentation ejb-jarType 定义了EJB 部署描述的根元素。它包含: -一个可选的ejb-jar 文件的描述。 -一个可选的display 名称。 -一个可选的图标,它包含了一个小的和大的图标文件名称。 -关于所有未通过注释符指定的企业bean 的结构信息。
- 关于拦截器类的结构信息。 -容器管理的关系,如果有的话。
- 一个可选的application-assembly 。
- 一个可选的ejb-client-jar 的名称。 </xsd:documentation> </xsd:annotation> xsd:sequence <xsd:group ref="javaee:descriptionGroup"/> <xsd:element name="enterprise-beans" type="javaee:enterprise-beansType" minOccurs="0"/> <xsd:element name="interceptors" type="javaee:interceptorsType" minOccurs="0"/> <xsd:element name="relationships" type="javaee:relationshipsType" minOccurs="0"> <xsd:unique name="relationship-name-uniqueness"> xsd:annotation xsd:documentation ejb-relation-name 包含了关系的名称。名字在关系中必须是唯一的。 </xsd:documentation> </xsd:annotation> <xsd:selector xpath="javaee:ejb-relation"/> <xsd:field xpath="javaee:ejb-relation-name"/> </xsd:unique> </xsd:element> <xsd:element name="assembly-descriptor" type="javaee:assembly-descriptorType" minOccurs="0"> xsd:annotation xsd:documentation 在部署描述中提供assembly-descriptor 对ejb-jar 文件生产者来说是可选的。 </xsd:documentation> </xsd:annotation> </xsd:element> <xsd:element name="ejb-client-jar" type="javaee:pathType" minOccurs="0"> xsd:annotation xsd:documentation
</xsd:documentation> </xsd:annotation> </xsd:element> </xsd:sequence> <xsd:attribute name="version" type="javaee:dewey-versionType" fixed="3.0" use="required"> xsd:annotation xsd:documentation Version 指定了实例文档必须遵循的 EJB 规范的版本。这个信息可以让部署工具根据EJB Schema 的版本验证EJB 部署描述。 </xsd:documentation> </xsd:annotation> </xsd:attribute> <xsd:attribute name="metadata-complete" type="xsd:boolean"> xsd:annotation xsd:documentation metadata-complete 属性定义了用于这个模块的部署描述和其它相关部署描述是否完成,或者是否应当检查这个模块可获得的和与应用一起打包的类文件上指定的部署信息。如果metadata-complete 被设置成true,那么部署工具必须忽略所有指定部署信息的注释符。如果它被设置成false,那么部署工具必须按照规范检查应用中类的注释符。 </xsd:documentation> </xsd:annotation> </xsd:attribute> <xsd:attribute name="id" type="xsd:ID"/> </xsd:complexType> <xsd:complexType name="ejb-nameType"> xsd:annotation xsd:documentation
</xsd:documentation> </xsd:annotation> xsd:simpleContent <xsd:restriction base="javaee:xsdNMTOKENType"/> </xsd:simpleContent> </xsd:complexType> <xsd:complexType name="ejb-relationType"> xsd:annotation xsd:documentation ejb-relationType 描述了两个使用容器管理持久化的实体bean 间的关系。它由ejb-relation 元素使用。它包含了一个描述;一个可选的ejb-relation-name 元素和确切的两个关系角色声明,它们由ejb-relationship-role 元素定义。如果指定了关系的名称,则在ejb-jar 文件中这个名称必须是唯一的。 </xsd:documentation> </xsd:annotation>