JBoss Tools SVN: r13149 - in workspace/max/jpaap: jpaap/resources and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2009-01-20 10:38:35 -0500 (Tue, 20 Jan 2009)
New Revision: 13149
Added:
workspace/max/jpaap/jpaap/resources/
workspace/max/jpaap/jpaap/resources/orm_2_0.xsd
workspace/max/jpaap/test/src/META-INF/
workspace/max/jpaap/test/src/META-INF/orm.xml
Modified:
workspace/max/jpaap/jpaap/build.xml
workspace/max/jpaap/jpaap/src/org/jboss/jpa/metamodel/ap/JPAMetaModelEntityProcessor.java
workspace/max/jpaap/test/build.xml
Log:
added ajxb into the mix to parse orm.xml file
Modified: workspace/max/jpaap/jpaap/build.xml
===================================================================
--- workspace/max/jpaap/jpaap/build.xml 2009-01-20 14:36:33 UTC (rev 13148)
+++ workspace/max/jpaap/jpaap/build.xml 2009-01-20 15:38:35 UTC (rev 13149)
@@ -8,7 +8,9 @@
<property name="target" value="1.6"/>
<property name="source" value="1.6"/>
<property name="src.dir" value="${basedir}/src"/>
+ <property name="resource.dir" value="${basedir}/resources"/>
<property name="build.dir" value="${basedir}/target"/>
+ <property name="gen.dir" value="${basedir}/target/gen-src"/>
<property name="classes.dir" value="${build.dir}/classes"/>
<property name="jar.name" value="jpaap"/>
<tstamp/>
@@ -16,9 +18,9 @@
<available classname="javax.persistence.spi.PersistenceProvider"/>
</condition>
<path id="lib.path">
- <fileset dir="${basedir}/../javax.persistence/target">
- <include name="**/*.jar"/>
- </fileset>
+ <fileset dir="${basedir}/../javax.persistence/target">
+ <include name="**/*.jar"/>
+ </fileset>
</path>
</target>
@@ -27,21 +29,32 @@
<delete dir="${build.dir}"/>
</target>
- <!-- COMPILE TARGET -->
+ <!-- JAXB SOURCE GENERATION -->
+ <target name="jaxb" depends="init">
+ <mkdir dir="${gen.dir}"/>
+ <exec executable="${java.home}/bin/xjc">
+ <arg value="-d"/>
+ <arg value="${gen.dir}"/>
+ <arg value="${resource.dir}/orm_2_0.xsd"/>
+ </exec>
+ </target>
+
+ <!-- COMPILE DEPENDEND PROJECT -->
<target name="compile-dependend" unless="${persistence.available}">
- <ant dir="../javax.persistence" inheritall="false"/>
+ <ant dir="../javax.persistence" inheritall="false"/>
</target>
<!-- COMPILE TARGET -->
- <target name="compile" depends="init,compile-dependend">
+ <target name="compile" depends="init,compile-dependend,jaxb">
<mkdir dir="${classes.dir}"/>
<echo message="${ant.project.name}: ${ant.file}"/>
<javac debug="true" debuglevel="${debuglevel}" destdir="${classes.dir}" source="${source}" target="${target}">
<src path="${src.dir}"/>
+ <src path="${gen.dir}"/>
<classpath refid="lib.path"/>
</javac>
<copy todir="${classes.dir}/META-INF">
- <fileset dir="${src.dir}/META-INF"/>
+ <fileset dir="${src.dir}/META-INF"/>
</copy>
</target>
Added: workspace/max/jpaap/jpaap/resources/orm_2_0.xsd
===================================================================
--- workspace/max/jpaap/jpaap/resources/orm_2_0.xsd (rev 0)
+++ workspace/max/jpaap/jpaap/resources/orm_2_0.xsd 2009-01-20 15:38:35 UTC (rev 13149)
@@ -0,0 +1,1504 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Java Persistence API object/relational mapping file schema -->
+<xsd:schema targetNamespace="http://java.sun.com/xml/ns/persistence/orm"
+ xmlns:orm="http://java.sun.com/xml/ns/persistence/orm"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified" attributeFormDefault="unqualified"
+ version="2.0">
+ <xsd:annotation>
+ <xsd:documentation>
+ @(#)orm_2_0.xsd 2.0 August 27 2008
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:annotation>
+ <xsd:documentation>
+ <![CDATA[
+This is the XML Schema for the persistence object/relational
+mapping file.
+The file may be named "META-INF/orm.xml" in the persistence
+archive or it may be named some other name which would be
+used to locate the file as resource on the classpath.
+Object/relational mapping files must indicate the object/relational
+mapping file schema by using the persistence namespace:
+http://java.sun.com/xml/ns/persistence
+and indicate the version of the schema by
+using the version element as shown below:
+<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm
+http://java.sun.com/xml/ns/persistence/orm/orm_2_0.xsd"
+version="2.0">
+...
+</entity-mappings>
+]]>
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType name="emptyType" />
+ <xsd:simpleType name="versionType">
+ <xsd:restriction base="xsd:token">
+ <xsd:pattern value="[0-9]+(\.[0-9]+)*" />
+ </xsd:restriction>
+ </xsd:simpleType>
+ <!-- **************************************************** -->
+ <xsd:element name="entity-mappings">
+ <xsd:complexType>
+ <xsd:annotation>
+ <xsd:documentation>
+ The entity-mappings element is the root element of
+ an mapping file. It contains the following four
+ types of elements: 1. The persistence-unit-metadata
+ element contains metadata for the entire persistence
+ unit. It is undefined if this element occurs in
+ multiple mapping files within the same persistence
+ unit. 2. The package, schema, catalog and access
+ elements apply to all of the entity,
+ mapped-superclass and embeddable elements defined in
+ the same file in which they occur. 3. The
+ sequence-generator, table-generator, named-query,
+ named-native-query and sql-result-set-mapping
+ elements are global to the persistence unit. It is
+ undefined to have more than one sequence-generator
+ or table-generator of the same name in the same or
+ different mapping files in a persistence unit. It is
+ also undefined to have more than one named-query,
+ named-native-query, or result-set-mapping of the
+ same name in the same or different mapping files in
+ a persistence unit. 4. The entity, mapped-superclass
+ and embeddable elements each define the mapping
+ information for a managed persistent class. The
+ mapping information contained in these elements may
+ be complete or it may be partial.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="description" type="xsd:string"
+ minOccurs="0" />
+ <xsd:element name="persistence-unit-metadata"
+ type="orm:persistence-unit-metadata" minOccurs="0" />
+ <xsd:element name="package" type="xsd:string"
+ minOccurs="0" />
+ <xsd:element name="schema" type="xsd:string"
+ minOccurs="0" />
+ <xsd:element name="catalog" type="xsd:string"
+ minOccurs="0" />
+ <xsd:element name="access" type="orm:access-type"
+ minOccurs="0" />
+ <xsd:element name="sequence-generator"
+ type="orm:sequence-generator" minOccurs="0"
+ maxOccurs="unbounded" />
+ <xsd:element name="table-generator"
+ type="orm:table-generator" minOccurs="0"
+ maxOccurs="unbounded" />
+ <xsd:element name="named-query" type="orm:named-query"
+ minOccurs="0" maxOccurs="unbounded" />
+ <xsd:element name="named-native-query"
+ type="orm:named-native-query" minOccurs="0"
+ maxOccurs="unbounded" />
+ <xsd:element name="sql-result-set-mapping"
+ type="orm:sql-result-set-mapping" minOccurs="0"
+ maxOccurs="unbounded" />
+ <xsd:element name="mapped-superclass"
+ type="orm:mapped-superclass" minOccurs="0"
+ maxOccurs="unbounded" />
+ <xsd:element name="entity" type="orm:entity"
+ minOccurs="0" maxOccurs="unbounded" />
+ <xsd:element name="embeddable" type="orm:embeddable"
+ minOccurs="0" maxOccurs="unbounded" />
+ </xsd:sequence>
+ <xsd:attribute name="version" type="orm:versionType"
+ fixed="2.0" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ <!-- **************************************************** -->
+ <xsd:complexType name="persistence-unit-metadata">
+ <xsd:annotation>
+ <xsd:documentation>
+ Metadata that applies to the persistence unit and not
+ just to the mapping file in which it is contained. If
+ the xml-mapping-metadata-complete element is specified,
+ the complete set of mapping metadata for the persistence
+ unit is contained in the XML mapping files for the
+ persistence unit.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="description" type="xsd:string"
+ minOccurs="0" />
+ <xsd:element name="xml-mapping-metadata-complete"
+ type="orm:emptyType" minOccurs="0" />
+ <xsd:element name="persistence-unit-defaults"
+ type="orm:persistence-unit-defaults" minOccurs="0" />
+ </xsd:sequence>
+ </xsd:complexType>
+ <!-- **************************************************** -->
+ <xsd:complexType name="persistence-unit-defaults">
+ <xsd:annotation>
+ <xsd:documentation>
+ These defaults are applied to the persistence unit as a
+ whole unless they are overridden by local annotation or
+ XML element settings. schema - Used as the schema for
+ all tables, secondary tables, collection tables,
+ sequence generators, and table generators that apply to
+ the persistence unit catalog - Used as the catalog for
+ all tables, secondary tables, collection tables,
+ sequence generators, and table generators that apply to
+ the persistence unit access - Used as the access type
+ for all managed classes in the persistence unit
+ cascade-persist - Adds cascade-persist to the set of
+ cascade options in all entity relationships of the
+ persistence unit entity-listeners - List of default
+ entity listeners to be invoked on each entity in the
+ persistence unit.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="description" type="xsd:string"
+ minOccurs="0" />
+ <xsd:element name="schema" type="xsd:string" minOccurs="0" />
+ <xsd:element name="catalog" type="xsd:string" minOccurs="0" />
+ <xsd:element name="access" type="orm:access-type"
+ minOccurs="0" />
+ <xsd:element name="cascade-persist" type="orm:emptyType"
+ minOccurs="0" />
+ <xsd:element name="entity-listeners"
+ type="orm:entity-listeners" minOccurs="0" />
+ </xsd:sequence>
+ </xsd:complexType>
+ <!-- **************************************************** -->
+ <xsd:complexType name="entity">
+ <xsd:annotation>
+ <xsd:documentation>
+ Defines the settings and mappings for an entity. Is
+ allowed to be sparsely populated and used in conjunction
+ with the annotations. Alternatively, the
+ metadata-complete attribute can be used to indicate that
+ no annotations on the entity class (and its fields or
+ properties) are to be processed. If this is the case
+ then the defaulting rules for the entity and its
+ subelements will be recursively applied. @Target(TYPE)
+ @Retention(RUNTIME) public @interface Entity { String
+ name() default ""; }
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="description" type="xsd:string"
+ minOccurs="0" />
+ <xsd:element name="table" type="orm:table" minOccurs="0" />
+ <xsd:element name="secondary-table"
+ type="orm:secondary-table" minOccurs="0"
+ maxOccurs="unbounded" />
+ <xsd:element name="primary-key-join-column"
+ type="orm:primary-key-join-column" minOccurs="0"
+ maxOccurs="unbounded" />
+ <xsd:element name="id-class" type="orm:id-class"
+ minOccurs="0" />
+ <xsd:element name="inheritance" type="orm:inheritance"
+ minOccurs="0" />
+ <xsd:element name="discriminator-value"
+ type="orm:discriminator-value" minOccurs="0" />
+ <xsd:element name="discriminator-column"
+ type="orm:discriminator-column" minOccurs="0" />
+ <xsd:element name="sequence-generator"
+ type="orm:sequence-generator" minOccurs="0" />
+ <xsd:element name="table-generator"
+ type="orm:table-generator" minOccurs="0" />
+ <xsd:element name="named-query" type="orm:named-query"
+ minOccurs="0" maxOccurs="unbounded" />
+ <xsd:element name="named-native-query"
+ type="orm:named-native-query" minOccurs="0"
+ maxOccurs="unbounded" />
+ <xsd:element name="sql-result-set-mapping"
+ type="orm:sql-result-set-mapping" minOccurs="0"
+ maxOccurs="unbounded" />
+ <xsd:element name="exclude-default-listeners"
+ type="orm:emptyType" minOccurs="0" />
+ <xsd:element name="exclude-superclass-listeners"
+ type="orm:emptyType" minOccurs="0" />
+ <xsd:element name="entity-listeners"
+ type="orm:entity-listeners" minOccurs="0" />
+ <xsd:element name="pre-persist" type="orm:pre-persist"
+ minOccurs="0" />
+ <xsd:element name="post-persist" type="orm:post-persist"
+ minOccurs="0" />
+ <xsd:element name="pre-remove" type="orm:pre-remove"
+ minOccurs="0" />
+ <xsd:element name="post-remove" type="orm:post-remove"
+ minOccurs="0" />
+ <xsd:element name="pre-update" type="orm:pre-update"
+ minOccurs="0" />
+ <xsd:element name="post-update" type="orm:post-update"
+ minOccurs="0" />
+ <xsd:element name="post-load" type="orm:post-load"
+ minOccurs="0" />
+ <xsd:element name="attribute-override"
+ type="orm:attribute-override" minOccurs="0"
+ maxOccurs="unbounded" />
+ <xsd:element name="association-override"
+ type="orm:association-override" minOccurs="0"
+ maxOccurs="unbounded" />
+ <xsd:element name="attributes" type="orm:attributes"
+ minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" />
+ <xsd:attribute name="class" type="xsd:string" use="required" />
+ <xsd:attribute name="access" type="orm:access-type" />
+ <xsd:attribute name="metadata-complete" type="xsd:boolean" />
+ </xsd:complexType>
+ <!-- **************************************************** -->
+ <xsd:simpleType name="access-type">
+ <xsd:annotation>
+ <xsd:documentation>
+ This element determines how the persistence provider
+ accesses the state of an entity or embedded object.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:restriction base="xsd:token">
+ <xsd:enumeration value="PROPERTY" />
+ <xsd:enumeration value="FIELD" />
+ </xsd:restriction>
+ </xsd:simpleType>
+ <!-- **************************************************** -->
+ <xsd:complexType name="association-override">
+ <xsd:annotation>
+ <xsd:documentation>
+ @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
+ public @interface AssociationOverride { String name();
+ JoinColumn[] joinColumns() default{}; JoinTable
+ joinTable() default @JoinTable; }
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="description" type="xsd:string"
+ minOccurs="0" />
+ <xsd:element name="join-column" type="orm:join-column"
+ minOccurs="0" maxOccurs="unbounded" />
+ <xsd:element name="join-table" type="orm:join-table"
+ minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ <!-- **************************************************** -->
+ <xsd:complexType name="attribute-override">
+ <xsd:annotation>
+ <xsd:documentation>
+ @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
+ public @interface AttributeOverride { String name();
+ Column column(); }
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="description" type="xsd:string"
+ minOccurs="0" />
+ <xsd:element name="column" type="orm:column" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ <!-- **************************************************** -->
+ <xsd:complexType name="attributes">
+ <xsd:annotation>
+ <xsd:documentation>
+ This element contains the entity field or property
+ mappings. It may be sparsely populated to include only a
+ subset of the fields or properties. If metadata-complete
+ for the entity is true then the remainder of the
+ attributes will be defaulted according to the default
+ rules.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="description" type="xsd:string"
+ minOccurs="0" />
+ <xsd:choice>
+ <xsd:element name="id" type="orm:id" minOccurs="0"
+ maxOccurs="unbounded" />
+ <xsd:element name="embedded-id" type="orm:embedded-id"
+ minOccurs="0" />
+ </xsd:choice>
+ <xsd:element name="basic" type="orm:basic" minOccurs="0"
+ maxOccurs="unbounded" />
+ <xsd:element name="version" type="orm:version" minOccurs="0"
+ maxOccurs="unbounded" />
+ <xsd:element name="many-to-one" type="orm:many-to-one"
+ minOccurs="0" maxOccurs="unbounded" />
+ <xsd:element name="one-to-many" type="orm:one-to-many"
+ minOccurs="0" maxOccurs="unbounded" />
+ <xsd:element name="one-to-one" type="orm:one-to-one"
+ minOccurs="0" maxOccurs="unbounded" />
+ <xsd:element name="many-to-many" type="orm:many-to-many"
+ minOccurs="0" maxOccurs="unbounded" />
+ <xsd:element name="element-collection"
+ type="orm:element-collection" minOccurs="0"
+ maxOccurs="unbounded" />
+ <xsd:element name="embedded" type="orm:embedded"
+ minOccurs="0" maxOccurs="unbounded" />
+ <xsd:element name="transient" type="orm:transient"
+ minOccurs="0" maxOccurs="unbounded" />
+ </xsd:sequence>
+ </xsd:complexType>
+ <!-- **************************************************** -->
+ <xsd:complexType name="basic">
+ <xsd:annotation>
+ <xsd:documentation>
+ @Target({METHOD, FIELD}) @Retention(RUNTIME) public
+ @interface Basic { FetchType fetch() default EAGER;
+ boolean optional() default true; }
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="column" type="orm:column" minOccurs="0" />
+ <xsd:choice>
+ <xsd:element name="lob" type="orm:lob" minOccurs="0" />
+ <xsd:element name="temporal" type="orm:temporal"
+ minOccurs="0" />
+ <xsd:element name="enumerated" type="orm:enumerated"
+ minOccurs="0" />
+ </xsd:choice>
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ <xsd:attribute name="fetch" type="orm:fetch-type" />
+ <xsd:attribute name="optional" type="xsd:boolean" />
+ <xsd:attribute name="access" type="orm:access-type" />
+ </xsd:complexType>
+ <!-- **************************************************** -->
+ <xsd:complexType name="cascade-type">
+ <xsd:annotation>
+ <xsd:documentation>
+ public enum CascadeType { ALL, PERSIST, MERGE, REMOVE,
+ REFRESH};
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="cascade-all" type="orm:emptyType"
+ minOccurs="0" />
+ <xsd:element name="cascade-persist" type="orm:emptyType"
+ minOccurs="0" />
+ <xsd:element name="cascade-merge" type="orm:emptyType"
+ minOccurs="0" />
+ <xsd:element name="cascade-remove" type="orm:emptyType"
+ minOccurs="0" />
+ <xsd:element name="cascade-refresh" type="orm:emptyType"
+ minOccurs="0" />
+ </xsd:sequence>
+ </xsd:complexType>
+ <!-- **************************************************** -->
+ <xsd:complexType name="collection-table">
+ <xsd:annotation>
+ <xsd:documentation>
+ @Target({METHOD, FIELD}) @Retention(RUNTIME) public
+ @interface CollectionTable { String name() default "";
+ String catalog() default ""; String schema() default "";
+ JoinColumn[] joinColumns() default {};
+ UniqueConstraint[] uniqueConstraints() default {}; }
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="join-column" type="orm:join-column"
+ minOccurs="0" maxOccurs="unbounded" />
+ <xsd:element name="unique-constraint"
+ type="orm:unique-constraint" minOccurs="0"
+ maxOccurs="unbounded" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" />
+ <xsd:attribute name="catalog" type="xsd:string" />
+ <xsd:attribute name="schema" type="xsd:string" />
+ </xsd:complexType>
+ <!-- **************************************************** -->
+ <xsd:complexType name="column">
+ <xsd:annotation>
+ <xsd:documentation>
+ @Target({METHOD, FIELD}) @Retention(RUNTIME) public
+ @interface Column { String name() default ""; boolean
+ unique() default false; boolean nullable() default true;
+ boolean insertable() default true; boolean updatable()
+ default true; String columnDefinition() default "";
+ String table() default ""; int length() default 255; int
+ precision() default 0; // decimal precision int scale()
+ default 0; // decimal scale }
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:attribute name="name" type="xsd:string" />
+ <xsd:attribute name="unique" type="xsd:boolean" />
+ <xsd:attribute name="nullable" type="xsd:boolean" />
+ <xsd:attribute name="insertable" type="xsd:boolean" />
+ <xsd:attribute name="updatable" type="xsd:boolean" />
+ <xsd:attribute name="column-definition" type="xsd:string" />
+ <xsd:attribute name="table" type="xsd:string" />
+ <xsd:attribute name="length" type="xsd:int" />
+ <xsd:attribute name="precision" type="xsd:int" />
+ <xsd:attribute name="scale" type="xsd:int" />
+ </xsd:complexType>
+ <!-- **************************************************** -->
+ <xsd:complexType name="column-result">
+ <xsd:annotation>
+ <xsd:documentation>
+ @Target({}) @Retention(RUNTIME) public @interface
+ ColumnResult { String name(); }
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ <!-- **************************************************** -->
+ <xsd:complexType name="discriminator-column">
+ <xsd:annotation>
+ <xsd:documentation>
+ @Target({TYPE}) @Retention(RUNTIME) public @interface
+ DiscriminatorColumn { String name() default "DTYPE";
+ DiscriminatorType discriminatorType() default STRING;
+ String columnDefinition() default ""; int length()
+ default 31; }
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:attribute name="name" type="xsd:string" />
+ <xsd:attribute name="discriminator-type"
+ type="orm:discriminator-type" />
+ <xsd:attribute name="column-definition" type="xsd:string" />
+ <xsd:attribute name="length" type="xsd:int" />
+ </xsd:complexType>
+ <!-- **************************************************** -->
+ <xsd:simpleType name="discriminator-type">
+ <xsd:annotation>
+ <xsd:documentation>
+ public enum DiscriminatorType { STRING, CHAR, INTEGER };
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:restriction base="xsd:token">
+ <xsd:enumeration value="STRING" />
+ <xsd:enumeration value="CHAR" />
+ <xsd:enumeration value="INTEGER" />
+ </xsd:restriction>
+ </xsd:simpleType>
+ <!-- **************************************************** -->
+ <xsd:simpleType name="discriminator-value">
+ <xsd:annotation>
+ <xsd:documentation>
+ @Target({TYPE}) @Retention(RUNTIME) public @interface
+ DiscriminatorValue { String value(); }
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:restriction base="xsd:string" />
+ </xsd:simpleType>
+ <!-- **************************************************** -->
+ <xsd:complexType name="element-collection">
+ <xsd:annotation>
+ <xsd:documentation>
+ @Target({METHOD, FIELD}) @Retention(RUNTIME) public
+ @interface ElementCollection { Class targetClass()
+ default void.class; FetchType fetch() default LAZY; }
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="column" type="orm:column" minOccurs="0" />
+ <xsd:choice>
+ <xsd:element name="order-by" type="orm:order-by"
+ minOccurs="0" />
+ <xsd:element name="order-column" type="orm:order-column"
+ minOccurs="0" />
+ </xsd:choice>
+ <xsd:choice>
+ <xsd:element name="map-key" type="orm:map-key"
+ minOccurs="0" />
+ <xsd:sequence>
+ <xsd:element name="map-key-class"
+ type="orm:map-key-class" minOccurs="0" />
+ <xsd:choice>
+ <xsd:element name="map-key-column"
+ type="orm:map-key-column" minOccurs="0" />
+ <xsd:element name="map-key-join-column"
+ type="orm:map-key-join-column" minOccurs="0"
+ maxOccurs="unbounded" />
+ </xsd:choice>
+ </xsd:sequence>
+ </xsd:choice>
+ <xsd:element name="collection-table"
+ type="orm:collection-table" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ <xsd:attribute name="target-entity" type="xsd:string" />
+ <xsd:attribute name="fetch" type="orm:fetch-type" />
+ <xsd:attribute name="access" type="orm:access-type" />
+ </xsd:complexType>
+ <!-- **************************************************** -->
+ <xsd:complexType name="embeddable">
+ <xsd:annotation>
+ <xsd:documentation>
+ Defines the settings and mappings for embeddable
+ objects. Is allowed to be sparsely populated and used in
+ conjunction with the annotations. Alternatively, the
+ metadata-complete attribute can be used to indicate that
+ no annotations are to be processed in the class. If this
+ is the case then the defaulting rules will be
+ recursively applied. @Target({TYPE}) @Retention(RUNTIME)
+ public @interface Embeddable {}
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="description" type="xsd:string"
+ minOccurs="0" />
+ <xsd:element name="attributes"
+ type="orm:embeddable-attributes" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="class" type="xsd:string" use="required" />
+ <xsd:attribute name="access" type="orm:access-type" />
+ <xsd:attribute name="metadata-complete" type="xsd:boolean" />
+ </xsd:complexType>
+ <!-- **************************************************** -->
+ <xsd:complexType name="embeddable-attributes">
+ <xsd:sequence>
+ <xsd:element name="basic" type="orm:basic" minOccurs="0"
+ maxOccurs="unbounded" />
+ <xsd:element name="many-to-one" type="orm:many-to-one"
+ minOccurs="0" maxOccurs="unbounded" />
+ <xsd:element name="one-to-many" type="orm:one-to-many"
+ minOccurs="0" maxOccurs="unbounded" />
+ <xsd:element name="one-to-one" type="orm:one-to-one"
+ minOccurs="0" maxOccurs="unbounded" />
+ <xsd:element name="many-to-many" type="orm:many-to-many"
+ minOccurs="0" maxOccurs="unbounded" />
+ <xsd:element name="element-collection"
+ type="orm:element-collection" minOccurs="0"
+ maxOccurs="unbounded" />
+ <xsd:element name="embedded" type="orm:embedded"
+ minOccurs="0" maxOccurs="unbounded" />
+ <xsd:element name="transient" type="orm:transient"
+ minOccurs="0" maxOccurs="unbounded" />
+ </xsd:sequence>
+ </xsd:complexType>
+ <!-- **************************************************** -->
+ <xsd:complexType name="embedded">
+ <xsd:annotation>
+ <xsd:documentation>
+ @Target({METHOD, FIELD}) @Retention(RUNTIME) public
+ @interface Embedded {}
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="attribute-override"
+ type="orm:attribute-override" minOccurs="0"
+ maxOccurs="unbounded" />
+ <xsd:element name="association-override"
+ type="orm:association-override" minOccurs="0"
+ maxOccurs="unbounded" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ <xsd:attribute name="access" type="orm:access-type" />
+ </xsd:complexType>
+ <!-- **************************************************** -->
+ <xsd:complexType name="embedded-id">
+ <xsd:annotation>
+ <xsd:documentation>
+ @Target({METHOD, FIELD}) @Retention(RUNTIME) public
+ @interface EmbeddedId {}
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="attribute-override"
+ type="orm:attribute-override" minOccurs="0"
+ maxOccurs="unbounded" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ <xsd:attribute name="access" type="orm:access-type" />
+ </xsd:complexType>
+ <!-- **************************************************** -->
+ <xsd:complexType name="entity-listener">
+ <xsd:annotation>
+ <xsd:documentation>
+ Defines an entity listener to be invoked at lifecycle
+ events for the entities that list this listener.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="description" type="xsd:string"
+ minOccurs="0" />
+ <xsd:element name="pre-persist" type="orm:pre-persist"
+ minOccurs="0" />
+ <xsd:element name="post-persist" type="orm:post-persist"
+ minOccurs="0" />
+ <xsd:element name="pre-remove" type="orm:pre-remove"
+ minOccurs="0" />
+ <xsd:element name="post-remove" type="orm:post-remove"
+ minOccurs="0" />
+ <xsd:element name="pre-update" type="orm:pre-update"
+ minOccurs="0" />
+ <xsd:element name="post-update" type="orm:post-update"
+ minOccurs="0" />
+ <xsd:element name="post-load" type="orm:post-load"
+ minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="class" type="xsd:string" use="required" />
+ </xsd:complexType>
+ <!-- **************************************************** -->
+ <xsd:complexType name="entity-listeners">
+ <xsd:annotation>
+ <xsd:documentation>
+ @Target({TYPE}) @Retention(RUNTIME) public @interface
+ EntityListeners { Class[] value(); }
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="entity-listener"
+ type="orm:entity-listener" minOccurs="0"
+ maxOccurs="unbounded" />
+ </xsd:sequence>
+ </xsd:complexType>
+ <!-- **************************************************** -->
+ <xsd:complexType name="entity-result">
+ <xsd:annotation>
+ <xsd:documentation>
+ @Target({}) @Retention(RUNTIME) public @interface
+ EntityResult { Class entityClass(); FieldResult[]
+ fields() default {}; String discriminatorColumn()
+ default ""; }
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="field-result" type="orm:field-result"
+ minOccurs="0" maxOccurs="unbounded" />
+ </xsd:sequence>
+ <xsd:attribute name="entity-class" type="xsd:string"
+ use="required" />
+ <xsd:attribute name="discriminator-column" type="xsd:string" />
+ </xsd:complexType>
+ <!-- **************************************************** -->
+ <xsd:simpleType name="enum-type">
+ <xsd:annotation>
+ <xsd:documentation>
+ public enum EnumType { ORDINAL, STRING }
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:restriction base="xsd:token">
+ <xsd:enumeration value="ORDINAL" />
+ <xsd:enumeration value="STRING" />
+ </xsd:restriction>
+ </xsd:simpleType>
+ <!-- **************************************************** -->
+ <xsd:simpleType name="enumerated">
+ <xsd:annotation>
+ <xsd:documentation>
+ @Target({METHOD, FIELD}) @Retention(RUNTIME) public
+ @interface Enumerated { EnumType value() default
+ ORDINAL; }
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:restriction base="orm:enum-type" />
+ </xsd:simpleType>
+ <!-- **************************************************** -->
+ <xsd:simpleType name="fetch-type">
+ <xsd:annotation>
+ <xsd:documentation>
+ public enum FetchType { LAZY, EAGER };
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:restriction base="xsd:token">
+ <xsd:enumeration value="LAZY" />
+ <xsd:enumeration value="EAGER" />
+ </xsd:restriction>
+ </xsd:simpleType>
+ <!-- **************************************************** -->
+ <xsd:complexType name="field-result">
+ <xsd:annotation>
+ <xsd:documentation>
+ @Target({}) @Retention(RUNTIME) public @interface
+ FieldResult { String name(); String column(); }
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ <xsd:attribute name="column" type="xsd:string" use="required" />
+ </xsd:complexType>
+ <!-- **************************************************** -->
+ <xsd:complexType name="generated-value">
+ <xsd:annotation>
+ <xsd:documentation>
+ @Target({METHOD, FIELD}) @Retention(RUNTIME) public
+ @interface GeneratedValue { GenerationType strategy()
+ default AUTO; String generator() default ""; }
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:attribute name="strategy" type="orm:generation-type" />
+ <xsd:attribute name="generator" type="xsd:string" />
+ </xsd:complexType>
+ <!-- **************************************************** -->
+ <xsd:simpleType name="generation-type">
+ <xsd:annotation>
+ <xsd:documentation>
+ public enum GenerationType { TABLE, SEQUENCE, IDENTITY,
+ AUTO };
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:restriction base="xsd:token">
+ <xsd:enumeration value="TABLE" />
+ <xsd:enumeration value="SEQUENCE" />
+ <xsd:enumeration value="IDENTITY" />
+ <xsd:enumeration value="AUTO" />
+ </xsd:restriction>
+ </xsd:simpleType>
+ <!-- **************************************************** -->
+ <xsd:complexType name="id">
+ <xsd:annotation>
+ <xsd:documentation>
+ @Target({METHOD, FIELD}) @Retention(RUNTIME) public
+ @interface Id {}
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="column" type="orm:column" minOccurs="0" />
+ <xsd:element name="generated-value"
+ type="orm:generated-value" minOccurs="0" />
+ <xsd:element name="temporal" type="orm:temporal"
+ minOccurs="0" />
+ <xsd:element name="table-generator"
+ type="orm:table-generator" minOccurs="0" />
+ <xsd:element name="sequence-generator"
+ type="orm:sequence-generator" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ <xsd:attribute name="access" type="orm:access-type" />
+ </xsd:complexType>
+ <!-- **************************************************** -->
+ <xsd:complexType name="id-class">
+ <xsd:annotation>
+ <xsd:documentation>
+ @Target({TYPE}) @Retention(RUNTIME) public @interface
+ IdClass { Class value(); }
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:attribute name="class" type="xsd:string" use="required" />
+ </xsd:complexType>
+ <!-- **************************************************** -->
+ <xsd:complexType name="inheritance">
+ <xsd:annotation>
+ <xsd:documentation>
+ @Target({TYPE}) @Retention(RUNTIME) public @interface
+ Inheritance { InheritanceType strategy() default
+ SINGLE_TABLE; }
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:attribute name="strategy" type="orm:inheritance-type" />
+ </xsd:complexType>
+ <!-- **************************************************** -->
+ <xsd:simpleType name="inheritance-type">
+ <xsd:annotation>
+ <xsd:documentation>
+ public enum InheritanceType { SINGLE_TABLE, JOINED,
+ TABLE_PER_CLASS};
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:restriction base="xsd:token">
+ <xsd:enumeration value="SINGLE_TABLE" />
+ <xsd:enumeration value="JOINED" />
+ <xsd:enumeration value="TABLE_PER_CLASS" />
+ </xsd:restriction>
+ </xsd:simpleType>
+ <!-- **************************************************** -->
+ <xsd:complexType name="join-column">
+ <xsd:annotation>
+ <xsd:documentation>
+ @Target({METHOD, FIELD}) @Retention(RUNTIME) public
+ @interface JoinColumn { String name() default ""; String
+ referencedColumnName() default ""; boolean unique()
+ default false; boolean nullable() default true; boolean
+ insertable() default true; boolean updatable() default
+ true; String columnDefinition() default ""; String
+ table() default ""; }
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:attribute name="name" type="xsd:string" />
+ <xsd:attribute name="referenced-column-name" type="xsd:string" />
+ <xsd:attribute name="unique" type="xsd:boolean" />
+ <xsd:attribute name="nullable" type="xsd:boolean" />
+ <xsd:attribute name="insertable" type="xsd:boolean" />
+ <xsd:attribute name="updatable" type="xsd:boolean" />
+ <xsd:attribute name="column-definition" type="xsd:string" />
+ <xsd:attribute name="table" type="xsd:string" />
+ </xsd:complexType>
+ <!-- **************************************************** -->
+ <xsd:complexType name="join-table">
+ <xsd:annotation>
+ <xsd:documentation>
+ @Target({METHOD, FIELD}) @Retention(RUNTIME) public
+ @interface JoinTable { String name() default ""; String
+ catalog() default ""; String schema() default "";
+ JoinColumn[] joinColumns() default {}; JoinColumn[]
+ inverseJoinColumns() default {}; UniqueConstraint[]
+ uniqueConstraints() default {}; }
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="join-column" type="orm:join-column"
+ minOccurs="0" maxOccurs="unbounded" />
+ <xsd:element name="inverse-join-column"
+ type="orm:join-column" minOccurs="0"
+ maxOccurs="unbounded" />
+ <xsd:element name="unique-constraint"
+ type="orm:unique-constraint" minOccurs="0"
+ maxOccurs="unbounded" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" />
+ <xsd:attribute name="catalog" type="xsd:string" />
+ <xsd:attribute name="schema" type="xsd:string" />
+ </xsd:complexType>
+ <!-- **************************************************** -->
+ <xsd:complexType name="lob">
+ <xsd:annotation>
+ <xsd:documentation>
+ @Target({METHOD, FIELD}) @Retention(RUNTIME) public
+ @interface Lob {}
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:complexType>
+ <!-- **************************************************** -->
+ <xsd:complexType name="many-to-many">
+ <xsd:annotation>
+ <xsd:documentation>
+ @Target({METHOD, FIELD}) @Retention(RUNTIME) public
+ @interface ManyToMany { Class targetEntity() default
+ void.class; CascadeType[] cascade() default {};
+ FetchType fetch() default LAZY; String mappedBy()
+ default ""; }
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:choice>
+ <xsd:element name="order-by" type="orm:order-by"
+ minOccurs="0" />
+ <xsd:element name="order-column" type="orm:order-column"
+ minOccurs="0" />
+ </xsd:choice>
+ <xsd:choice>
+ <xsd:element name="map-key" type="orm:map-key"
+ minOccurs="0" />
+ <xsd:sequence>
+ <xsd:element name="map-key-class"
+ type="orm:map-key-class" minOccurs="0" />
+ <xsd:choice>
+ <xsd:element name="map-key-column"
+ type="orm:map-key-column" minOccurs="0" />
+ <xsd:element name="map-key-join-column"
+ type="orm:map-key-join-column" minOccurs="0"
+ maxOccurs="unbounded" />
+ </xsd:choice>
+ </xsd:sequence>
+ </xsd:choice>
+ <xsd:element name="join-table" type="orm:join-table"
+ minOccurs="0" />
+ <xsd:element name="cascade" type="orm:cascade-type"
+ minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ <xsd:attribute name="target-entity" type="xsd:string" />
+ <xsd:attribute name="fetch" type="orm:fetch-type" />
+ <xsd:attribute name="access" type="orm:access-type" />
+ <xsd:attribute name="mapped-by" type="xsd:string" />
+ </xsd:complexType>
+ <!-- **************************************************** -->
+ <xsd:complexType name="many-to-one">
+ <xsd:annotation>
+ <xsd:documentation>
+ @Target({METHOD, FIELD}) @Retention(RUNTIME) public
+ @interface ManyToOne { Class targetEntity() default
+ void.class; CascadeType[] cascade() default {};
+ FetchType fetch() default EAGER; boolean optional()
+ default true; }
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:choice>
+ <xsd:element name="join-column" type="orm:join-column"
+ minOccurs="0" maxOccurs="unbounded" />
+ <xsd:element name="join-table" type="orm:join-table"
+ minOccurs="0" />
+ </xsd:choice>
+ <xsd:element name="cascade" type="orm:cascade-type"
+ minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ <xsd:attribute name="target-entity" type="xsd:string" />
+ <xsd:attribute name="fetch" type="orm:fetch-type" />
+ <xsd:attribute name="optional" type="xsd:boolean" />
+ <xsd:attribute name="access" type="orm:access-type" />
+ <xsd:attribute name="mapped-by-id" type="xsd:string" />
+ <xsd:attribute name="id" type="xsd:boolean" />
+ </xsd:complexType>
+ <!-- **************************************************** -->
+ <xsd:complexType name="map-key">
+ <xsd:annotation>
+ <xsd:documentation>
+ @Target({METHOD, FIELD}) @Retention(RUNTIME) public
+ @interface MapKey { String name() default ""; }
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ <!-- **************************************************** -->
+ <xsd:complexType name="map-key-class">
+ <xsd:annotation>
+ <xsd:documentation>
+ @Target({METHOD, FIELD}) @Retention(RUNTIME) public
+ @interface MapKeyClass { Class value(); }
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:attribute name="class" type="xsd:string" use="required" />
+ </xsd:complexType>
+ <!-- **************************************************** -->
+ <xsd:complexType name="map-key-column">
+ <xsd:annotation>
+ <xsd:documentation>
+ @Target({METHOD, FIELD}) @Retention(RUNTIME) public
+ @interface MapKeyColumn { String name() default "";
+ boolean unique() default false; boolean nullable()
+ default false; boolean insertable() default true;
+ boolean updatable() default true; String
+ columnDefinition() default ""; String table() default
+ ""; int length() default 255; int precision() default 0;
+ // decimal precision int scale() default 0; // decimal
+ scale }
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:attribute name="name" type="xsd:string" />
+ <xsd:attribute name="unique" type="xsd:boolean" />
+ <xsd:attribute name="nullable" type="xsd:boolean" />
+ <xsd:attribute name="insertable" type="xsd:boolean" />
+ <xsd:attribute name="updatable" type="xsd:boolean" />
+ <xsd:attribute name="column-definition" type="xsd:string" />
+ <xsd:attribute name="table" type="xsd:string" />
+ <xsd:attribute name="length" type="xsd:int" />
+ <xsd:attribute name="precision" type="xsd:int" />
+ <xsd:attribute name="scale" type="xsd:int" />
+ </xsd:complexType>
+ <!-- **************************************************** -->
+ <xsd:complexType name="map-key-join-column">
+ <xsd:annotation>
+ <xsd:documentation>
+ @Target({METHOD, FIELD}) @Retention(RUNTIME) public
+ @interface MapKeyJoinColumn { String name() default "";
+ String referencedColumnName() default ""; boolean
+ unique() default false; boolean nullable() default
+ false; boolean insertable() default true; boolean
+ updatable() default true; String columnDefinition()
+ default ""; String table() default ""; }
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:attribute name="name" type="xsd:string" />
+ <xsd:attribute name="referenced-column-name" type="xsd:string" />
+ <xsd:attribute name="unique" type="xsd:boolean" />
+ <xsd:attribute name="nullable" type="xsd:boolean" />
+ <xsd:attribute name="insertable" type="xsd:boolean" />
+ <xsd:attribute name="updatable" type="xsd:boolean" />
+ <xsd:attribute name="column-definition" type="xsd:string" />
+ <xsd:attribute name="table" type="xsd:string" />
+ </xsd:complexType>
+ <!-- **************************************************** -->
+ <xsd:complexType name="mapped-superclass">
+ <xsd:annotation>
+ <xsd:documentation>
+ Defines the settings and mappings for a mapped
+ superclass. Is allowed to be sparsely populated and used
+ in conjunction with the annotations. Alternatively, the
+ metadata-complete attribute can be used to indicate that
+ no annotations are to be processed If this is the case
+ then the defaulting rules will be recursively applied.
+ @Target(TYPE) @Retention(RUNTIME) public @interface
+ MappedSuperclass{}
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="description" type="xsd:string"
+ minOccurs="0" />
+ <xsd:element name="id-class" type="orm:id-class"
+ minOccurs="0" />
+ <xsd:element name="exclude-default-listeners"
+ type="orm:emptyType" minOccurs="0" />
+ <xsd:element name="exclude-superclass-listeners"
+ type="orm:emptyType" minOccurs="0" />
+ <xsd:element name="entity-listeners"
+ type="orm:entity-listeners" minOccurs="0" />
+ <xsd:element name="pre-persist" type="orm:pre-persist"
+ minOccurs="0" />
+ <xsd:element name="post-persist" type="orm:post-persist"
+ minOccurs="0" />
+ <xsd:element name="pre-remove" type="orm:pre-remove"
+ minOccurs="0" />
+ <xsd:element name="post-remove" type="orm:post-remove"
+ minOccurs="0" />
+ <xsd:element name="pre-update" type="orm:pre-update"
+ minOccurs="0" />
+ <xsd:element name="post-update" type="orm:post-update"
+ minOccurs="0" />
+ <xsd:element name="post-load" type="orm:post-load"
+ minOccurs="0" />
+ <xsd:element name="attributes" type="orm:attributes"
+ minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="class" type="xsd:string" use="required" />
+ <xsd:attribute name="access" type="orm:access-type" />
+ <xsd:attribute name="metadata-complete" type="xsd:boolean" />
+ </xsd:complexType>
+ <!-- **************************************************** -->
+ <xsd:complexType name="named-native-query">
+ <xsd:annotation>
+ <xsd:documentation>
+ @Target({TYPE}) @Retention(RUNTIME) public @interface
+ NamedNativeQuery { String name(); String query();
+ QueryHint[] hints() default {}; Class resultClass()
+ default void.class; String resultSetMapping() default
+ ""; //named SqlResultSetMapping }
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="description" type="xsd:string"
+ minOccurs="0" />
+ <xsd:element name="query" type="xsd:string" />
+ <xsd:element name="hint" type="orm:query-hint" minOccurs="0"
+ maxOccurs="unbounded" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ <xsd:attribute name="result-class" type="xsd:string" />
+ <xsd:attribute name="result-set-mapping" type="xsd:string" />
+ </xsd:complexType>
+ <!-- **************************************************** -->
+ <xsd:complexType name="named-query">
+ <xsd:annotation>
+ <xsd:documentation>
+ @Target({TYPE}) @Retention(RUNTIME) public @interface
+ NamedQuery { String name(); String query(); QueryHint[]
+ hints() default {}; }
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="description" type="xsd:string"
+ minOccurs="0" />
+ <xsd:element name="query" type="xsd:string" />
+ <xsd:element name="hint" type="orm:query-hint" minOccurs="0"
+ maxOccurs="unbounded" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ <!-- **************************************************** -->
+ <xsd:complexType name="one-to-many">
+ <xsd:annotation>
+ <xsd:documentation>
+ @Target({METHOD, FIELD}) @Retention(RUNTIME) public
+ @interface OneToMany { Class targetEntity() default
+ void.class; CascadeType[] cascade() default {};
+ FetchType fetch() default LAZY; String mappedBy()
+ default ""; }
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:choice>
+ <xsd:element name="order-by" type="orm:order-by"
+ minOccurs="0" />
+ <xsd:element name="order-column" type="orm:order-column"
+ minOccurs="0" />
+ </xsd:choice>
+ <xsd:choice>
+ <xsd:element name="map-key" type="orm:map-key"
+ minOccurs="0" />
+ <xsd:sequence>
+ <xsd:element name="map-key-class"
+ type="orm:map-key-class" minOccurs="0" />
+ <xsd:choice>
+ <xsd:element name="map-key-column"
+ type="orm:map-key-column" minOccurs="0" />
+ <xsd:element name="map-key-join-column"
+ type="orm:map-key-join-column" minOccurs="0"
+ maxOccurs="unbounded" />
+ </xsd:choice>
+ </xsd:sequence>
+ </xsd:choice>
+ <xsd:choice>
+ <xsd:element name="join-table" type="orm:join-table"
+ minOccurs="0" />
+ <xsd:element name="join-column" type="orm:join-column"
+ minOccurs="0" maxOccurs="unbounded" />
+ </xsd:choice>
+ <xsd:element name="cascade" type="orm:cascade-type"
+ minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ <xsd:attribute name="target-entity" type="xsd:string" />
+ <xsd:attribute name="fetch" type="orm:fetch-type" />
+ <xsd:attribute name="access" type="orm:access-type" />
+ <xsd:attribute name="mapped-by" type="xsd:string" />
+ <xsd:attribute name="orphan-removal" type="xsd:boolean" />
+ </xsd:complexType>
+ <!-- **************************************************** -->
+ <xsd:complexType name="one-to-one">
+ <xsd:annotation>
+ <xsd:documentation>
+ @Target({METHOD, FIELD}) @Retention(RUNTIME) public
+ @interface OneToOne { Class targetEntity() default
+ void.class; CascadeType[] cascade() default {};
+ FetchType fetch() default EAGER; boolean optional()
+ default true; String mappedBy() default ""; boolean
+ orphanRemoval() default false; }
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:choice>
+ <xsd:element name="primary-key-join-column"
+ type="orm:primary-key-join-column" minOccurs="0"
+ maxOccurs="unbounded" />
+ <xsd:element name="join-column" type="orm:join-column"
+ minOccurs="0" maxOccurs="unbounded" />
+ <xsd:element name="join-table" type="orm:join-table"
+ minOccurs="0" />
+ </xsd:choice>
+ <xsd:element name="cascade" type="orm:cascade-type"
+ minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ <xsd:attribute name="target-entity" type="xsd:string" />
+ <xsd:attribute name="fetch" type="orm:fetch-type" />
+ <xsd:attribute name="optional" type="xsd:boolean" />
+ <xsd:attribute name="access" type="orm:access-type" />
+ <xsd:attribute name="mapped-by" type="xsd:string" />
+ <xsd:attribute name="orphan-removal" type="xsd:boolean" />
+ <xsd:attribute name="mapped-by-id" type="xsd:string" />
+ <xsd:attribute name="id" type="xsd:boolean" />
+ </xsd:complexType>
+ <!-- **************************************************** -->
+ <xsd:simpleType name="order-by">
+ <xsd:annotation>
+ <xsd:documentation>
+ @Target({METHOD, FIELD}) @Retention(RUNTIME) public
+ @interface OrderBy { String value() default ""; }
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:restriction base="xsd:string" />
+ </xsd:simpleType>
+ <!-- **************************************************** -->
+ <xsd:complexType name="order-column">
+ <xsd:annotation>
+ <xsd:documentation>
+ @Target({METHOD, FIELD}) @Retention(RUNTIME) public
+ @interface OrderColumn { String name() default "";
+ boolean nullable() default true; boolean insertable()
+ default true; boolean updatable() default true; String
+ columnDefinition() default ""; boolean contiguous()
+ default true; int base() default 0; String table()
+ default ""; }
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:attribute name="name" type="xsd:string" />
+ <xsd:attribute name="nullable" type="xsd:boolean" />
+ <xsd:attribute name="insertable" type="xsd:boolean" />
+ <xsd:attribute name="updatable" type="xsd:boolean" />
+ <xsd:attribute name="column-definition" type="xsd:string" />
+ <xsd:attribute name="contiguous" type="xsd:boolean" />
+ <xsd:attribute name="base" type="xsd:int" />
+ <xsd:attribute name="table" type="xsd:string" />
+ </xsd:complexType>
+ <!-- **************************************************** -->
+ <xsd:complexType name="post-load">
+ <xsd:annotation>
+ <xsd:documentation>
+ @Target({METHOD}) @Retention(RUNTIME) public @interface
+ PostLoad {}
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="description" type="xsd:string"
+ minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="method-name" type="xsd:string"
+ use="required" />
+ </xsd:complexType>
+ <!-- **************************************************** -->
+ <xsd:complexType name="post-persist">
+ <xsd:annotation>
+ <xsd:documentation>
+ @Target({METHOD}) @Retention(RUNTIME) public @interface
+ PostPersist {}
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="description" type="xsd:string"
+ minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="method-name" type="xsd:string"
+ use="required" />
+ </xsd:complexType>
+ <!-- **************************************************** -->
+ <xsd:complexType name="post-remove">
+ <xsd:annotation>
+ <xsd:documentation>
+ @Target({METHOD}) @Retention(RUNTIME) public @interface
+ PostRemove {}
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="description" type="xsd:string"
+ minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="method-name" type="xsd:string"
+ use="required" />
+ </xsd:complexType>
+ <!-- **************************************************** -->
+ <xsd:complexType name="post-update">
+ <xsd:annotation>
+ <xsd:documentation>
+ @Target({METHOD}) @Retention(RUNTIME) public @interface
+ PostUpdate {}
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="description" type="xsd:string"
+ minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="method-name" type="xsd:string"
+ use="required" />
+ </xsd:complexType>
+ <!-- **************************************************** -->
+ <xsd:complexType name="pre-persist">
+ <xsd:annotation>
+ <xsd:documentation>
+ @Target({METHOD}) @Retention(RUNTIME) public @interface
+ PrePersist {}
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="description" type="xsd:string"
+ minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="method-name" type="xsd:string"
+ use="required" />
+ </xsd:complexType>
+ <!-- **************************************************** -->
+ <xsd:complexType name="pre-remove">
+ <xsd:annotation>
+ <xsd:documentation>
+ @Target({METHOD}) @Retention(RUNTIME) public @interface
+ PreRemove {}
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="description" type="xsd:string"
+ minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="method-name" type="xsd:string"
+ use="required" />
+ </xsd:complexType>
+ <!-- **************************************************** -->
+ <xsd:complexType name="pre-update">
+ <xsd:annotation>
+ <xsd:documentation>
+ @Target({METHOD}) @Retention(RUNTIME) public @interface
+ PreUpdate {}
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="description" type="xsd:string"
+ minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="method-name" type="xsd:string"
+ use="required" />
+ </xsd:complexType>
+ <!-- **************************************************** -->
+ <xsd:complexType name="primary-key-join-column">
+ <xsd:annotation>
+ <xsd:documentation>
+ @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
+ public @interface PrimaryKeyJoinColumn { String name()
+ default ""; String referencedColumnName() default "";
+ String columnDefinition() default ""; }
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:attribute name="name" type="xsd:string" />
+ <xsd:attribute name="referenced-column-name" type="xsd:string" />
+ <xsd:attribute name="column-definition" type="xsd:string" />
+ </xsd:complexType>
+ <!-- **************************************************** -->
+ <xsd:complexType name="query-hint">
+ <xsd:annotation>
+ <xsd:documentation>
+ @Target({}) @Retention(RUNTIME) public @interface
+ QueryHint { String name(); String value(); }
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="description" type="xsd:string"
+ minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ <xsd:attribute name="value" type="xsd:string" use="required" />
+ </xsd:complexType>
+ <!-- **************************************************** -->
+ <xsd:complexType name="secondary-table">
+ <xsd:annotation>
+ <xsd:documentation>
+ @Target({TYPE}) @Retention(RUNTIME) public @interface
+ SecondaryTable { String name(); String catalog() default
+ ""; String schema() default ""; PrimaryKeyJoinColumn[]
+ pkJoinColumns() default {}; UniqueConstraint[]
+ uniqueConstraints() default {}; }
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="primary-key-join-column"
+ type="orm:primary-key-join-column" minOccurs="0"
+ maxOccurs="unbounded" />
+ <xsd:element name="unique-constraint"
+ type="orm:unique-constraint" minOccurs="0"
+ maxOccurs="unbounded" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ <xsd:attribute name="catalog" type="xsd:string" />
+ <xsd:attribute name="schema" type="xsd:string" />
+ </xsd:complexType>
+ <!-- **************************************************** -->
+ <xsd:complexType name="sequence-generator">
+ <xsd:annotation>
+ <xsd:documentation>
+ @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
+ public @interface SequenceGenerator { String name();
+ String sequenceName() default ""; String catalog()
+ default ""; String schema() default ""; int
+ initialValue() default 1; int allocationSize() default
+ 50; }
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="description" type="xsd:string"
+ minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ <xsd:attribute name="sequence-name" type="xsd:string" />
+ <xsd:attribute name="catalog" type="xsd:string" />
+ <xsd:attribute name="schema" type="xsd:string" />
+ <xsd:attribute name="initial-value" type="xsd:int" />
+ <xsd:attribute name="allocation-size" type="xsd:int" />
+ </xsd:complexType>
+ <!-- **************************************************** -->
+ <xsd:complexType name="sql-result-set-mapping">
+ <xsd:annotation>
+ <xsd:documentation>
+ @Target({TYPE}) @Retention(RUNTIME) public @interface
+ SqlResultSetMapping { String name(); EntityResult[]
+ entities() default {}; ColumnResult[] columns() default
+ {}; }
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="description" type="xsd:string"
+ minOccurs="0" />
+ <xsd:element name="entity-result" type="orm:entity-result"
+ minOccurs="0" maxOccurs="unbounded" />
+ <xsd:element name="column-result" type="orm:column-result"
+ minOccurs="0" maxOccurs="unbounded" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ <!-- **************************************************** -->
+ <xsd:complexType name="table">
+ <xsd:annotation>
+ <xsd:documentation>
+ @Target({TYPE}) @Retention(RUNTIME) public @interface
+ Table { String name() default ""; String catalog()
+ default ""; String schema() default "";
+ UniqueConstraint[] uniqueConstraints() default {}; }
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="unique-constraint"
+ type="orm:unique-constraint" minOccurs="0"
+ maxOccurs="unbounded" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" />
+ <xsd:attribute name="catalog" type="xsd:string" />
+ <xsd:attribute name="schema" type="xsd:string" />
+ </xsd:complexType>
+ <!-- **************************************************** -->
+ <xsd:complexType name="table-generator">
+ <xsd:annotation>
+ <xsd:documentation>
+ @Target({TYPE, METHOD, FIELD}) @Retention(RUNTIME)
+ public @interface TableGenerator { String name(); String
+ table() default ""; String catalog() default ""; String
+ schema() default ""; String pkColumnName() default "";
+ String valueColumnName() default ""; String
+ pkColumnValue() default ""; int initialValue() default
+ 0; int allocationSize() default 50; UniqueConstraint[]
+ uniqueConstraints() default {}; }
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="description" type="xsd:string"
+ minOccurs="0" />
+ <xsd:element name="unique-constraint"
+ type="orm:unique-constraint" minOccurs="0"
+ maxOccurs="unbounded" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ <xsd:attribute name="table" type="xsd:string" />
+ <xsd:attribute name="catalog" type="xsd:string" />
+ <xsd:attribute name="schema" type="xsd:string" />
+ <xsd:attribute name="pk-column-name" type="xsd:string" />
+ <xsd:attribute name="value-column-name" type="xsd:string" />
+ <xsd:attribute name="pk-column-value" type="xsd:string" />
+ <xsd:attribute name="initial-value" type="xsd:int" />
+ <xsd:attribute name="allocation-size" type="xsd:int" />
+ </xsd:complexType>
+ <!-- **************************************************** -->
+ <xsd:simpleType name="temporal">
+ <xsd:annotation>
+ <xsd:documentation>
+ @Target({METHOD, FIELD}) @Retention(RUNTIME) public
+ @interface Temporal { TemporalType value(); }
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:restriction base="orm:temporal-type" />
+ </xsd:simpleType>
+ <!-- **************************************************** -->
+ <xsd:simpleType name="temporal-type">
+ <xsd:annotation>
+ <xsd:documentation>
+ public enum TemporalType { DATE, // java.sql.Date TIME,
+ // java.sql.Time TIMESTAMP // java.sql.Timestamp }
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:restriction base="xsd:token">
+ <xsd:enumeration value="DATE" />
+ <xsd:enumeration value="TIME" />
+ <xsd:enumeration value="TIMESTAMP" />
+ </xsd:restriction>
+ </xsd:simpleType>
+ <!-- **************************************************** -->
+ <xsd:complexType name="transient">
+ <xsd:annotation>
+ <xsd:documentation>
+ @Target({METHOD, FIELD}) @Retention(RUNTIME) public
+ @interface Transient {}
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ <!-- **************************************************** -->
+ <xsd:complexType name="unique-constraint">
+ <xsd:annotation>
+ <xsd:documentation>
+ @Target({}) @Retention(RUNTIME) public @interface
+ UniqueConstraint { String[] columnNames(); }
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="column-name" type="xsd:string"
+ maxOccurs="unbounded" />
+ </xsd:sequence>
+ </xsd:complexType>
+ <!-- **************************************************** -->
+ <xsd:complexType name="version">
+ <xsd:annotation>
+ <xsd:documentation>
+ @Target({METHOD, FIELD}) @Retention(RUNTIME) public
+ @interface Version {}
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="column" type="orm:column" minOccurs="0" />
+ <xsd:element name="temporal" type="orm:temporal"
+ minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ <xsd:attribute name="access" type="orm:access-type" />
+ </xsd:complexType>
+</xsd:schema>
\ No newline at end of file
Modified: workspace/max/jpaap/jpaap/src/org/jboss/jpa/metamodel/ap/JPAMetaModelEntityProcessor.java
===================================================================
--- workspace/max/jpaap/jpaap/src/org/jboss/jpa/metamodel/ap/JPAMetaModelEntityProcessor.java 2009-01-20 14:36:33 UTC (rev 13148)
+++ workspace/max/jpaap/jpaap/src/org/jboss/jpa/metamodel/ap/JPAMetaModelEntityProcessor.java 2009-01-20 15:38:35 UTC (rev 13149)
@@ -1,20 +1,15 @@
package org.jboss.jpa.metamodel.ap;
+import com.sun.java.xml.ns.persistence.orm.EntityMappings;
+import com.sun.java.xml.ns.persistence.orm.Entity;
+
import static javax.lang.model.SourceVersion.RELEASE_6;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.util.List;
-import java.util.Set;
+import java.io.*;
+import java.util.*;
import javax.annotation.Generated;
-import javax.annotation.processing.AbstractProcessor;
-import javax.annotation.processing.FilerException;
-import javax.annotation.processing.RoundEnvironment;
-import javax.annotation.processing.SupportedAnnotationTypes;
-import javax.annotation.processing.SupportedSourceVersion;
+import javax.annotation.processing.*;
import javax.lang.model.element.AnnotationMirror;
import javax.lang.model.element.Element;
import javax.lang.model.element.ElementKind;
@@ -22,131 +17,164 @@
import javax.lang.model.element.TypeElement;
import javax.tools.Diagnostic;
import javax.tools.FileObject;
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Unmarshaller;
@SupportedAnnotationTypes("javax.persistence.Entity")
@SupportedSourceVersion(RELEASE_6)
public class JPAMetaModelEntityProcessor extends AbstractProcessor {
- public JPAMetaModelEntityProcessor() {
+ private static final String ORM_XML_LOCATION = "/META-INF/orm.xml";
- }
+ private static final Map<String, Entity> xmlEntitiesMap = new HashMap<String, Entity>();
- /**
- * Process JPA-specific annotations in Java entity classes.
- *
- * @param aAnnotations
- * Matching annotations to be processed.
- * @param aRoundEnvironment
- * Annotation processing round environment.
- * @return
- */
- @Override
- public boolean process(final Set<? extends TypeElement> aAnnotations,
- final RoundEnvironment aRoundEnvironment) {
+ public JPAMetaModelEntityProcessor() {
+ }
-
- if(aRoundEnvironment.processingOver()) { // No need to run since all our output needs to be considered
- return false;
- }
-
- Set<? extends Element> elements = aRoundEnvironment.getRootElements();
+ public void init(ProcessingEnvironment env) {
+ super.init(env);
+ parsingOrmXml();
+ }
- for (Element element : elements) {
- handleRootElementAnnotationMirrors(element);
- }
+ /**
+ * Tries to check whether a orm.xml file exists and parses it using JAXB
+ */
+ private void parsingOrmXml() {
+ System.out.println("Checking for orm.xml");
+ InputStream ormStream = this.getClass().getResourceAsStream(ORM_XML_LOCATION);
+ if (ormStream == null) {
+ System.out.println("No orm.xml found.");
+ return;
+ }
+ try {
+ JAXBContext jc = JAXBContext.newInstance(com.sun.java.xml.ns.persistence.orm.ObjectFactory.class);
+ Unmarshaller unmarshaller = jc.createUnmarshaller();
+ EntityMappings mappings = (EntityMappings) unmarshaller.unmarshal(ormStream);
+ Collection<Entity> entities = mappings.getEntity();
+ for ( Entity entity : entities ) {
+ xmlEntitiesMap.put(entity.getClazz(), entity);
+ }
+ System.out.println(xmlEntitiesMap);
+ } catch (JAXBException e) {
+ System.err.println("Error unmarshalling orm.xml");
+ e.printStackTrace();
+ }
+ }
- return true;
- }
+ /**
+ * Process JPA-specific annotations in Java entity classes.
+ *
+ * @param aAnnotations Matching annotations to be processed.
+ * @param aRoundEnvironment Annotation processing round environment.
+ * @return
+ */
+ @Override
+ public boolean process(final Set<? extends TypeElement> aAnnotations,
+ final RoundEnvironment aRoundEnvironment) {
- private void handleRootElementAnnotationMirrors(final Element element) {
-
- List<? extends AnnotationMirror> annotationMirrors = element
- .getAnnotationMirrors();
- for (AnnotationMirror mirror : annotationMirrors) {
- final String annotationType = mirror.getAnnotationType().toString();
+ if (aRoundEnvironment.processingOver()) { // No need to run since all our output needs to be considered
+ return false;
+ }
- if (element.getKind()==ElementKind.CLASS &&
- annotationType.equals(javax.persistence.Entity.class.getName())) {
-
- MetaEntity metaEntity = new MetaEntity(processingEnv,(TypeElement) element);
+ Set<? extends Element> elements = aRoundEnvironment.getRootElements();
- writeFile(metaEntity);
-
- }
- }
- }
+ for (Element element : elements) {
+ handleRootElementAnnotationMirrors(element);
+ }
- private void writeFile(MetaEntity entity) {
+ return true;
+ }
- try {
- Name metaModelPackage = entity.getPackageName();
-
-
- StringBuffer body = generateBody(entity);
-
- FileObject fo = processingEnv.getFiler().createSourceFile(
- metaModelPackage + "." + entity.getSimpleName() + "_",
- entity.getOriginalElement());
- OutputStream os = fo.openOutputStream();
- PrintWriter pw = new PrintWriter(os);
-
- pw.println("package " + metaModelPackage + ";");
+ private void handleRootElementAnnotationMirrors(final Element element) {
- pw.println();
-
- pw.println(entity.generateImports());
-
- pw.println(body);
-
- pw.flush();
- pw.close();
-
- } catch (FilerException filerEx) {
- processingEnv.getMessager().printMessage(
- Diagnostic.Kind.ERROR,
- "Problem with Processing Environment Filer: "
- + filerEx.getMessage());
- } catch (IOException ioEx) {
- processingEnv.getMessager().printMessage(
- Diagnostic.Kind.ERROR,
- "Problem opening file to write MetaModel for " + entity.getSimpleName()
- + ioEx.getMessage());
- }
- }
+ List<? extends AnnotationMirror> annotationMirrors = element
+ .getAnnotationMirrors();
- /** Generate everything after import statements
- * @return body content
- **/
- private StringBuffer generateBody(MetaEntity entity) {
+ for (AnnotationMirror mirror : annotationMirrors) {
+ final String annotationType = mirror.getAnnotationType().toString();
- StringWriter sw = new StringWriter();
- PrintWriter pw = null;
- try {
-
- pw = new PrintWriter(sw);
-
- pw.println("@" + entity.importType(Generated.class.getName()) + "(\"JPA MetaModel for " + entity.getQualifiedName() + "\")");
+ if (element.getKind() == ElementKind.CLASS &&
+ annotationType.equals(javax.persistence.Entity.class.getName())) {
- pw.println("@" + entity.importType("javax.jpa.metamodel.TypesafeMetamodel"));
-
- pw.println("public abstract class " + entity.getSimpleName() + "_" + " {");
-
- pw.println();
-
- List<MetaMember> members = entity.getMembers();
-
- for (MetaMember metaMember : members) {
- pw.println( " " + metaMember.getDeclarationString() );
- }
- pw.println();
- pw.println("}");
- return sw.getBuffer();
- } finally {
- if (pw!=null) pw.close();
- }
-
+ MetaEntity metaEntity = new MetaEntity(processingEnv, (TypeElement) element);
+ writeFile(metaEntity);
+
+ }
+ }
+ }
+
+ private void writeFile(MetaEntity entity) {
+
+ try {
+ Name metaModelPackage = entity.getPackageName();
+
+
+ StringBuffer body = generateBody(entity);
+
+ FileObject fo = processingEnv.getFiler().createSourceFile(
+ metaModelPackage + "." + entity.getSimpleName() + "_",
+ entity.getOriginalElement());
+ OutputStream os = fo.openOutputStream();
+ PrintWriter pw = new PrintWriter(os);
+
+ pw.println("package " + metaModelPackage + ";");
+
+ pw.println();
+
+ pw.println(entity.generateImports());
+
+ pw.println(body);
+
+ pw.flush();
+ pw.close();
+
+ } catch (FilerException filerEx) {
+ processingEnv.getMessager().printMessage(
+ Diagnostic.Kind.ERROR,
+ "Problem with Processing Environment Filer: "
+ + filerEx.getMessage());
+ } catch (IOException ioEx) {
+ processingEnv.getMessager().printMessage(
+ Diagnostic.Kind.ERROR,
+ "Problem opening file to write MetaModel for " + entity.getSimpleName()
+ + ioEx.getMessage());
+ }
+ }
+
+ /**
+ * Generate everything after import statements
+ *
+ * @return body content
+ */
+ private StringBuffer generateBody(MetaEntity entity) {
+
+ StringWriter sw = new StringWriter();
+ PrintWriter pw = null;
+ try {
+
+ pw = new PrintWriter(sw);
+
+ pw.println("@" + entity.importType(Generated.class.getName()) + "(\"JPA MetaModel for " + entity.getQualifiedName() + "\")");
+
+ pw.println("@" + entity.importType("javax.jpa.metamodel.TypesafeMetamodel"));
+
+ pw.println("public abstract class " + entity.getSimpleName() + "_" + " {");
+
+ pw.println();
+
+ List<MetaMember> members = entity.getMembers();
+
+ for (MetaMember metaMember : members) {
+ pw.println(" " + metaMember.getDeclarationString());
+ }
+ pw.println();
+ pw.println("}");
+ return sw.getBuffer();
+ } finally {
+ if (pw !=null) pw.close();
+ }
}
-
}
Modified: workspace/max/jpaap/test/build.xml
===================================================================
--- workspace/max/jpaap/test/build.xml 2009-01-20 14:36:33 UTC (rev 13148)
+++ workspace/max/jpaap/test/build.xml 2009-01-20 15:38:35 UTC (rev 13149)
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<project name="Test JPA2 Project" default="jar" basedir=".">
+<project name="JPA2 Test Project" default="jar" basedir=".">
<target name="init">
<property name="debuglevel" value="source,lines,vars"/>
@@ -46,7 +46,11 @@
<javac debug="true" debuglevel="${debuglevel}" destdir="${classes.dir}" source="${source}" target="${target}">
<src path="${src.dir}"/>
<classpath refid="lib.path"/>
+ <classpath path="${src.dir}"/>
</javac>
+ <copy todir="${classes.dir}/META-INF">
+ <fileset dir="${src.dir}/META-INF"/>
+ </copy>
</target>
<!-- MAKE JAR TARGET -->
Added: workspace/max/jpaap/test/src/META-INF/orm.xml
===================================================================
--- workspace/max/jpaap/test/src/META-INF/orm.xml (rev 0)
+++ workspace/max/jpaap/test/src/META-INF/orm.xml 2009-01-20 15:38:35 UTC (rev 13149)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm orm_2_0.xsd"
+ version="2.0"
+ >
+ <!-- careful old JPA1 schema -->
+ <package>model</package> <!-- default package -->
+ <entity class="Order" access="FIELD" metadata-complete="true"> <!--means ignore annotations-->
+ <attributes>
+ <id name="id">
+ <column name="fld_id"/>
+ </id>
+ <basic name="filled"></basic>
+ <one-to-many name="items" target-entity="Item" fetch="EAGER"> <!-- target-entity optional guess the type from the geenric-->
+ <cascade>
+ <cascade-persist/>
+ </cascade>
+ </one-to-many>
+ <many-to-one name="shop"/>
+ <element-collection name="notes"/> <!-- new in JPA 2 -->
+ </attributes>
+ </entity>
+</entity-mappings>
+
+
+ <!--
+public class Order {
+ long id;
+ Set<Item> items;
+ boolean filled;
+ Date date;
+ List<String> notes;
+ Shop shop;
+} -->
\ No newline at end of file
15 years, 11 months
JBoss Tools SVN: r13148 - trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime.
by jbosstools-commits@lists.jboss.org
Author: dennyxu
Date: 2009-01-20 09:36:33 -0500 (Tue, 20 Jan 2009)
New Revision: 13148
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeManager.java
Log:
JBIDE-3595:Support for creating ESB runtime by only specifying SOA-P installation location
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeManager.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeManager.java 2009-01-20 12:50:17 UTC (rev 13147)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeManager.java 2009-01-20 14:36:33 UTC (rev 13148)
@@ -44,6 +44,7 @@
private final static String JBOSSESB_ESB = "jbossesb.esb";
private final static String JBOSSESB_SAR = "jbossesb.sar";
+ private final static String SOAP_AS_LOCATION = "jboss-as";
/**
* Private constructor
@@ -169,6 +170,8 @@
List<String> jarList = new ArrayList<String>();
IPath rtHome = new Path(runtimeLocation);
+ IPath soapDeployPath = rtHome.append(SOAP_AS_LOCATION).append("server").append("default").append(
+ "deploy");
IPath deployPath = rtHome.append("server").append("default").append(
"deploy");
@@ -177,12 +180,17 @@
IPath libPath = rtHome.append("lib");
+ //if it's not a normal jboss AS , try to treat it as standalone esb runtme
if (!esbPath.toFile().exists() || !sarPath.toFile().exists()) {
esbPath = libPath.append(JBOSSESB_ESB);
sarPath = libPath.append(JBOSSESB_SAR);
-
}
-
+
+ if (!esbPath.toFile().exists() || !sarPath.toFile().exists()) {
+ esbPath = soapDeployPath.append(JBOSSESB_ESB);
+ sarPath = soapDeployPath.append(JBOSSESB_SAR);
+ }
+
List<File> esblibs = getJarsOfFolder(esbPath.toFile());
IPath sarLibPath = sarPath.append("lib");
List<File> sarJars = getJarsOfFolder(sarLibPath.toFile());
@@ -409,26 +417,27 @@
}
public static boolean isValidESBServer(String path){
+ File resttaJar = getResttaJar(path, "");
+ return resttaJar != null && resttaJar.exists() || isValidSoapContainedESBRuntime(path);
+ }
+
+ private static boolean isValidSoapContainedESBRuntime(String path){
+ File resttaJar = getResttaJar(path, SOAP_AS_LOCATION);
+ return resttaJar != null && resttaJar.exists();
+ }
+
+ public static File getResttaJar(String path, String asFoldername){
IPath serverLocation = new Path(path);
+ if(asFoldername != null && !"".equals(asFoldername)){
+ serverLocation = serverLocation.append(asFoldername);
+ }
- String esbLcoationSeg = "server" + File.separator + "default"
- + File.separator + "deploy" + File.separator
- + "jbossesb.esb";
- String sarLocationSeg = "server" + File.separator + "default"
+ String rosettaJar = "server" + File.separator + "default"
+ File.separator + "deploy" + File.separator
- + "jbossesb.sar";
- IPath esbLocation = serverLocation.append(esbLcoationSeg);
- IPath sarLocation = serverLocation.append(sarLocationSeg);
+ + "jbossesb.sar" + File.separator + "lib" + File.separator + "jbossesb-rosetta.jar";
+ IPath esbLocation = serverLocation.append(rosettaJar);
- if(!esbLocation.toFile().isDirectory()){
- return false;
- }
- if(!sarLocation.toFile().isDirectory()){
- return false;
- }
-
-
- return true;
+ return esbLocation.toFile();
}
public static boolean isValidESBStandaloneRuntimeDir(String path) {
@@ -445,4 +454,10 @@
return true;
}
+ public String getESBVersionNumber(File rosettaJar){
+
+ return "";
+
+ }
+
}
\ No newline at end of file
15 years, 11 months
JBoss Tools SVN: r13147 - trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/appregister.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-01-20 07:50:17 -0500 (Tue, 20 Jan 2009)
New Revision: 13147
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/appregister/AppRegisterComponent.java
Log:
JBIDE-3589
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/appregister/AppRegisterComponent.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/appregister/AppRegisterComponent.java 2009-01-20 10:58:03 UTC (rev 13146)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/appregister/AppRegisterComponent.java 2009-01-20 12:50:17 UTC (rev 13147)
@@ -298,7 +298,7 @@
onRuntimeChange(value);
}
}
-
+
void onRuntimeChange(String value) {
value = (value == null) ? "" : value.trim();
if(value.equals(context.getRuntimeName())) return;
@@ -383,6 +383,7 @@
if(runtime == null) return -1;
p.setProperty("value", runtime.getName());
initRuntimeValue();
+ context.setRuntimeName(""); //prepare for change
return 0;
}
15 years, 11 months
JBoss Tools SVN: r13146 - trunk/jsf/docs/jsf_tools_ref_guide/en/modules.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2009-01-20 05:58:03 -0500 (Tue, 20 Jan 2009)
New Revision: 13146
Modified:
trunk/jsf/docs/jsf_tools_ref_guide/en/modules/creation_and_registration.xml
trunk/jsf/docs/jsf_tools_ref_guide/en/modules/jsf_config_file.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-441 - updating the "Tree View" section in the JSF Ref guide;
Modified: trunk/jsf/docs/jsf_tools_ref_guide/en/modules/creation_and_registration.xml
===================================================================
--- trunk/jsf/docs/jsf_tools_ref_guide/en/modules/creation_and_registration.xml 2009-01-20 10:57:40 UTC (rev 13145)
+++ trunk/jsf/docs/jsf_tools_ref_guide/en/modules/creation_and_registration.xml 2009-01-20 10:58:03 UTC (rev 13146)
@@ -251,7 +251,7 @@
</figure>
</section>
- <section>
+ <section id="referenced_beans">
<title>Create and Register Referenced Beans</title>
<para>Creation of Referenced Beans is similar to creation of Custom
Modified: trunk/jsf/docs/jsf_tools_ref_guide/en/modules/jsf_config_file.xml
===================================================================
--- trunk/jsf/docs/jsf_tools_ref_guide/en/modules/jsf_config_file.xml 2009-01-20 10:57:40 UTC (rev 13145)
+++ trunk/jsf/docs/jsf_tools_ref_guide/en/modules/jsf_config_file.xml 2009-01-20 10:58:03 UTC (rev 13146)
@@ -121,41 +121,215 @@
<title>Tree View</title>
- <para>The Tree view for the editor displays all JSF application artifacts referenced in the
- configuration file in a tree format. By selecting any node you can see and edit its
- properties which will appear in the right-hand area. For example, a Managed Bean:</para>
+ <para>You can find it more convenient to edit your JSF Configuration file in the Tree view of
+ the <property>VPE</property>.</para>
+
+ <para>The view displays all JSF application artifacts referenced in the configuration file
+ in a tree format. By selecting any node on the left, you can see and edit its properties
+ which will appear in the right-hand area. Let's look at the structure of this
+ tree more closely.</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>Under the <emphasis>
+ <property>Application</property>
+ </emphasis> node you can adjust JSF application specific settings such as
+ internationalization, possibility to set extensions, add property and variable
+ resolvers, etc.</para>
+ </listitem>
+ </itemizedlist>
+
<figure>
- <title>Tree View</title>
+ <title>JSF Application Specific Settings</title>
<mediaobject>
<imageobject>
- <imagedata fileref="images/jsf_support/jsf_support_25.png"/>
+ <imagedata fileref="images/jsf_support/jsf_support_24a.png"/>
</imageobject>
</mediaobject>
</figure>
- <para>To edit some artifact, right-click any node and select one of the available actions in
- the context menu. You can also edit in the properties window to the right:</para>
+ <itemizedlist>
+ <listitem>
+ <para>The <emphasis>
+ <property>Components</property>
+ </emphasis> node is for registering custom JSF components. Right-click and
+ choose <emphasis>
+ <property>New > Component</property>
+ </emphasis> or just press the <emphasis>
+ <property>Add</property>
+ </emphasis> button in the right-hand area to add a new component to the JSF
+ Configuration file.</para>
+ </listitem>
+ </itemizedlist>
+
<figure>
- <title>Editing in Tree View</title>
+ <title>Registering a New JSF Component</title>
<mediaobject>
<imageobject>
- <imagedata fileref="images/jsf_support/jsf_support_26.png"/>
+ <imagedata fileref="images/jsf_support/jsf_support_24b.png"/>
</imageobject>
</mediaobject>
</figure>
- <para>The same way you can create a new artifact:</para>
+
+ <para>In the <property>Add Component wizard</property> you should set a component
+ type and point to a component class by using the <emphasis>
+ <property>Browse</property>
+ </emphasis> button or create a new class for this component by using the <emphasis>
+ <property>Component-Class</property>
+ </emphasis> link.</para>
+
<figure>
- <title>Creating a New Artifact in Tree View</title>
+ <title>Adding a New JSF Component to the JSF Configuration File</title>
<mediaobject>
<imageobject>
+ <imagedata fileref="images/jsf_support/jsf_support_24c.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <itemizedlist>
+ <listitem>
+ <para>Use the <emphasis>
+ <property>Render Kit</property>
+ </emphasis> node to create and register a set of related renderers for custom
+ JSF components.</para>
+ </listitem>
+ </itemizedlist>
+
+ <figure>
+ <title>Adding a New JSF Component to the JSF Configuration File</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/jsf_support/jsf_support_24d.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <itemizedlist>
+ <listitem>
+ <para>Under the <emphasis>
+ <property>Converters</property>
+ </emphasis> node you can create a converter class for your JSF application
+ either with id or for a proper class. How to do that see the <link
+ linkend="CreateAndRegisterACustomConverter94230">Create and Register a
+ Custom Converter</link> section.</para>
+ </listitem>
+ </itemizedlist>
+
+ <figure>
+ <title>Creating a New Custom Converter</title>
+ <mediaobject>
+ <imageobject>
<imagedata fileref="images/jsf_support/jsf_support_59.png"/>
</imageobject>
</mediaobject>
</figure>
- <para>In the <property>Tree</property> view you can also edit the properties of the selected
- element with the help of the Properties view as shown below:</para>
+ <itemizedlist>
+ <listitem>
+ <para>The <emphasis>
+ <property>Managed Bean</property>
+ </emphasis> node is meant for creating and registering Bean classes in your JSF
+ application. Read more on the topic in the <link linkend="managed_beans">Managed
+ Beans</link> chapter.</para>
+ </listitem>
+ </itemizedlist>
+
<figure>
+ <title>Managed Beans</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/jsf_support/jsf_support_26.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <itemizedlist>
+ <listitem>
+ <para>Use the <emphasis>
+ <property>Navigation Rules</property>
+ </emphasis> node to configure a navigation between the pages in your
+ application: create a new navigation rule and adjust necessary properties for it
+ in the right-hand area.</para>
+ </listitem>
+ </itemizedlist>
+ <tip>
+ <title>Tip:</title>
+ <para>The same you can do in the <link linkend="Diagram9553">Diagram view</link> of the
+ JSF Configuration file editor.</para>
+ </tip>
+
+ <figure>
+ <title>Configuring Navigation Rules</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/jsf_support/jsf_support_26a.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <itemizedlist>
+ <listitem>
+ <para>Under the <emphasis>
+ <property>Referenced Beans</property>
+ </emphasis> node you can add a new Referenced Bean and configure various
+ properties for it. To learn more on this refer to the <link
+ linkend="referenced_beans">Create and Register Referenced Beans</link>
+ section.</para>
+ </listitem>
+ </itemizedlist>
+
+ <figure>
+ <title>Referenced Beans</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/jsf_support/jsf_support_26b.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <itemizedlist>
+ <listitem>
+ <para>The <emphasis>
+ <property>Validators</property>
+ </emphasis> node is needed to create validator classes for organizing the
+ validation of your application data. You can read more on the topic in the <link
+ linkend="CreateAndRegisterACustomValidator5632">Create and Register a Custom
+ Validator</link> section.</para>
+ </listitem>
+ </itemizedlist>
+
+ <figure>
+ <title>Validators</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/jsf_support/jsf_support_26c.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <itemizedlist>
+ <listitem>
+ <para>The <emphasis>
+ <property>Extensions</property>
+ </emphasis> node is for setting extensions for your <emphasis>
+ <property>faces-config.xml</property>.</emphasis></para>
+ </listitem>
+ </itemizedlist>
+
+ <figure>
+ <title>Adding Extensions</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/jsf_support/jsf_support_26d.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>In the <property>Tree view</property> you can also edit the properties of the selected
+ element with the help of the <property>Properties view</property> as shown below:</para>
+
+ <figure>
<title>Properties View </title>
<mediaobject>
<imageobject>
@@ -209,8 +383,8 @@
<title>Open On</title>
<para>The JSF configuration file editor comes with a very useful OpenOn navigating
feature. More fully you can read about it in our <ulink
- url="&jsflink;#OpenOnSelection4Hyperlinknavigation"
- >Visual Web Tools Guide</ulink>.</para>
+ url="&jsflink;#OpenOnSelection4Hyperlinknavigation">Visual Web Tools
+ Guide</ulink>.</para>
</section>
<section id="ContentAssist976">
@@ -237,7 +411,7 @@
greatly reduces your development time as it allows you to catch many of the errors
during development.</para>
<para>Errors will be reported by <link linkend="jsf_project_verification">
- verification</link> facility:</para>
+ verification</link> facility:</para>
<figure>
<title>Error Reporting in Source View</title>
<mediaobject>
15 years, 11 months
JBoss Tools SVN: r13145 - trunk/jsf/docs/jsf_tools_ref_guide/en/images/jsf_support.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2009-01-20 05:57:40 -0500 (Tue, 20 Jan 2009)
New Revision: 13145
Added:
trunk/jsf/docs/jsf_tools_ref_guide/en/images/jsf_support/jsf_support_24a.png
trunk/jsf/docs/jsf_tools_ref_guide/en/images/jsf_support/jsf_support_24b.png
trunk/jsf/docs/jsf_tools_ref_guide/en/images/jsf_support/jsf_support_24c.png
trunk/jsf/docs/jsf_tools_ref_guide/en/images/jsf_support/jsf_support_24d.png
trunk/jsf/docs/jsf_tools_ref_guide/en/images/jsf_support/jsf_support_26a.png
trunk/jsf/docs/jsf_tools_ref_guide/en/images/jsf_support/jsf_support_26b.png
trunk/jsf/docs/jsf_tools_ref_guide/en/images/jsf_support/jsf_support_26c.png
trunk/jsf/docs/jsf_tools_ref_guide/en/images/jsf_support/jsf_support_26d.png
Log:
https://jira.jboss.org/jira/browse/JBDS-441 - updating the screens;
Added: trunk/jsf/docs/jsf_tools_ref_guide/en/images/jsf_support/jsf_support_24a.png
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/docs/jsf_tools_ref_guide/en/images/jsf_support/jsf_support_24a.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jsf/docs/jsf_tools_ref_guide/en/images/jsf_support/jsf_support_24b.png
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/docs/jsf_tools_ref_guide/en/images/jsf_support/jsf_support_24b.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jsf/docs/jsf_tools_ref_guide/en/images/jsf_support/jsf_support_24c.png
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/docs/jsf_tools_ref_guide/en/images/jsf_support/jsf_support_24c.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jsf/docs/jsf_tools_ref_guide/en/images/jsf_support/jsf_support_24d.png
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/docs/jsf_tools_ref_guide/en/images/jsf_support/jsf_support_24d.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jsf/docs/jsf_tools_ref_guide/en/images/jsf_support/jsf_support_26a.png
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/docs/jsf_tools_ref_guide/en/images/jsf_support/jsf_support_26a.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jsf/docs/jsf_tools_ref_guide/en/images/jsf_support/jsf_support_26b.png
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/docs/jsf_tools_ref_guide/en/images/jsf_support/jsf_support_26b.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jsf/docs/jsf_tools_ref_guide/en/images/jsf_support/jsf_support_26c.png
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/docs/jsf_tools_ref_guide/en/images/jsf_support/jsf_support_26c.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jsf/docs/jsf_tools_ref_guide/en/images/jsf_support/jsf_support_26d.png
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/docs/jsf_tools_ref_guide/en/images/jsf_support/jsf_support_26d.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
15 years, 11 months
JBoss Tools SVN: r13144 - in trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog: common and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2009-01-20 05:54:26 -0500 (Tue, 20 Jan 2009)
New Revision: 13144
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/CSSClassDialog.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/CSSModel.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabPreviewControl.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-3459
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/CSSClassDialog.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/CSSClassDialog.java 2009-01-20 10:02:46 UTC (rev 13143)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/CSSClassDialog.java 2009-01-20 10:54:26 UTC (rev 13144)
@@ -12,7 +12,6 @@
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
@@ -74,7 +73,6 @@
import org.jboss.tools.jst.jsp.outline.cssdialog.common.CSSModel;
import org.jboss.tools.jst.jsp.outline.cssdialog.common.Constants;
import org.jboss.tools.jst.jsp.outline.cssdialog.common.FileExtensionFilter;
-import org.jboss.tools.jst.jsp.outline.cssdialog.common.Selector;
import org.jboss.tools.jst.jsp.outline.cssdialog.common.Util;
import org.jboss.tools.jst.jsp.outline.cssdialog.events.ChangeStyleEvent;
import org.jboss.tools.jst.jsp.outline.cssdialog.events.ChangeStyleListener;
@@ -597,10 +595,9 @@
// update current class style value
currentClassStyle = classCombo.getText().trim();
- boolean inputNewClass = classCombo.indexOf(currentClassStyle) == -1;
// if new css was added
- if (inputNewClass) {
- applyButton.setEnabled(inputNewClass);
+ if (classCombo.indexOf(currentClassStyle) == -1) {
+ applyButton.setEnabled(true);
classCombo.add(currentClassStyle);
}
styleComposite.revertPreview();
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/CSSModel.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/CSSModel.java 2009-01-20 10:02:46 UTC (rev 13143)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/common/CSSModel.java 2009-01-20 10:54:26 UTC (rev 13144)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.jst.jsp.outline.cssdialog.common;
+import java.io.FileInputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
@@ -21,6 +22,7 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.text.IDocument;
import org.eclipse.wst.css.core.internal.format.FormatProcessorCSS;
import org.eclipse.wst.css.core.internal.provisional.document.ICSSDocument;
import org.eclipse.wst.css.core.internal.provisional.document.ICSSModel;
@@ -73,6 +75,7 @@
formatProcessorCSS = new FormatProcessorCSS();
IModelManager modelManager = StructuredModelManager.getModelManager();
model = modelManager.getExistingModelForEdit(styleFile);
+
if (model == null)
model = modelManager.getModelForEdit(styleFile);
if (model instanceof ICSSModel) {
@@ -358,4 +361,17 @@
return rulesMapping;
}
+
+ public IDocument getStructuredDocument() {
+ return model.getStructuredDocument();
+ }
+
+ public void reload() {
+ try {
+ model.reload(new FileInputStream(styleFile.getLocation().toFile()));
+ } catch (Exception e) {
+ JspEditorPlugin.getPluginLog().logError(e.getMessage());
+ }
+
+ }
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabPreviewControl.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabPreviewControl.java 2009-01-20 10:02:46 UTC (rev 13143)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/cssdialog/tabs/TabPreviewControl.java 2009-01-20 10:54:26 UTC (rev 13144)
@@ -1,134 +1,184 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jst.jsp.outline.cssdialog.tabs;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorReference;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.internal.EditorAreaHelper;
-import org.eclipse.ui.internal.EditorManager;
-import org.eclipse.ui.internal.WorkbenchPage;
-import org.eclipse.ui.internal.WorkbenchWindow;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-import org.jboss.tools.jst.jsp.messages.JstUIMessages;
-import org.jboss.tools.jst.jsp.outline.cssdialog.common.CSSModel;
-import org.jboss.tools.jst.jsp.outline.cssdialog.events.StyleAttributes;
-
-/**
- * Class for creating Preview sheet tab
- */
-public class TabPreviewControl extends Composite {
-
- /** Editor in which we open visual page. */
- protected final static String EDITOR_ID = "org.eclipse.wst.css.core.csssource.source"; //$NON-NLS-1$
-
- private StructuredTextEditor editor = null;
- private CSSModel cssModel = null;
-
- /**
- * Constructor for creating controls
- *
- * @param composite The parent composite for tab
- * @param styleAttributes the StyleAttributes object
- */
- public TabPreviewControl(Composite tabFolder, StyleAttributes styleAttributes) {
- super(tabFolder, SWT.NONE);
- setLayout(new FillLayout());
- Label label = new Label(this, SWT.CENTER);
- label.setText(JstUIMessages.DEFAULT_PREVIEW_TEXT);
- }
-
- /**
- * Method update preview tab with information from the CSS file passed by parameter.
- *
- * @param cssFile CSS file to be displayed in preview area
- */
- public void initPreview(CSSModel cssModel) {
- this.cssModel = cssModel;
- if (cssModel != null) {
- IEditorInput input = new FileEditorInput(cssModel.getStyleFile());
- try {
- WorkbenchWindow workbenchWindow = (WorkbenchWindow)PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- EditorAreaHelper editorPresentation = new EditorAreaHelper((WorkbenchPage) workbenchWindow.getActivePage());
- EditorManager editorManager = new EditorManager(workbenchWindow, (WorkbenchPage) workbenchWindow.getActivePage(), editorPresentation);
-
- IEditorReference ref = editorManager.openEditor(EDITOR_ID, input, true, null);
- if (ref != null) {
- // all preview tab editors should be disposed before adding new editor compoment
- for (Control control : getChildren()) {
- control.dispose();
- }
- if (editor != null) {
- editor.doRevertToSaved();
- editor.close(false);
- }
- editor = (StructuredTextEditor)ref.getEditor(true);
- editor.createPartControl(this);
- editor.getTextViewer().setEditable(false);
- }
-
- layout();
- } catch (PartInitException e) {
- e.printStackTrace();
- }
- }
- }
-
- public void doRevertToSaved() {
- if (editor != null) {
- editor.doRevertToSaved();
- }
- }
-
- /**
- * Method is used to select area that corresponds to specific selector.
- *
- * @param selector the selector that should be selected in editor area
- * @param index if CSS file contains more then one elements with the same selector name,
- * then index is serial number of this selector
- */
- public void selectEditorArea(String selector, int index) {
- if (cssModel != null) {
- IndexedRegion indexedRegion = cssModel.getSelectorRegion(selector, index);
- if (editor != null) {
- if (indexedRegion != null) {
- editor.selectAndReveal(indexedRegion.getStartOffset(), indexedRegion.getLength());
- } else {
- editor.selectAndReveal(0, 0);
- }
- }
- }
- }
-
- /**
- * Method is used to close CSS file editor correctly.
- *
- * @param save true if close editor with closure operation; false - otherwise
- */
- public void closeEditor(boolean save) {
- if (editor != null) {
- editor.doRevertToSaved();
- editor.close(save);
- editor = null;
- }
- if (cssModel != null) {
- cssModel.releaseModel();
- }
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.jsp.outline.cssdialog.tabs;
+
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.jface.text.source.SourceViewer;
+import org.eclipse.jface.text.source.SourceViewerConfiguration;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.wst.css.ui.StructuredTextViewerConfigurationCSS;
+import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.ui.StructuredTextEditor;
+import org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration;
+import org.eclipse.wst.sse.ui.internal.StructuredTextViewer;
+import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
+import org.jboss.tools.jst.jsp.messages.JstUIMessages;
+import org.jboss.tools.jst.jsp.outline.cssdialog.common.CSSModel;
+import org.jboss.tools.jst.jsp.outline.cssdialog.events.StyleAttributes;
+
+/**
+ * Class for creating Preview sheet tab
+ */
+public class TabPreviewControl extends Composite {
+
+ /** Editor in which we open visual page. */
+ protected final static String EDITOR_ID = "org.eclipse.wst.css.core.csssource.source"; //$NON-NLS-1$
+
+
+ /**
+ * TODO remove the field
+ * @deprecated
+ */
+ private StructuredTextEditor editor = null;
+ SourceViewer viewer = null;
+ private CSSModel cssModel = null;
+
+ /**
+ * Constructor for creating controls
+ *
+ * @param composite The parent composite for tab
+ * @param styleAttributes the StyleAttributes object
+ */
+ public TabPreviewControl(Composite tabFolder, StyleAttributes styleAttributes) {
+ super(tabFolder, SWT.NONE);
+ setLayout(new FillLayout());
+ Label label = new Label(this, SWT.CENTER);
+ label.setText(JstUIMessages.DEFAULT_PREVIEW_TEXT);
+ }
+
+ /**
+ * Method update preview tab with information from the CSS file passed by parameter.
+ *
+ * @param cssFile CSS file to be displayed in preview area
+ */
+ public void initPreview(CSSModel cssModel) {
+ this.cssModel = cssModel;
+ if (cssModel != null) {
+ IEditorInput input = new FileEditorInput(cssModel.getStyleFile());
+// try {
+// WorkbenchWindow workbenchWindow = (WorkbenchWindow)PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+// EditorAreaHelper editorPresentation = new EditorAreaHelper((WorkbenchPage) workbenchWindow.getActivePage());
+// EditorManager editorManager = new EditorManager(workbenchWindow, (WorkbenchPage) workbenchWindow.getActivePage(), editorPresentation);
+
+// IEditorReference ref = editorManager.openEditor(EDITOR_ID, input, true, null);
+// if (ref != null) {
+ // all preview tab editors should be disposed before adding new editor compoment
+ for (Control control : getChildren()) {
+ control.dispose();
+ }
+// if (editor != null) {
+// editor.doRevertToSaved();
+// editor.close(false);
+// }
+// editor = (StructuredTextEditor)ref.getEditor(true);
+// editor.createPartControl(this);
+// editor.getTextViewer().setEditable(false);
+
+ SourceViewerConfiguration sourceViewerConfiguration = new StructuredTextViewerConfiguration() {
+ StructuredTextViewerConfiguration baseConfiguration = new StructuredTextViewerConfigurationCSS();
+
+ public String[] getConfiguredContentTypes(
+ ISourceViewer sourceViewer) {
+ return baseConfiguration
+ .getConfiguredContentTypes(sourceViewer);
+ }
+
+ public LineStyleProvider[] getLineStyleProviders(
+ ISourceViewer sourceViewer, String partitionType) {
+ return baseConfiguration.getLineStyleProviders(
+ sourceViewer, partitionType);
+ }
+ };
+ viewer = new StructuredTextViewer(this, null, null,
+ false, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
+ ((StructuredTextViewer) viewer).getTextWidget().setFont(
+ JFaceResources.getFont("org.eclipse.wst.sse.ui.textfont")); //$NON-NLS-1$
+
+ // IStructuredModel scratchModel =
+ // StructuredModelManager.getModelManager().createUnManagedStructuredModelFor(ContentTypeIdForCSS.ContentTypeID_CSS);
+ // IDocument document = scratchModel.getStructuredDocument();
+ viewer.configure(sourceViewerConfiguration);
+ viewer.setDocument(cssModel.getStructuredDocument());
+ viewer.setEditable(false);
+// }
+
+ layout();
+// } catch (PartInitException e) {
+// e.printStackTrace();
+// }
+ }
+ }
+
+ public void doRevertToSaved() {
+
+ cssModel.reload();
+
+// if (editor != null) {
+// editor.doRevertToSaved();
+// }
+
+ }
+
+ /**
+ * TODO redesign method : remove "index" param
+ * Method is used to select area that corresponds to specific selector.
+ *
+ * @param selector the selector that should be selected in editor area
+ * @param index if CSS file contains more then one elements with the same selector name,
+ * then index is serial number of this selector
+ */
+ public void selectEditorArea(String selector, int index) {
+ if (cssModel != null) {
+ IndexedRegion indexedRegion = cssModel.getSelectorRegion(selector,
+ index);
+ if (/* editor */viewer != null) {
+ if (indexedRegion != null) {
+ // editor.selectAndReveal(indexedRegion.getStartOffset(),
+ // indexedRegion.getLength());
+ viewer.setSelectedRange(indexedRegion.getStartOffset(),
+ indexedRegion.getLength());
+ viewer.revealRange(indexedRegion.getStartOffset(),
+ indexedRegion.getLength());
+ } else {
+ // editor.selectAndReveal(0, 0);
+ viewer.setSelectedRange(0, 0);
+ viewer.revealRange(0,0);
+ }
+ }
+ }
+ }
+
+ /**
+ * Method is used to close CSS file editor correctly.
+ *
+ * @param save true if close editor with closure operation; false - otherwise
+ */
+ public void closeEditor(boolean save) {
+// if (editor != null) {
+// editor.doRevertToSaved();
+// editor.close(save);
+// editor = null;
+// }
+ if(!save)
+ doRevertToSaved();
+
+ if (cssModel != null) {
+ cssModel.releaseModel();
+ }
+ }
+}
15 years, 11 months
JBoss Tools SVN: r13143 - trunk/jsf/docs/userguide/en/modules.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2009-01-20 05:02:46 -0500 (Tue, 20 Jan 2009)
New Revision: 13143
Modified:
trunk/jsf/docs/userguide/en/modules/preferences.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-384- updating the "Server Preferences" section in the Visual Tools guide;
Modified: trunk/jsf/docs/userguide/en/modules/preferences.xml
===================================================================
--- trunk/jsf/docs/userguide/en/modules/preferences.xml 2009-01-20 10:01:47 UTC (rev 13142)
+++ trunk/jsf/docs/userguide/en/modules/preferences.xml 2009-01-20 10:02:46 UTC (rev 13143)
@@ -1021,23 +1021,6 @@
</mediaobject>
</figure>
- <para>Navigate to <emphasis>
- <property>Server > JBoss Server View</property>
- </emphasis> to set preferences for <property>JBoss Servers view</property>. On this page
- you can enable or disable any of the listed view extensions, change their sequence order
- and also edit preferences specific to each view extension. For example, <emphasis>
- <property>Event Log</property>
- </emphasis> preferences:</para>
-
- <figure>
- <title>JBoss Server View Preferences</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/preferences/preferences_39.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
<para>Going to <emphasis>
<property>Server > Audio</property>
</emphasis> you can enable/disable the sound notification for different Server states
15 years, 11 months
JBoss Tools SVN: r13142 - trunk/jsf/docs/userguide/en/images/preferences.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2009-01-20 05:01:47 -0500 (Tue, 20 Jan 2009)
New Revision: 13142
Modified:
trunk/jsf/docs/userguide/en/images/preferences/preferences_36.png
trunk/jsf/docs/userguide/en/images/preferences/preferences_37.png
trunk/jsf/docs/userguide/en/images/preferences/preferences_38.png
trunk/jsf/docs/userguide/en/images/preferences/preferences_40.png
Log:
https://jira.jboss.org/jira/browse/JBDS-384 - the screens are updated;
Modified: trunk/jsf/docs/userguide/en/images/preferences/preferences_36.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en/images/preferences/preferences_37.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en/images/preferences/preferences_38.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en/images/preferences/preferences_40.png
===================================================================
(Binary files differ)
15 years, 11 months
JBoss Tools SVN: r13140 - trunk/seam/docs/reference/en/images/seam_preferences.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2009-01-20 04:23:54 -0500 (Tue, 20 Jan 2009)
New Revision: 13140
Modified:
trunk/seam/docs/reference/en/images/seam_preferences/seam_preferences2.png
trunk/seam/docs/reference/en/images/seam_preferences/seam_preferences2_2.png
Log:
https://jira.jboss.org/jira/browse/JBDS-558 - updating the screens;
Modified: trunk/seam/docs/reference/en/images/seam_preferences/seam_preferences2.png
===================================================================
(Binary files differ)
Modified: trunk/seam/docs/reference/en/images/seam_preferences/seam_preferences2_2.png
===================================================================
(Binary files differ)
15 years, 11 months