📄 repository.dtd
字号:
<!-- For interfaces or abstract classes a class-descriptor holds a sequence of extent-class elements. For concrete classes it must have field-descriptors that describe primitive typed instance variables. References to other persistent entity classes are specified by reference-descriptor elements. Collections or arrays attributes that contain other persistent entity classes are specified by collection-descriptor elements Concrete base classes, may specify a sequence of extent-class elements, naming the derived classes. A class-descriptor may contain user defined custom attribute elements. The insert-procedure, update-procedure and delete-procedure elements identify the procedure/function that is defined in the database which will handle the insertion, update or deletion of an instance of this class. These elements are all optional. If they are absent then basic sql statements (INSERT INTO xxx..., UPDATE xxx, DELETE FROM xxx) will be utilized. --><!ELEMENT class-descriptor ((documentation?, object-cache?, extent-class+, attribute*) | (documentation?, object-cache?, extent-class*, field-descriptor+, reference-descriptor*, collection-descriptor*, index-descriptor*, attribute*, insert-procedure?, update-procedure?, delete-procedure?))><!-- The class attribute contains the full qualified name of the specified class. As this attribute is of type ID there can only be one class-descriptor per class. The isolation-level attribute defines the locking isolation level of the specified class (used by OJB's pessimistic locking api). Default is "empty String" to use isolation-level defined on "descriptor-repository" level. Note: This does NOT touch the jdbc-level of the connection. If the proxy attribute is set, proxies are used for all loading operations of instances of this class. If set to "dynamic", dynamic proxies are used. If set to another value this value is interpreted as the full-qualified name of the proxy class to use. If the proxy-prefetching-limit attribute (used with the proxy attribute) is set to the value > 0, the collections of objects of this class are materialized by groups of the specified size, say when user tries to access the first object of the collection, next proxy-prefetching-limit objects are loaded by one database query. Set this parameter to 0 if you want to turn this feature off. The schema attribute may contain the database schema owning the table mapped to this class. The table attribute specifies the table name this class is mapped to. The row-reader attribute may contain a full qualified class name. This class will be used as the RowReader implementation used to materialize instances of the persistent class. The accept-locks attribute specifies whether implicit locking should propagate to this class. Currently relevant for the ODMG layer only. The optional initialization-method specifies a no-argument instance method that is invoked after reading an instance from a database row. It can be used to do initialization and validations. The optional factory-class specifies a factory-class that that is to be used instead of a no argument constructor. If the factory-class is specified the factory-method also must be defined. factory-method refers to a static no-argument method of the factory-class class. The refresh attribute can be set to true to force OJB to refresh instances when loaded from cache. It's set to false by default. --><!ATTLIST class-descriptor class ID #REQUIRED isolation-level (read-uncommitted | read-committed | repeatable-read | serializable | optimistic | none) "" proxy CDATA #IMPLIED proxy-prefetching-limit CDATA #IMPLIED schema CDATA #IMPLIED table CDATA #IMPLIED row-reader CDATA #IMPLIED extends IDREF #IMPLIED accept-locks (true | false) "true" initialization-method CDATA #IMPLIED factory-class CDATA #IMPLIED factory-method CDATA #IMPLIED refresh (true | false) "false"><!-- An extent-class element is used to specify an implementing class or a derived class that belongs to the extent of all instances of the interface or base class. --><!ELEMENT extent-class (documentation?)><!-- The class-ref attribute must contain a fully qualified classname. The repository file must contain a class-descriptor for this class. --><!ATTLIST extent-class class-ref IDREF #REQUIRED><!-- A field descriptor contains mapping info for a primitive typed attribute of a persistent class. A field descriptor may contain custom attribute elements. --><!ELEMENT field-descriptor (documentation?, attribute*)><!-- <b>The id attribute is optional.</b> If not specified, OJB internally sorts field-descriptors according to their order of appearance in the repository file. If a different sort order is intended the id attribute may be used to hold a unique number identifying the decriptors position in the sequence of field-descriptors. The order of the numbers for the field-descriptors must correspond to the order of columns in the mapped table. The name attribute holds the name of the persistent classes attribute. If the PersistentFieldDefaultImpl is used there must be an attribute in the persistent class with this name. If the PersistentFieldPropertyImpl is used there must be a JavaBeans compliant property of this name. The table attribute may specify a table different from the mapped table for the persistent class. (currently not implemented). The column attribute specifies the column the persistent classes field is mapped to. The optional jdbc-type attribute specifies the JDBC type of the column. If not specified OJB tries to identify the JDBC type by inspecting the Java attribute by reflection. The primarykey specifies if the column is a primary key column. The nullable attribute specifies if the column may contain null values. The indexed attribute specifies if there is an index on this column The autoincrement attribute specifies if the values for the persistent attribute are automatically generated by OJB. The sequence-name attribute can be used to state explicitly a sequence name used by the sequence manager implementations. Check the docs/javadocs of the used sequence manager implementation to get information if this is a mandatory attribute. OJB standard sequence manager implementations build a sequence name by its own, if the attribute was not set. The locking attribute is set to true if the persistent attribute is used for optimistic locking. can only be set for TIMESTAMP and INTEGER columns. The updatelock attribute is set to false if the persistent attribute is used for optimistic locking AND the dbms should update the lock column itself. The default is true which means that when locking is true then OJB will update the locking fields. Can only be set for TIMESTAMP and INTEGER columns. The default-fetch attribute specifies whether the persistent attribute belongs to the JDO default fetch group. The conversion attribute contains a fully qualified class name. This class must implement the interface org.apache.ojb.accesslayer.conversions.FieldConversion. A FieldConversion can be used to implement conversions between Java- attributes and database columns. The length attribute can be used to specify a length setting, if required by the jdbc-type of the underlying database column. The precision attribute can be used to specify a precision setting, if required by the jdbc-type of the underlying database column. The scale attribute can be used to specify a scale setting, if required by the jdbc-type of the underlying database column. The access attribute specifies the accessibility of the field. "readonly" marks fields that are not to modified. "readwrite" marks fields that may be read and written to. "anonymous" marks anonymous fields. An anonymous field has a database representation (column) but no corresponding Java attribute. Hence the name of such a field does not refer to a Java attribute of the class, but is used as a unique identifier only. --><!ATTLIST field-descriptor id CDATA #IMPLIED name CDATA #REQUIRED table CDATA #IMPLIED column CDATA #REQUIRED jdbc-type (BIT | TINYINT | SMALLINT | INTEGER | BIGINT | DOUBLE | FLOAT | REAL | NUMERIC | DECIMAL | CHAR | VARCHAR | LONGVARCHAR | DATE | TIME | TIMESTAMP | BINARY | VARBINARY | LONGVARBINARY | CLOB | BLOB | STRUCT | ARRAY | REF | BOOLEAN | DATALINK) #IMPLIED primarykey (true | false) "false" nullable (true | false) "true" indexed (true | false) "false" autoincrement (true | false) "false" sequence-name CDATA #IMPLIED locking (true | false) "false" update-lock (true | false) "true" default-fetch (true | false) "false" conversion CDATA #IMPLIED length CDATA #IMPLIED precision CDATA #IMPLIED scale CDATA #IMPLIED access (readonly | readwrite | anonymous) "readwrite"><!-- An attribute element allows arbitrary name/value pairs to be represented in the repository. --><!ELEMENT attribute (documentation?)><!-- The attribute-name identifies the name of the attribute. The attribute-value identifies the value of the attribute.--><!ATTLIST attribute attribute-name CDATA #REQUIRED attribute-value CDATA #REQUIRED><!-- A reference-descriptor contains mapping info for an attribute of a persistent class that is not primitive but references another persistent entity Object. A foreignkey element contains information on foreign key columns that implement the association on the database level. A reference-decriptor may contain user defined attribute elements. --><!ELEMENT reference-descriptor (documentation?, foreignkey+, attribute*)><!-- The name attribute holds the name of the persistent classes attribute. If the PersistentFieldDefaultImpl is used there must be an attribute in the persistent class with this name. If the PersistentFieldPropertyImpl is used there must be a JavaBeans compliant property of this name. The class-ref attribute contains a fully qualified class name. This class is the Object type of the persistent reference attribute. As this is an IDREF there must be a class-descriptor for this class in the repository too. The proxy attribute can be set to true to specify that proxy based lazy loading should be used for this attribute. If the proxy-prefetching-limit attribute (used with the proxy attribute) is set to the value > 0, then loading of the reference for the first object of some collection causes loading of the references for the next proxy-prefetching-limit objects. Set this parameter to 0 if you want to turn this feature off. The refresh attribute can be set to true to force OJB to refresh object references on instance loading. The auto-retrieve attribute specifies whether OJB automatically retrieves this reference attribute on loading the persistent object. If set to false the reference attribute is set to null. In this case the user is responsible to fill the reference attribute. The auto-update attribute specifies whether OJB automatically stores this reference attribute on storing the persistent object or not or only link the reference. This attribute must be set to 'false' if using the OTM or JDO layer. For ODMG it must be 'none' (since OJB 1.0.2). More info see OJB documentation. The auto-delete attribute specifies whether OJB automatically deletes this reference attribute on deleting the persistent object or not. This attribute must be set to 'false' if using the OTM or JDO layer. For ODMG it must be 'none' (since OJB 1.0.2). More info see OJB documentation. The otm-dependent attribute specifies whether the OTM layer automatically creates the referred object or deletes it if the reference field is set to null. Also otm-dependent references behave as if auto-update and auto-delete were set to true, but the auto-update and auto-delete attributes themself must be always set to false for use with OTM layer. --><!ATTLIST reference-descriptor name CDATA #REQUIRED class-ref IDREF #REQUIRED proxy (true | false) "false" proxy-prefetching-limit CDATA #IMPLIED refresh (true | false) "false" auto-retrieve (true | false) "true" auto-update (none | link | object | true | false) "false" auto-delete (none | link | object | true | false) "false" otm-dependent (true | false) "false"><!-- A foreignkey element contains information on a foreign-key persistent attribute that implement the association on the database level. --><!ELEMENT foreignkey (documentation?)><!-- The field-id-ref contains the id attribute of the field-descriptor
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -