Hibernate SVN: r18085 - in annotations/branches/v3_4_0_GA_CP-r17982/src/main: assembly and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2009-11-27 16:01:31 -0500 (Fri, 27 Nov 2009)
New Revision: 18085
Added:
annotations/branches/v3_4_0_GA_CP-r17982/src/main/assembly/
annotations/branches/v3_4_0_GA_CP-r17982/src/main/assembly/dist.xml
Log:
JBPAPP-3150 add assembly/dist.xml for assembing the distribution
Added: annotations/branches/v3_4_0_GA_CP-r17982/src/main/assembly/dist.xml
===================================================================
--- annotations/branches/v3_4_0_GA_CP-r17982/src/main/assembly/dist.xml (rev 0)
+++ annotations/branches/v3_4_0_GA_CP-r17982/src/main/assembly/dist.xml 2009-11-27 21:01:31 UTC (rev 18085)
@@ -0,0 +1,43 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<assembly>
+ <id>dist</id>
+ <formats>
+ <!-- <format>tar.gz</format>
+ <format>tar.bz2</format> -->
+ <format>zip</format>
+ </formats>
+
+ <dependencySets>
+ <dependencySet>
+ <useProjectArtifact>false</useProjectArtifact>
+ <outputDirectory>lib</outputDirectory>
+ <scope>runtime</scope>
+ </dependencySet>
+ </dependencySets>
+
+ <fileSets>
+ <fileSet>
+ <directory>target</directory>
+ <outputDirectory>.</outputDirectory>
+ <includes>
+ <include>*.jar</include>
+ </includes>
+ </fileSet>
+ <fileSet>
+ <directory>target/site/apidocs</directory>
+ <outputDirectory>docs/api</outputDirectory>
+ </fileSet>
+ <fileSet>
+ <directory>target/docbook/publish/en</directory>
+ <outputDirectory>docs/manual/en</outputDirectory>
+ </fileSet>
+ <fileSet>
+ <directory>.</directory>
+ <outputDirectory></outputDirectory>
+ <useDefaultExcludes>true</useDefaultExcludes>
+ <excludes>
+ <exclude>**/target/**</exclude>
+ </excludes>
+ </fileSet>
+ </fileSets>
+</assembly>
15 years, 2 months
Hibernate SVN: r18084 - annotations/branches/v3_4_0_GA_CP-r17982/src/main/docbook.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2009-11-27 15:58:26 -0500 (Fri, 27 Nov 2009)
New Revision: 18084
Removed:
annotations/branches/v3_4_0_GA_CP-r17982/src/main/docbook/README
annotations/branches/v3_4_0_GA_CP-r17982/src/main/docbook/build.xml
annotations/branches/v3_4_0_GA_CP-r17982/src/main/docbook/docbook-common-build.xml
annotations/branches/v3_4_0_GA_CP-r17982/src/main/docbook/support/
Log:
JBPAPP-3510 remove unnecessary docbook build script, now the docbook will be built by maven jdocbook plugin
Deleted: annotations/branches/v3_4_0_GA_CP-r17982/src/main/docbook/README
===================================================================
--- annotations/branches/v3_4_0_GA_CP-r17982/src/main/docbook/README 2009-11-27 20:56:32 UTC (rev 18083)
+++ annotations/branches/v3_4_0_GA_CP-r17982/src/main/docbook/README 2009-11-27 20:58:26 UTC (rev 18084)
@@ -1,9 +0,0 @@
-We're using the DocBook XSL distribution for HTML and PDF
-generation. The best results can be achieved with the
-Saxon XSLT processor (don't use Xalan!) and the Apache
-FOP library.
-
-The documentation is generated with the distribution
-build.xml target 'doc<pdf|html|htmlsingle>'.
-
-christian(a)hibernate.org
Deleted: annotations/branches/v3_4_0_GA_CP-r17982/src/main/docbook/build.xml
===================================================================
--- annotations/branches/v3_4_0_GA_CP-r17982/src/main/docbook/build.xml 2009-11-27 20:56:32 UTC (rev 18083)
+++ annotations/branches/v3_4_0_GA_CP-r17982/src/main/docbook/build.xml 2009-11-27 20:58:26 UTC (rev 18084)
@@ -1,22 +0,0 @@
-<project name="Documentation" default="all.doc" basedir=".">
-
- <import file="docbook-common-build.xml"/>
-
- <target name="all.doc" depends="clean">
-
- <!-- TRANSLATOR: Duplicate this call for your language -->
- <antcall target="lang.all">
- <param name="docname" value="hibernate_annotations"/>
- <param name="lang" value="en"/>
- </antcall>
- <antcall target="lang.all">
- <param name="docname" value="hibernate_annotations"/>
- <param name="lang" value="zh_cn"/>
- </antcall>
- <antcall target="lang.all">
- <param name="docname" value="hibernate_annotations"/>
- <param name="lang" value="fr"/>
- </antcall>
- </target>
-
-</project>
Deleted: annotations/branches/v3_4_0_GA_CP-r17982/src/main/docbook/docbook-common-build.xml
===================================================================
--- annotations/branches/v3_4_0_GA_CP-r17982/src/main/docbook/docbook-common-build.xml 2009-11-27 20:56:32 UTC (rev 18083)
+++ annotations/branches/v3_4_0_GA_CP-r17982/src/main/docbook/docbook-common-build.xml 2009-11-27 20:58:26 UTC (rev 18084)
@@ -1,209 +0,0 @@
-<!--
- To build the reference docs for a particular language only, use "ant -Dlang=en", for
- example, and call either lang.all, lang.docpdf, lang.dochtml, or lang.dochtmlsingle
- for the target of your choice.
-
- You can also call lang.section-check to track down missing identifiers in a particular
- language, or you can call lang.revdiff to get a difference report for a particular
- language, compared with the English reference.
--->
-<project name="ReferenceDocumentation" default="all.doc" basedir=".">
- <!-- Allow this to be overriden by others importing this project. -->
- <dirname property="imported.basedir" file="${ant.file.ReferenceDocumentation}"/>
-
- <!-- Set build directories for all formats. -->
- <property name="build.dir" value="${basedir}/build"/>
-
- <!-- Support files for build process. -->
- <property name="support.dir" value="${imported.basedir}/support"/>
-
- <!-- Base name for documentation artifacts. -->
- <property name="docname" value="hibernate_reference"/>
-
- <!-- Set DocBook stylesheets. -->
- <property name="db.style.fopdf" value="fopdf.xsl"/>
- <property name="db.style.html" value="html_chunk.xsl"/>
- <property name="db.style.htmlsingle" value="html.xsl"/>
-
- <!-- Classpath for the build tools. -->
- <path id="lib.classpath">
- <fileset dir="${support.dir}/lib">
- <include name="**/*.jar"/>
- </fileset>
- </path>
-
- <!-- ################################################################## -->
-
- <target name="all.doc"
- depends="clean"
- description="Compile documentation for all languages and all formats.">
-
- <!-- TRANSLATOR: Duplicate this line for your language -->
- <antcall target="lang.all"><param name="lang" value="en"/></antcall>
- <antcall target="lang.all"><param name="lang" value="fr"/></antcall>
- <!-- TODO: These translations need updating before we can enable them...
- <antcall target="lang.all"><param name="lang" value="ja"/></antcall>
- <antcall target="lang.all"><param name="lang" value="ko"/></antcall>
- <antcall target="lang.all"><param name="lang" value="zh-cn"/></antcall>
- -->
-
- </target>
-
- <target name="all.revdiff"
- description="Generates a diff report for all translated versions.">
-
- <!-- TRANSLATOR: Duplicate this line for your language -->
- <antcall target="lang.revdiff"><param name="lang" value="fr"/></antcall>
- <antcall target="lang.revdiff"><param name="lang" value="ko"/></antcall>
- <antcall target="lang.revdiff"><param name="lang" value="ja"/></antcall>
- <antcall target="lang.revdiff"><param name="lang" value="zh-cn"/></antcall>
-
- </target>
-
- <!-- ################################################################## -->
-
- <target name="clean">
-
- <!-- Delete build directory. -->
- <delete dir="${build.dir}"/>
-
- </target>
-
- <target name="lang.all">
- <!-- Compile the documentation for a single language in all formats. -->
- <antcall target="lang.docpdf"/>
- <antcall target="lang.dochtml"/>
- <antcall target="lang.dochtmlsingle"/>
- <antcall target="lang.htmlmisc"/>
- </target>
-
-
- <target name="lang.docpdf.prepare">
-
- <!-- Copy all the images to the output location, will be removed later. -->
- <copy todir="${build.dir}/${lang}/pdf/images">
- <fileset dir="${basedir}/${lang}/images">
- <include name="**/*.png"/>
- <include name="**/*.svg"/>
- <include name="**/*.gif"/>
- </fileset>
- </copy>
-
- <!-- Create the XSL/FO temporary file. -->
- <java classname="com.icl.saxon.StyleSheet" fork="true" dir="${basedir}" maxmemory="128m" >
- <classpath refid="lib.classpath"/>
- <arg value="-o"/>
- <arg value="${build.dir}/${lang}/pdf/docbook_fop.tmp"/>
- <arg value="${basedir}/${lang}/master.xml"/>
- <arg value="${basedir}/${lang}/styles/${db.style.fopdf}"/>
- </java>
-
- <available property="custom.fop.userconfig.present" file="userconfig.xml" filepath="${basedir}/${lang}/fop"/>
- </target>
-
- <target name="lang.docpdf.customized" depends="lang.docpdf.prepare" if="custom.fop.userconfig.present">
-
- <copy todir="${build.dir}/${lang}/pdf">
- <fileset dir="${basedir}/${lang}/fop">
- <include name="*"/>
- </fileset>
- </copy>
-
- <!-- Create a PDF from the XSL/FO, using customized fop userconfig.xml -->
- <java classname="org.apache.fop.apps.Fop" fork="true" dir="${basedir}" maxmemory="128m" >
- <classpath refid="lib.classpath"/>
- <arg value="-c"/>
- <arg value="${basedir}/${lang}/fop/userconfig.xml"/>
- <arg value="${build.dir}/${lang}/pdf/docbook_fop.tmp"/>
- <arg value="${build.dir}/${lang}/pdf/${docname}.pdf"/>
- </java>
- </target>
-
- <target name="lang.docpdf.normal" depends="lang.docpdf.prepare" unless="custom.fop.userconfig.present">
- <!-- Create a PDF from the XSL/FO. -->
- <java classname="org.apache.fop.apps.Fop" fork="true" dir="${basedir}">
- <classpath refid="lib.classpath"/>
- <arg value="${build.dir}/${lang}/pdf/docbook_fop.tmp"/>
- <arg value="${build.dir}/${lang}/pdf/${docname}.pdf"/>
- </java>
- </target>
-
- <target name="lang.docpdf" depends="lang.docpdf.normal,lang.docpdf.customized"
- description="Generates the PDF documentation only for a language (set lang)">
- <!-- House keeping,delete temporary files. -->
- <delete>
- <fileset dir="${build.dir}/${lang}/pdf" excludes="**/*.pdf"/>
- </delete>
- <delete dir="${build.dir}/${lang}/pdf/images"/>
- </target>
-
- <target name="lang.dochtml"
- description="Generates the HTML documentation only for a language (set lang)">
-
- <mkdir dir="${build.dir}/${lang}/html/"/>
-
- <java classname="com.icl.saxon.StyleSheet" fork="true" dir="${build.dir}/${lang}/html">
- <classpath refid="lib.classpath"/>
- <arg value="${basedir}/${lang}/master.xml"/>
- <arg value="${basedir}/${lang}/styles/${db.style.html}"/>
- </java>
- </target>
-
- <target name="lang.dochtmlsingle"
- description="Generates the single-page HTML documentation only for a language (set lang)">
-
- <mkdir dir="${build.dir}/${lang}/html_single/"/>
-
- <java classname="com.icl.saxon.StyleSheet" fork="true" dir="${basedir}">
- <classpath refid="lib.classpath"/>
- <arg value="-o"/>
- <arg value="${build.dir}/${lang}/html_single/index.html"/>
- <arg value="${basedir}/${lang}/master.xml"/>
- <arg value="${basedir}/${lang}/styles/${db.style.htmlsingle}"/>
- </java>
- </target>
-
- <target name="lang.htmlmisc">
-
- <!-- Copy images and CSS for HTML documentation, language specific. -->
- <copy todir="${build.dir}/${lang}/shared/images">
- <fileset dir="${basedir}/${lang}/images">
- <include name="**/*.png"/>
- <include name="**/*.gif"/>
- </fileset>
- </copy>
- <copy todir="${build.dir}/${lang}/shared/css">
- <fileset dir="${basedir}/${lang}/styles">
- <include name="**/*.css"/>
- </fileset>
- </copy>
-
- </target>
-
- <target name="lang.revdiff"
- description="Reports difference between English and translation (set lang)">
-
- <mkdir dir="${build.dir}"/>
-
- <taskdef name="revdiff"
- classname="org.hibernate.docproc.revdiff.RevDiffReportTask"
- classpathref="lib.classpath">
-
- </taskdef>
-
- <revdiff original="${basedir}/en/master.xml"
- copy="${basedir}/${lang}/master.xml"
- report="${build.dir}/status_${lang}.html"/>
-
- </target>
-
- <target name="lang.section-check" depends="lang.dochtml"
- description="Reports missing unique chapter/section identifiers (set lang)">
- <java classname="com.icl.saxon.StyleSheet" fork="true" dir="${build.dir}/${lang}/html">
- <classpath refid="lib.classpath"/>
- <arg value="${basedir}/${lang}/master.xml"/>
- <arg value="${support.dir}/section-check.xsl"/>
- </java>
- </target>
-
-</project>
15 years, 2 months
Hibernate SVN: r18083 - annotations/branches/v3_4_0_GA_CP-r17982.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2009-11-27 15:56:32 -0500 (Fri, 27 Nov 2009)
New Revision: 18083
Removed:
annotations/branches/v3_4_0_GA_CP-r17982/doc/
Log:
JBPAPP-3150 remove doc directory, now the doc source has been moved into src/main/docbook directory
15 years, 2 months
Hibernate SVN: r18082 - in annotations/branches/v3_4_0_GA_CP-r17982: src/main and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2009-11-27 15:48:52 -0500 (Fri, 27 Nov 2009)
New Revision: 18082
Added:
annotations/branches/v3_4_0_GA_CP-r17982/src/main/docbook/
annotations/branches/v3_4_0_GA_CP-r17982/src/main/javadoc/
Removed:
annotations/branches/v3_4_0_GA_CP-r17982/doc/api/
annotations/branches/v3_4_0_GA_CP-r17982/doc/reference/
Log:
move doc/api into src/main/javadoc
move doc/reference into src/main/docbook
Copied: annotations/branches/v3_4_0_GA_CP-r17982/src/main/docbook (from rev 18079, annotations/branches/v3_4_0_GA_CP-r17982/doc/reference)
Copied: annotations/branches/v3_4_0_GA_CP-r17982/src/main/javadoc (from rev 18079, annotations/branches/v3_4_0_GA_CP-r17982/doc/api)
15 years, 2 months
Hibernate SVN: r18081 - in annotations/branches/v3_4_0_GA_CP-r17982/src: main and 1 other directories.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2009-11-27 15:43:03 -0500 (Fri, 27 Nov 2009)
New Revision: 18081
Added:
annotations/branches/v3_4_0_GA_CP-r17982/src/main/
annotations/branches/v3_4_0_GA_CP-r17982/src/main/java/
Removed:
annotations/branches/v3_4_0_GA_CP-r17982/src/filters/
annotations/branches/v3_4_0_GA_CP-r17982/src/java/
Modified:
annotations/branches/v3_4_0_GA_CP-r17982/src/main/java/org/hibernate/annotations/SQLDelete.java
annotations/branches/v3_4_0_GA_CP-r17982/src/main/java/org/hibernate/annotations/SQLInsert.java
annotations/branches/v3_4_0_GA_CP-r17982/src/main/java/org/hibernate/annotations/SQLUpdate.java
Log:
create src/main directory
move src/java into src/main/java
remove src/filters directory
Copied: annotations/branches/v3_4_0_GA_CP-r17982/src/main/java (from rev 18079, annotations/branches/v3_4_0_GA_CP-r17982/src/java)
Modified: annotations/branches/v3_4_0_GA_CP-r17982/src/main/java/org/hibernate/annotations/SQLDelete.java
===================================================================
--- annotations/branches/v3_4_0_GA_CP-r17982/src/java/org/hibernate/annotations/SQLDelete.java 2009-11-27 20:04:42 UTC (rev 18079)
+++ annotations/branches/v3_4_0_GA_CP-r17982/src/main/java/org/hibernate/annotations/SQLDelete.java 2009-11-27 20:43:03 UTC (rev 18081)
@@ -1,4 +1,4 @@
-//$Id:$
+//$Id$
package org.hibernate.annotations;
import static java.lang.annotation.ElementType.TYPE;
Modified: annotations/branches/v3_4_0_GA_CP-r17982/src/main/java/org/hibernate/annotations/SQLInsert.java
===================================================================
--- annotations/branches/v3_4_0_GA_CP-r17982/src/java/org/hibernate/annotations/SQLInsert.java 2009-11-27 20:04:42 UTC (rev 18079)
+++ annotations/branches/v3_4_0_GA_CP-r17982/src/main/java/org/hibernate/annotations/SQLInsert.java 2009-11-27 20:43:03 UTC (rev 18081)
@@ -1,4 +1,4 @@
-//$Id:$
+//$Id$
package org.hibernate.annotations;
import static java.lang.annotation.ElementType.TYPE;
Modified: annotations/branches/v3_4_0_GA_CP-r17982/src/main/java/org/hibernate/annotations/SQLUpdate.java
===================================================================
--- annotations/branches/v3_4_0_GA_CP-r17982/src/java/org/hibernate/annotations/SQLUpdate.java 2009-11-27 20:04:42 UTC (rev 18079)
+++ annotations/branches/v3_4_0_GA_CP-r17982/src/main/java/org/hibernate/annotations/SQLUpdate.java 2009-11-27 20:43:03 UTC (rev 18081)
@@ -1,4 +1,4 @@
-//$Id:$
+//$Id$
package org.hibernate.annotations;
import static java.lang.annotation.ElementType.TYPE;
15 years, 2 months
Hibernate SVN: r18080 - annotations/branches/v3_4_0_GA_CP-r17982.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2009-11-27 15:37:44 -0500 (Fri, 27 Nov 2009)
New Revision: 18080
Removed:
annotations/branches/v3_4_0_GA_CP-r17982/build.properties.dist
annotations/branches/v3_4_0_GA_CP-r17982/build.xml
annotations/branches/v3_4_0_GA_CP-r17982/common-build.xml
annotations/branches/v3_4_0_GA_CP-r17982/ivy.xml
annotations/branches/v3_4_0_GA_CP-r17982/ivy/
annotations/branches/v3_4_0_GA_CP-r17982/jdbc/
annotations/branches/v3_4_0_GA_CP-r17982/lib/
Modified:
annotations/branches/v3_4_0_GA_CP-r17982/pom.xml
Log:
JBPAPP-3150 remove unnecessary ivy stuff and update pom.xml
Deleted: annotations/branches/v3_4_0_GA_CP-r17982/build.properties.dist
===================================================================
--- annotations/branches/v3_4_0_GA_CP-r17982/build.properties.dist 2009-11-27 20:04:42 UTC (rev 18079)
+++ annotations/branches/v3_4_0_GA_CP-r17982/build.properties.dist 2009-11-27 20:37:44 UTC (rev 18080)
@@ -1,3 +0,0 @@
-common.dir=.
-src.dir=src
-test.dir=test
Deleted: annotations/branches/v3_4_0_GA_CP-r17982/build.xml
===================================================================
--- annotations/branches/v3_4_0_GA_CP-r17982/build.xml 2009-11-27 20:04:42 UTC (rev 18079)
+++ annotations/branches/v3_4_0_GA_CP-r17982/build.xml 2009-11-27 20:37:44 UTC (rev 18080)
@@ -1,232 +0,0 @@
-<!--
-
- Hibernate Annotations ANT build script.
-
- You need JDK 5.0 installed to build Hibernate Annotations.
-
--->
-
-<project name="Hibernate Annotations" default="dist" basedir="."
- xmlns:ivy="antlib:fr.jayasoft.ivy.ant">
-
- <!-- Give user a chance to override without editing this file
- (and without typing -D each time it compiles it) -->
- <property file="build.properties"/>
- <property file="${user.home}/.ant.properties"/>
-
- <!-- Name of project and version, used to create filenames -->
- <property name="Name" value="Hibernate Annotations"/>
- <property name="name" value="hibernate-annotations"/>
- <property name="version" value="3.4.0.GA"/>
- <property name="javadoc.packagenames" value="org.hibernate.*"/>
- <property name="jdbc.dir" value="jdbc"/>
- <property name="copy.test" value="true"/>
- <property name="javac.source" value="1.5"/>
- <property name="javac.target" value="1.5"/>
- <property name="common.dir" value="${basedir}"/>
- <property name="ivy.dep.dir" value="${basedir}/build/lib"/>
-
- <available property="jpa-present" file="${basedir}/../jpa-api" type="dir"/>
- <property name="jpa-javadoc.dir" value="${dist.doc.dir}/jpa-api"/>
-
- <import file="${common.dir}/common-build.xml"/>
-
- <path id="lib.moduleclass.path">
- <fileset dir="${ivy.dep.dir}/core">
- <include name="*.jar"/>
- </fileset>
- <fileset dir="${common-build.basedir}/lib/build">
- <!-- ${build.lib.dir} fails in reference doc build -->
- <include name="junitext-*.jar"/>
- </fileset>
- </path>
-
- <path id="junit.moduleclasspath">
- <pathelement location="${src.dir}"/>
- <pathelement location="${test.dir}"/>
- <fileset dir="${jdbc.dir}">
- <include name="**/*.jar"/>
- <include name="**/*.zip"/>
- </fileset>
- <fileset dir="${ivy.dep.dir}/test">
- <include name="*.jar"/>
- </fileset>
- </path>
-
- <target name="init">
- <antcall target="common-build.init"/>
- <tstamp>
- <format property="now" pattern="yyyyMMddhhmmss"/>
- </tstamp>
- <mkdir dir="${ivy.dep.dir}/core"/>
- <mkdir dir="${ivy.dep.dir}/test"/>
- <ivy:configure file="${ivy.jar.dir}/ivyconf.xml"/>
- </target>
-
- <target name="compile" depends="init,get.deps.core"
- description="Compile the Java source code">
-
- <available classname="org.eclipse.core.launcher.Main"
- property="build.compiler"
- value="org.eclipse.jdt.core.JDTCompilerAdapter"
- classpath="${java.class.path}"/>
- <javac srcdir="${src.dir}" destdir="${classes.dir}"
- classpathref="lib.class.path" debug="${javac.debug}"
- optimize="${javac.optimize}" nowarn="on" source="${javac.source}"
- target="${javac.target}">
- <src path="${src.dir}"/>
- </javac>
- <copy todir="${classes.dir}">
- <fileset dir="${src.dir}">
- <include name="**/resources/*.properties"/>
- <include name="**/*.xsd"/>
- </fileset>
- </copy>
- </target>
-
- <target name="compiletest" depends="compile,get.deps.test"
- description="Compile the tests">
- <available classname="org.eclipse.core.launcher.Main"
- property="build.compiler"
- value="org.eclipse.jdt.core.JDTCompilerAdapter"
- classpath="${java.class.path}"/>
- <javac destdir="${testclasses.dir}" classpathref="junit.classpath"
- debug="${javac.debug}" optimize="${javac.optimize}" nowarn="on"
- source="${javac.source}" target="${javac.target}">
- <src refid="testsrc.path"/>
- </javac>
- </target>
-
- <target name="jar" depends="compile"
- description="Build the distribution .jar file">
- <mkdir dir="${classes.dir}/META-INF"/>
- <manifest file="${classes.dir}/META-INF/MANIFEST.MF">
- <attribute name="Implementation-Title" value="${Name}"/>
- <attribute name="Implementation-Version" value="${version}"/>
- <attribute name="Implementation-Vendor" value="hibernate.org"/>
- <attribute name="Implementation-Vendor-Id" value="hibernate.org"/>
- <attribute name="Implementation-URL"
- value="http://annotations.hibernate.org"/>
- <attribute name="Specification-Title" value="Java Persistence"/>
- <attribute name="Specification-Version" value="1.0"/>
- <attribute name="Specification-Vendor" value="jcp.org"/>
- </manifest>
- <antcall target="common-build.jar"/>
- <delete file="${dist.dir}/ivy.xml"/>
- <!-- delete last produced ivy file to be sure a new one will be generated -->
- <ivy:resolve conf="default"/>
- <ivy:publish artifactspattern="${dist.dir}/[artifact].[ext]"
- resolver="local" pubrevision="latest" pubdate="${now}"
- status="integration"/>
- </target>
-
- <target name="junit" depends="compiletest">
- <for list="${targetdb}" param="db">
- <sequential>
- <antcall target="test-resources">
- <param name="db" value="@{db}"/>
- </antcall>
- <mkdir dir="${testreports.dir}/@{db}"/>
- <echo>Running against db: @{db}</echo>
- <junit printsummary="yes" haltonfailure="yes" forkmode="once">
- <classpath refid="junit.classpath"/>
- <formatter type="plain"/>
- <formatter type="xml"/>
- <batchtest fork="yes" todir="${testreports.dir}/@{db}"
- haltonfailure="no">
- <fileset refid="junit.batchtestset"/>
- </batchtest>
- </junit>
- </sequential>
- </for>
- </target>
-
- <!-- Run a single unit test. -->
- <target name="junitsingle" depends="compiletest"
- description="Run a single test suite (requires testname and jdbc.driver properties)">
- <for list="${targetdb}" param="db">
- <sequential>
- <antcall target="test-resources">
- <param name="db" value="@{db}"/>
- </antcall>
- <mkdir dir="${testreports.dir}/@{db}"/>
- <echo>Running against db: @{db}</echo>
- <junit printsummary="yes" fork="yes" haltonfailure="yes">
- <classpath refid="junit.classpath"/>
- <formatter type="plain"/>
- <formatter type="xml"/>
- <test fork="yes" todir="${testreports.dir}/@{db}"
- haltonfailure="no" name="${testname}"/>
- </junit>
- </sequential>
- </for>
- </target>
-
- <target name="jpa-javadoc" if="jpa-present">
- <mkdir dir="${jpa-javadoc.dir}"/>
- <ant dir="../jpa-api" target="javadoc" inheritAll="false"/>
- <copy todir="${jpa-javadoc.dir}">
- <fileset dir="${basedir}/../jpa-api/build/api">
- <include name="**/*.*"/>
- </fileset>
- </copy>
- </target>
-
- <!-- Some of this can probably be moved to common-build... -->
- <target name="dist"
- depends="get.deps.core,get.deps.test,jar,javadoc,jpa-javadoc,copysource,copytest,copylib,extras"
- description="Build everything">
-
- <ant inheritall="false" dir="${basedir}/doc/reference"/>
- <copy todir="${dist.dir}/doc/reference" failonerror="false">
- <fileset dir="${basedir}/doc/reference/build">
- <include name="**/*.*"/>
- </fileset>
- </copy>
-
- <copy todir="${dist.dir}" failonerror="false">
- <fileset dir="${common.dir}">
- <include name="common-build.xml"/>
- </fileset>
- </copy>
- <copy todir="${dist.dir}/ivy" failonerror="false">
- <fileset dir="${ivy.jar.dir}">
- <include name="**/*.*"/>
- </fileset>
- </copy>
-
- <!-- copy dependencies -->
- <copy todir="${dist.lib.dir}" failonerror="false">
- <fileset dir="${ivy.dep.dir}/core">
- <include name="*.jar"/>
- </fileset>
- </copy>
- <mkdir dir="${dist.lib.dir}/test"/>
- <copy todir="${dist.lib.dir}/test" failonerror="false">
- <fileset dir="${ivy.dep.dir}/test">
- <include name="*.jar"/>
- </fileset>
- </copy>
-
-
- <!-- ivy uses the module name without hibernate- (to mimic the directory names). Revert the situation -->
- <move file="${dist.lib.dir}/commons-annotations.jar"
- tofile="${dist.lib.dir}/hibernate-commons-annotations.jar"
- failonerror="false"/>
-
- <copy file="${basedir}/build.properties.dist"
- tofile="${dist.dir}/build.properties" failonerror="false">
- </copy>
- <antcall target="common-build.dist"/>
- </target>
-
- <target name="zip-dist" description="zip the dist">
- <zip zipfile="${dist.dir}-${version}.zip">
- <zipfileset prefix="${name}-${version}" dir="${dist.dir}"/>
- </zip>
- <tar compression="gzip" tarfile="${dist.dir}-${version}.tar.gz">
- <tarfileset prefix="${name}-${version}" dir="${dist.dir}"/>
- </tar>
- </target>
-
-</project>
Deleted: annotations/branches/v3_4_0_GA_CP-r17982/common-build.xml
===================================================================
--- annotations/branches/v3_4_0_GA_CP-r17982/common-build.xml 2009-11-27 20:04:42 UTC (rev 18079)
+++ annotations/branches/v3_4_0_GA_CP-r17982/common-build.xml 2009-11-27 20:37:44 UTC (rev 18080)
@@ -1,455 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project name="common-build" default="dist"
- xmlns:artifact="urn:maven-artifact-ant" xmlns:ivy="antlib:fr.jayasoft.ivy.ant">
- <description>Common properties and targets for the HibernateExt
- project</description>
-
-
- <!-- my.basedir property can be used to refer to files/directories relatively to the common-build.xml file -->
- <dirname property="common-build.basedir" file="${ant.file.common-build}"/>
-
- <!-- Give user a chance to override without editing this file
- (and without typing -D each time it compiles it) -->
- <property file="${common-build.basedir}/build.properties"/>
- <property file="${user.home}/.ant.properties"/>
-
- <property name="src.dir" location="src/java"/>
- <property name="test.dir" location="src/test"/>
- <property name="test.resources.dir" location="src/test-resources"/>
- <property name="filter.dir" location="src/filters"/>
- <property name="lib.dir" location="lib"/>
- <property name="build.dir" location="build"/>
- <property name="classes.dir" location="${build.dir}/classes"/>
- <property name="testclasses.dir" location="${build.dir}/testclasses"/>
- <property name="testreports.dir" location="${build.dir}/test-reports"/>
- <property name="dist.target.dir" location="target"/>
- <property name="dist.dir" location="${dist.target.dir}/${name}"/>
- <property name="instrumenttest.out.dir" value="${build.dir}/test-reports/instrument"/>
- <property name="doc.dir" location="doc"/>
- <property name="doc.api.dir" location="${doc.dir}/api"/>
- <property name="doc.reference.dir" location="${doc.dir}/reference"/>
-
- <property name="dist.doc.dir" location="${dist.dir}/doc"/>
- <property name="dist.api.dir" location="${dist.dir}/doc/api"/>
-
- <property name="dist.src.dir" location="${dist.dir}/src"/>
- <property name="dist.test.dir" location="${dist.dir}/test"/>
- <property name="dist.lib.dir" location="${dist.dir}/lib"/>
- <property name="jar.name" value="${name}"/>
- <property name="jar.file.name" value="${dist.dir}/${jar.name}.jar"/>
- <property name="jartest.file.name" value="${dist.dir}/${jar.name}-tests.jar"/>
-
- <property name="javadoc" value="http://java.sun.com/j2se/1.4/docs/api"/>
- <property name="javac.debug" value="on"/>
- <property name="javac.optimize" value="off"/>
- <property name="javac.source" value="1.4"/>
- <property name="javac.target" value="1.4"/>
-
- <property name="pom.file" value="${build.dir}/pom.xml"/>
- <property name="src.jar" value="${build.dir}/src.jar"/>
-
- <taskdef name="junit"
- classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask">
- <classpath>
- <fileset dir="${common-build.basedir}/lib/build">
- <!-- ${build.lib.dir} fails in reference doc build -->
- <include name="junit-*.jar"/>
- <include name="ant-junit-*.jar"/>
- </fileset>
- </classpath>
- </taskdef>
-
- <taskdef name="junitreport"
- classname="org.apache.tools.ant.taskdefs.optional.junit.XMLResultAggregator">
- <classpath>
- <fileset dir="${common-build.basedir}/lib/build">
- <!-- ${build.lib.dir} fails in reference doc build -->
- <include name="junit-*.jar"/>
- <include name="ant-junit-*.jar"/>
- </fileset>
- </classpath>
- </taskdef>
-
- <taskdef resource="net/sf/antcontrib/antlib.xml">
- <classpath>
- <fileset dir="${common-build.basedir}/lib/build">
- <!-- ${build.lib.dir} fails in reference doc build -->
- <include name="ant-contrib-*.jar"/>
- </fileset>
- </classpath>
- </taskdef>
-
- <!-- ivy load -->
- <property name="ivy.jar.dir" value="${common-build.basedir}/ivy"/>
- <property name="ivy.conf.dir" value="${common-build.basedir}"/>
- <path id="ivy.lib.path">
- <fileset dir="${ivy.jar.dir}" includes="*.jar"/>
- </path>
- <taskdef resource="fr/jayasoft/ivy/ant/antlib.xml"
- uri="antlib:fr.jayasoft.ivy.ant" classpathref="ivy.lib.path"/>
-
- <!-- maven task load -->
- <path id="maven-ant-tasks.path" path="${ivy.jar.dir}/maven-ant-tasks.jar"/>
- <typedef resource="org/apache/maven/artifact/ant/antlib.xml"
- uri="urn:maven-artifact-ant" classpathref="maven-ant-tasks.path"/>
-
- <artifact:remoteRepository id="offline.repository.jboss.org"
- url="file://${offline.repository.jboss.org}"/>
-
- <path id="lib.class.path">
- <path refid="lib.moduleclass.path"/>
- <pathelement path="${clover.jar}"/>
- </path>
-
- <!-- overridable in modules -->
- <path id="lib.moduleclass.path"/>
-
- <patternset id="support.files">
- <include name="**/*.jpg"/>
- <include name="**/*.gif"/>
- <include name="**/*.dtd"/>
- <include name="**/*.xsd"/>
- <include name="**/*.xml"/>
- <include name="**/*.xslt"/>
-
- <!-- exclude everything we don't want in the jar -->
- <exclude name="${build.dir}/**/*"/>
- <exclude name="${doc.dir}/**/*"/>
- <exclude name="classes/**/*"/>
- <exclude name="build.xml"/>
- <exclude name="**/*.properties"/>
- <exclude name="**/*.ccf"/>
- <exclude name="**/*.cfg.xml"/>
- <exclude name="**/ehcache.xml"/>
- </patternset>
-
- <patternset id="source.files">
- <include name="**/*.java"/>
- <include name="**/*.properties"/>
- </patternset>
-
- <!-- junit paths/filesets -->
- <fileset dir="${testclasses.dir}" id="junit.batchtestset">
- <include name="**/*Test.class"/>
- </fileset>
-
- <path id="testsrc.path">
- <pathelement location="${test.dir}"/>
- </path>
-
- <path id="junit.classpath">
- <pathelement path="${classes.dir}"/>
- <pathelement path="${testclasses.dir}"/>
- <path refid="lib.class.path"/>
- <path refid="junit.moduleclasspath"/>
- <path location="${clover.jar}"/>
- </path>
-
- <!-- Determine the database against which to run tests-->
- <if>
- <equals arg1="${targetdb}" arg2="$${targetdb}"/>
- <then>
- <echo message="No target database specified using default HSQLDB"/>
- <property name="targetdb" value="hsqldb"/>
- </then>
- </if>
-
- <!-- Clover tasks -->
- <target name="with.clover">
- <clover-setup initString="clover_coverage.db"/>
- </target>
-
- <target name="cloverreport.html" depends="with.clover"
- description="Generate a clover report from the current clover database.">
- <clover-report>
- <current outfile="${clover.out.dir}">
- <format type="html"/>
- </current>
- </clover-report>
- </target>
-
- <target name="cloverreport"
- depends="with.clover,junitreport,cloverreport.html"
- description="Run the tests and generate a clover report">
- </target>
-
- <!-- Tasks -->
- <target name="clean" description="Cleans up build and dist directories">
- <delete dir="${build.dir}"/>
- <delete dir="${dist.target.dir}"/>
- <delete dir="${clover.out.dir}"/>
- </target>
-
- <target name="init" description="Initialize the build">
- <tstamp>
- <format property="subversion" pattern="yyyy-MM-dd hh:mm:ss"/>
- </tstamp>
- <tstamp>
- <format property="releasedate" pattern="dd-MM-yyyy"/>
- </tstamp>
- <echo message="Build ${Name}-${version} (${subversion})"/>
- <mkdir dir="${classes.dir}"/>
- <mkdir dir="${testclasses.dir}"/>
- <copy todir="${classes.dir}">
- <fileset dir="${src.dir}">
- <patternset refid="support.files"/>
- </fileset>
- </copy>
- <filter token="version" value="${version}"/>
- <filter token="releasedate" value="${releasedate}"/>
- <copy todir="${build.dir}" filtering="true">
- <fileset dir=".">
- <include name="readme.txt"/>
- <include name="lgpl.txt"/>
- <include name="pom.xml"/>
- </fileset>
- </copy>
- </target>
-
- <target name="get.deps.core" depends="init"
- description="retrieve the core dependencies" unless="disable.ivy">
- <ivy:resolve conf="default"/>
- <ivy:retrieve pattern="${ivy.dep.dir}/core/[artifact].[ext]"
- conf="default"/>
- </target>
-
- <target name="get.deps.test" depends="init"
- description="retrieve the test dependencies" unless="disable.ivy">
- <ivy:resolve conf="test"/>
- <ivy:retrieve pattern="${ivy.dep.dir}/test/[artifact].[ext]" conf="test"/>
- </target>
-
- <target name="copytest" description="Copy tests to dist dir" if="copy.test">
- <mkdir dir="${dist.test.dir}"/>
- <copy todir="${dist.test.dir}">
- <fileset dir="${test.dir}"/>
- </copy>
- </target>
-
- <target name="copysource" depends="copytest"
- description="Copy sources to dist dir">
- <mkdir dir="${dist.src.dir}"/>
- <copy todir="${dist.src.dir}">
- <fileset dir="${src.dir}">
- <patternset refid="source.files"/>
- </fileset>
- <fileset dir="${src.dir}">
- <patternset refid="support.files"/>
- </fileset>
- </copy>
- <mkdir dir="${dist.src.dir}"/>
- <copy todir="${dist.src.dir}">
- <fileset dir="${src.dir}">
- <patternset refid="source.files"/>
- </fileset>
- <fileset dir="${src.dir}">
- <patternset refid="support.files"/>
- </fileset>
- </copy>
- </target>
-
- <target name="copylib" description="Copy jars to lib dir">
- <mkdir dir="${dist.lib.dir}"/>
- <copy todir="${dist.lib.dir}" verbose="true">
- <fileset dir="${lib.dir}">
- <include name="**/*.jar"/>
- <exclude name="log4j.jar"/>
- <exclude name="checkstyle*.jar"/>
- <include name="*.txt"/>
- </fileset>
- </copy>
- </target>
-
- <target name="copydoc" description="Copy doc to dist dir" if="copy.doc">
- <mkdir dir="${dist.doc.dir}"/>
- <copy todir="${dist.doc.dir}">
- <fileset dir="${doc.dir}">
- <include name="**/*.html"/>
- </fileset>
- </copy>
- </target>
-
- <target name="jar" depends="compile"
- description="Build the distribution .jar file">
- <mkdir dir="${dist.dir}"/>
- <jar filesetmanifest="merge" jarfile="${jar.file.name}"
- basedir="${classes.dir}"/>
- </target>
-
- <target name="jartest" depends="compiletest"
- description="Build the distribution .jar file">
- <mkdir dir="${dist.dir}"/>
- <jar filesetmanifest="merge" jarfile="${jartest.file.name}"
- basedir="${testclasses.dir}"/>
- </target>
-
- <!-- DOCUMENTATION -->
-
- <target name="javadoc"
- description="Compile the Javadoc API documentation to dist dir">
- <mkdir dir="${dist.api.dir}"/>
- <javadoc packagenames="${javadoc.packagenames}"
- classpathref="lib.class.path" destdir="${dist.api.dir}" use="true"
- protected="true" version="true"
- windowtitle="${Name} API Documentation"
- Overview="${doc.api.dir}/package.html"
- doctitle="${Name} API Documentation"
- stylesheetfile="${doc.api.dir}/jdstyle.css" link="${javadoc}">
- <packageset dir="${src.dir}" defaultexcludes="yes">
- <include name="**/*"/>
- </packageset>
- </javadoc>
- </target>
-
- <target name="extras" description="Copies miscellaneous files to root dir">
- <copy todir="${dist.dir}/bin" failonerror="false">
- <fileset dir="bin">
- <include name="*.bat"/>
- </fileset>
- </copy>
- <copy file="${build.dir}/readme.txt" todir="${dist.dir}"/>
- <copy file="lgpl.txt" todir="${dist.dir}"/>
- <copy file="changelog.txt" todir="${dist.dir}"/>
- <copy file="build.xml" todir="${dist.dir}"/>
- <replace file="${dist.dir}/build.xml">
- <replacetoken><![CDATA[../${name}-${version}]]>
- </replacetoken>
- <replacevalue><![CDATA[../${name}]]>
- </replacevalue>
- </replace>
- </target>
-
- <target name="dist" depends="jar,javadoc,copysource,copydoc,extras"
- description="Build everything">
- <zip zipfile="${dist.dir}-${version}.zip">
- <zipfileset prefix="${name}-${version}" dir="${dist.dir}"/>
- </zip>
- <tar compression="gzip" tarfile="${dist.dir}-${version}.tar.gz">
- <tarfileset prefix="${name}-${version}" dir="${dist.dir}"/>
- </tar>
- </target>
-
- <target name="info" description="Echoes useful system properties">
- <echo message="java.vm.info=${java.vm.info}"/>
- <echo message="java.vm.name=${java.vm.name}"/>
- <echo message="java.vm.vendor=${java.vm.vendor}"/>
- <echo message="java.vm.version=${java.vm.version}"/>
- <echo message="os.arch=${os.arch}"/>
- <echo message="os.name=${os.name}"/>
- <echo message="os.version=${os.version}"/>
- <echo message="java.home = ${java.home}"/>
- <echo message="java.class.path = ${java.class.path}"/>
- <echo message="build.compiler = ${build.compiler}"/>
- <echo message="file.encoding=${file.encoding}"/>
- <echo message="user.home = ${user.home}"/>
- <echo message="user.language=${user.language}"/>
- </target>
-
- <target name="test-resources" description="Copies and filters test resources">
- <filter filtersfile="${filter.dir}/${db}.filter"/>
- <mkdir dir="${testclasses.dir}"/>
- <copy todir="${testclasses.dir}" filtering="true" overwrite="true">
- <fileset dir="${test.resources.dir}">
- <include name="*.properties"/>
- <include name="*.xml"/>
- </fileset>
- </copy>
- </target>
-
- <target name="instrument" depends="compiletest"
- description="Instrument the persistent classes"> <!-- depends="jar" -->
-
- <taskdef name="instrument"
- classname="org.hibernate.tool.instrument.javassist.InstrumentTask">
- <classpath refid="junit.classpath"/>
- </taskdef>
-
- <instrument verbose="true">
- <fileset dir="${testclasses.dir}/org/hibernate/test">
- <include name="**/*.class"/>
- <exclude name="**/*Test$*.class"/>
- <exclude name="**/*Test.class"/>
- <exclude name="**/*Tests.class"/>
- </fileset>
- </instrument>
- </target>
-
- <target name="junitinstrument" depends="compiletest,instrument"
- description="Run the instrument test suite">
- <for list="${targetdb}" param="db">
- <sequential>
- <antcall target="test-resources">
- <param name="db" value="@{db}"/>
- </antcall>
- <mkdir dir="${instrumenttest.out.dir}/@{db}"/>
- <echo>Running against db: @{db}</echo>
- <junit printsummary="yes" haltonfailure="yes" dir="${basedir}"
- maxmemory="256M" fork="yes" forkmode="perBatch">
- <classpath refid="junit.classpath"/>
- <formatter type="plain"/>
- <formatter type="xml"/>
- <batchtest todir="${instrumenttest.out.dir}/@{db}" haltonfailure="no">
- <fileset refid="junit.batchtestset"/>
- </batchtest>
- </junit>
- </sequential>
- </for>
- </target>
-
- <target name="junitreport" depends="">
- <junitreport todir="${testreports.dir}">
- <fileset dir="${testreports.dir}">
- <include name="TEST-*.xml"/>
- </fileset>
- <report format="frames" todir="${testreports.dir}"/>
- </junitreport>
- </target>
-
- <target name="checkstyle" description="Check coding style">
- <taskdef resource="checkstyletask.properties">
- <classpath>
- <path refid="lib.class.path"/>
- <fileset dir="${common-build.basedir}/lib">
- <include name="checkstyle*.jar"/>
- </fileset>
- </classpath>
- </taskdef>
-
- <checkstyle config="${common-build.basedir}/checkstyle_checks.xml">
- <fileset dir="${src.dir}">
- <include name="**/*.java"/>
- </fileset>
- <formatter type="plain"/>
- </checkstyle>
- </target>
-
- <target name="patch" depends="checkstyle" description="Create a patch">
- <cvs command="-q diff -u -N" output="patch.txt"/>
- </target>
-
- <!-- maven deploy: to be used by the subbuild and delcare deps on jar -->
- <target name="deploy" depends="jar">
- <fail unless="offline.repository.jboss.org"
- message="offline.repository.jboss.org must be defined"/>
- <jar jarfile="${src.jar}" basedir="${src.dir}">
- <include name="**/*.java"/>
- <exclude name="**/test/*.java"/>
- <!-- patternset refid="meta.files" / -->
- </jar>
-
- <artifact:pom id="maven.project" file="${pom.file}"/>
-
- <artifact:install file="${jar.file.name}">
- <pom refid="maven.project"/>
- </artifact:install>
-
- <artifact:deploy file="${jar.file.name}">
- <pom refid="maven.project"/>
- <remoteRepository refId="offline.repository.jboss.org">
- </remoteRepository>
- <attach file="${src.jar}" classifier="sources"/>
- <attach file="${jar.file.name}" classifier=""/>
- </artifact:deploy>
- </target>
-
-</project>
Deleted: annotations/branches/v3_4_0_GA_CP-r17982/ivy.xml
===================================================================
--- annotations/branches/v3_4_0_GA_CP-r17982/ivy.xml 2009-11-27 20:04:42 UTC (rev 18079)
+++ annotations/branches/v3_4_0_GA_CP-r17982/ivy.xml 2009-11-27 20:37:44 UTC (rev 18080)
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ivy-module version="1.3"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:noNamespaceSchemaLocation=
- "http://www.jayasoft.org/misc/ivy/ivy.xsd">
- <info organisation="org.hibernate" module="annotations"/>
- <configurations>
- <conf name="default" description="Core module dependencies"/>
- <conf name="test" visibility="private" description="Dependencies needed for testing purposes"/>
- </configurations>
- <publications>
- <artifact name="hibernate-annotations" conf="default"/>
- </publications>
- <dependencies>
- <!-- compile time dependencies -->
- <dependency name="ejb3-persistence" rev="1.0.2.GA" conf="default->default"/>
- <dependency name="commons-annotations" rev="3.1.0.GA" conf="default->default"/>
- <dependency org="org.hibernate" name="hibernate-core" rev="3.3.0.SP1" conf="default->default"/>
- <dependency org="dom4j" name="dom4j" rev="1.6.1" conf="default->default"/>
- <dependency org="org.slf4j" name="slf4j-api" rev="1.4.2" conf="default->default"/>
-
-
- <!-- transitive dependencies -->
- <dependency org="antlr" name="antlr" rev="2.7.6" conf="test->default"/>
- <dependency org="commons-collections" name="commons-collections" rev="3.1" conf="test->default"/>
-
- <!-- test deps -->
- <dependency org="javassist" name="javassist" rev="3.4.GA" conf="test->default"/>
- <dependency org="asm" name="asm" rev="1.5.3" conf="test->default"/>
- <dependency org="asm" name="asm-attrs" rev="1.5.3" conf="test->default"/>
- <dependency org="javax.transaction" name="jta" rev="1.1" conf="test->default"/>
- <dependency org="org.slf4j" name="slf4j-log4j12" rev="1.4.2" conf="test->default"/>
- <dependency org="log4j" name="log4j" rev="1.2.14" conf="test->default"/>
- <dependency org="junit" name="junit" rev="3.8.1" conf="test->default"/>
- </dependencies>
-</ivy-module>
\ No newline at end of file
Modified: annotations/branches/v3_4_0_GA_CP-r17982/pom.xml
===================================================================
--- annotations/branches/v3_4_0_GA_CP-r17982/pom.xml 2009-11-27 20:04:42 UTC (rev 18079)
+++ annotations/branches/v3_4_0_GA_CP-r17982/pom.xml 2009-11-27 20:37:44 UTC (rev 18080)
@@ -1,52 +1,653 @@
<?xml version="1.0"?>
-<project
- xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<packaging>jar</packaging>
- <version>@version@</version>
+ <version>3.4.0.GA</version>
<name>Hibernate Annotations</name>
<description>Annotations metadata for Hibernate</description>
<url>http://annotations.hibernate.org</url>
+ <organization>
+ <name>Hibernate.org</name>
+ <url>http://hibernate.org</url>
+ </organization>
+
<licenses>
<license>
- <name>GNU LESSER GENERAL PUBLIC LICENSE</name>
- <url>http://www.gnu.org/licenses/lgpl.txt</url>
+ <name>GNU Lesser General Public License</name>
+ <url>http://www.gnu.org/licenses/lgpl-2.1.html</url>
+ <comments>See discussion at http://hibernate.org/356.html for more
+ details.</comments>
+ <distribution>repo</distribution>
</license>
</licenses>
+ <issueManagement>
+ <system>JIRA</system>
+ <url>http://opensource.atlassian.com/projects/hibernate/browse/ANN</url>
+ </issueManagement>
+ <scm>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/hibernate/annotations/branches/v3_...</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/hibernate/annotations/branches/v3_4_0...</developerConnection>
+ <url>http://fisheye.jboss.com/browse/Hibernate/annotations/branches/v3_4_0_GA_CP</url>
+ </scm>
<dependencies>
<dependency>
<groupId>org.hibernate</groupId>
+ <artifactId>hibernate-core</artifactId>
+ <version>3.3.2.GA</version>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
<artifactId>ejb3-persistence</artifactId>
<version>1.0.2.GA</version>
</dependency>
- <dependency>
+ <dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-commons-annotations</artifactId>
<version>3.1.0.GA</version>
</dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-core</artifactId>
- <version>3.3.0.SP1</version>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>${slf4jVersion}</version>
</dependency>
<dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <version>1.4.2</version>
- </dependency>
- <dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>1.6.1</version>
</dependency>
- </dependencies>
+ <!-- =============================== -->
+ <!-- Testing Dependencies -->
+ <!-- =============================== -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jcl-over-slf4j</artifactId>
+ <version>${slf4jVersion}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>${slf4jVersion}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>99.0-does-not-exist</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging-api</artifactId>
+ <version>99.0-does-not-exist</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>javassist</groupId>
+ <artifactId>javassist</artifactId>
+ <version>3.9.0.GA</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>cglib</groupId>
+ <artifactId>cglib</artifactId>
+ <version>2.2</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <testResources>
+ <testResource>
+ <filtering>false</filtering>
+ <directory>src/test/java</directory>
+ <includes>
+ <include>**/*.xml</include>
+ </includes>
+ </testResource>
+ <testResource>
+ <filtering>true</filtering>
+ <directory>src/test/resources</directory>
+ </testResource>
+ </testResources>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-injection-plugin</artifactId>
+ <version>1.0.0</version>
+ <executions>
+ <execution>
+ <phase>compile</phase>
+ <goals>
+ <goal>bytecode</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <bytecodeInjections>
+ <bytecodeInjection>
+ <expression>${pom.version}</expression>
+ <targetMembers>
+ <constant>
+ <className>org.hibernate.cfg.annotations.Version</className>
+ <fieldName>VERSION</fieldName>
+ >
+ </constant>
+ </targetMembers>
+ </bytecodeInjection>
+ </bytecodeInjections>
+ </configuration>
+ </plugin>
+ <plugin>
+ <!-- require at least JDK 1.5 to run the build -->
+ <!-- ... -->
+ <!--
+ we need at least Maven 2.0.8 because of a bug fix affecting our
+ antlr usage
+ -->
+ <!--
+ 2.0.8 not released at this time, so I instead say anything greater
+ that 2.0.7
+ -->
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>enforce-java</id>
+ <goals>
+ <goal>enforce</goal>
+ </goals>
+ <configuration>
+ <rules>
+ <requireJavaVersion>
+ <version>[1.5,)</version>
+ </requireJavaVersion>
+ <requireMavenVersion>
+ <version>(2.0.7,)</version>
+ </requireMavenVersion>
+ </rules>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-test-ext-plugin</artifactId>
+ <version>1.1.0</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>extend</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <!--
+ by default, compile to JDK 1.4 compatibility (individual modules
+ and/or user can override)
+ -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ <!-- add specification/implementation details to the manifests -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <addMavenDescriptor>false</addMavenDescriptor>
+ <manifest>
+ <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
+ <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
+ </manifest>
+ <manifestEntries>
+ <Specification-Vendor>jcp.org</Specification-Vendor>
+ <Specification-Version>1.0</Specification-Version>
+ <Specification-Title>Java Persistence</Specification-Title>
+ <Implementation-Vendor-Id>hibernate.org</Implementation-Vendor-Id>
+ <Implementation-URL>http://annotations.hibernate.org</Implementation-URL>
+ </manifestEntries>
+ </archive>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <redirectTestOutputToFile>true</redirectTestOutputToFile>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <configuration>
+ <descriptors>
+ <descriptor>src/main/assembly/dist.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jdocbook-plugin</artifactId>
+ <version>2.2.0</version>
+ <extensions>true</extensions>
+ <dependencies>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-jdocbook-style</artifactId>
+ <version>2.0.0</version>
+ <type>jdocbook-style</type>
+ </dependency>
+ </dependencies>
+ <configuration>
+ <sourceDocumentName>master.xml</sourceDocumentName>
+ <sourceDirectory>${basedir}/src/main/docbook</sourceDirectory>
+ <masterTranslation>en</masterTranslation>
+ <imageResource>
+ <directory>${basedir}/src/main/docbook/en/images</directory>
+ </imageResource>
+ <formats>
+ <format>
+ <formatName>pdf</formatName>
+ <stylesheetResource>classpath:/xslt/org/hibernate/jdocbook/xslt/pdf.xsl</stylesheetResource>
+ <finalName>hibernate_annotations_reference.pdf</finalName>
+ </format>
+ <format>
+ <formatName>html_single</formatName>
+ <stylesheetResource>classpath:/xslt/org/hibernate/jdocbook/xslt/xhtml-single.xsl
+ </stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ <format>
+ <formatName>html</formatName>
+ <stylesheetResource>classpath:/xslt/org/hibernate/jdocbook/xslt/xhtml.xsl
+ </stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ </formats>
+ <options>
+ <xincludeSupported>true</xincludeSupported>
+ <xmlTransformerType>saxon</xmlTransformerType>
+ <!-- needed for uri-resolvers; can be ommitted if using 'current' uri scheme -->
+ <!-- could also locate the docbook dependency and inspect its version... -->
+ <docbookVersion>1.72.0</docbookVersion>
+ <localeSeparator>-</localeSeparator>
+ </options>
+ </configuration>
+ <executions>
+ <execution>
+ <id>make-doc</id>
+ <phase>package</phase>
+ <goals>
+ <goal>resources</goal>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <links>
+ <link>http://java.sun.com/j2se/1.5.0/docs/api/</link>
+ <link>http://java.sun.com/javaee/5/docs/api/</link>
+ </links>
+ <stylesheetfile>${basedir}/src/main/javadoc/jdstyle.css</stylesheetfile>
+ </configuration>
+ <executions>
+ <execution>
+ <id>make-doc</id>
+ <phase>package</phase>
+ <goals>
+ <goal>javadoc</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+<!-- <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.4.3</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.1</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <version>1.0-alpha-3</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.0.2</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ <extensions>
+ <extension>
+ <groupId>org.apache.maven.wagon</groupId>
+ <artifactId>wagon-webdav</artifactId>
+ <version>1.0-beta-2</version>
+ </extension>
+ </extensions> -->
+ </build>
+
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-report-plugin</artifactId>
+ <version>2.4.3</version>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jxr-plugin</artifactId>
+ <version>2.1</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-pmd-plugin</artifactId>
+ <version>2.2</version>
+ <configuration>
+ <linkXRef>true</linkXRef>
+ <minimumTokens>100</minimumTokens>
+ <targetJdk>1.5</targetJdk>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>taglist-maven-plugin</artifactId>
+ <version>2.1</version>
+ <configuration>
+ <tags>
+ <tag>@FIXME</tag>
+ <tag>@fixme</tag>
+ <tag>FIXME</tag>
+ <tag>fixme</tag>
+ <tag>@TODO</tag>
+ <tag>@todo</tag>
+ <tag>TODO</tag>
+ <tag>todo</tag>
+ </tags>
+ </configuration>
+ </plugin>
+ <plugin>
+ <!--
+ Note: aggregate-able, may cause problems if we aggregate jxr and
+ not this because of the xref links
+ -->
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>javancss-maven-plugin</artifactId>
+ <version>2.0-beta-2</version>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>findbugs-maven-plugin</artifactId>
+ <version>1.1.1</version>
+ <configuration>
+ <onlyAnalyze>org.hibernate.*</onlyAnalyze>
+ </configuration>
+ </plugin>
+ </plugins>
+ </reporting>
+
+
+ <profiles>
+ <!-- HSQLDB is the default (eventually move to H2) -->
+ <profile>
+ <id>hsqldb</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ <version>1.8.0.2</version>
+ </dependency>
+ </dependencies>
+ <properties>
+ <db.dialect>org.hibernate.dialect.HSQLDialect</db.dialect>
+ <jdbc.driver>org.hsqldb.jdbcDriver</jdbc.driver>
+ <jdbc.url>jdbc:hsqldb:target/test/db/hsqldb/hibernate</jdbc.url>
+ <jdbc.user>sa</jdbc.user>
+ <jdbc.pass />
+ <jdbc.isolation />
+ </properties>
+ </profile>
+
+ <!-- The H2 test envionment -->
+ <profile>
+ <id>h2</id>
+ <dependencies>
+ <dependency>
+ <groupId>org.h2database</groupId>
+ <artifactId>h2database</artifactId>
+ <version>1.0.20061217</version>
+ </dependency>
+ </dependencies>
+ <properties>
+ <db.dialect>org.hibernate.dialect.H2Dialect</db.dialect>
+ <jdbc.driver>org.h2.Driver</jdbc.driver>
+ <jdbc.url>jdbc:h2:mem:target/test/db/h2/hibernate</jdbc.url>
+ <jdbc.user>sa</jdbc.user>
+ <jdbc.pass />
+ <jdbc.isolation />
+ </properties>
+ </profile>
+
+ <!--
+ ###################################################################
+ Profiles naming db instances in the Red Hat QA/QE lab First, those
+ with OSS drivers
+ ###################################################################
+ -->
+
+ <!-- The MySQL5 test envionment -->
+ <profile>
+ <id>mysql5</id>
+ <dependencies>
+ <dependency>
+ <groupId>mysql</groupId>
+ <artifactId>mysql-connector-java</artifactId>
+ <version>5.0.5</version>
+ </dependency>
+ </dependencies>
+ <properties>
+ <db.dialect>org.hibernate.dialect.MySQL5InnoDBDialect</db.dialect>
+ <jdbc.driver>com.mysql.jdbc.Driver</jdbc.driver>
+ <jdbc.url>jdbc:mysql://vmg08.mw.lab.eng.bos.redhat.com/hibbr330</jdbc.url>
+ <jdbc.user>hibbr330</jdbc.user>
+ <jdbc.pass>hibbr330</jdbc.pass>
+ <jdbc.isolation />
+ </properties>
+ </profile>
+
+ <!-- The PostgreSQL test envionment -->
+ <profile>
+ <id>postgresql823</id>
+ <dependencies>
+ <dependency>
+ <groupId>postgresql</groupId>
+ <artifactId>postgresql</artifactId>
+ <version>8.2-504</version>
+ <classifier>jdbc3</classifier>
+ </dependency>
+ </dependencies>
+ <properties>
+ <db.dialect>org.hibernate.dialect.PostgreSQLDialect</db.dialect>
+ <jdbc.driver>org.postgresql.Driver</jdbc.driver>
+ <jdbc.url>jdbc:postgresql://dev01.qa.atl.jboss.com:5432:hibbr330</jdbc.url>
+ <jdbc.user>hibbr330</jdbc.user>
+ <jdbc.pass>hibbr330</jdbc.pass>
+ <jdbc.isolation />
+ </properties>
+ </profile>
+
+ <!--
+ ###################################################################
+ Then, those with commercial drivers
+ ###################################################################
+ -->
+
+ <!-- The DB2 8.x test envionment (using 9x drivers)-->
+ <profile>
+ <id>db2v82</id>
+ <dependencies>
+ <dependency>
+ <groupId>com.ibm</groupId>
+ <artifactId>db2jcc</artifactId>
+ <version>3.1.57</version>
+ </dependency>
+ <dependency>
+ <groupId>com.ibm</groupId>
+ <artifactId>db2jcc_license_cu</artifactId>
+ <version>3.1.57</version>
+ </dependency>
+ </dependencies>
+ <properties>
+ <db.dialect>org.hibernate.dialect.DB2Dialect</db.dialect>
+ <jdbc.driver>com.ibm.db2.jcc.DB2Driver</jdbc.driver>
+ <jdbc.url>jdbc:db2://dev32.qa.atl.jboss.com:50000/jbossqa</jdbc.url>
+ <jdbc.user>hibbr330</jdbc.user>
+ <jdbc.pass>hibbr330</jdbc.pass>
+ <jdbc.isolation />
+ </properties>
+ </profile>
+
+ <!-- The DB2 9.x test envionment (using 9x drivers)-->
+ <profile>
+ <id>db2v91</id>
+ <dependencies>
+ <dependency>
+ <groupId>com.ibm</groupId>
+ <artifactId>db2jcc</artifactId>
+ <version>3.1.57</version>
+ </dependency>
+ <dependency>
+ <groupId>com.ibm</groupId>
+ <artifactId>db2jcc_license_cu</artifactId>
+ <version>3.1.57</version>
+ </dependency>
+ </dependencies>
+ <properties>
+ <db.dialect>org.hibernate.dialect.DB2Dialect</db.dialect>
+ <jdbc.driver>com.ibm.db2.jcc.DB2Driver</jdbc.driver>
+ <jdbc.url>jdbc:db2://dev67.qa.atl.jboss.com:50000/jbossqa</jdbc.url>
+ <jdbc.user>hibbr330</jdbc.user>
+ <jdbc.pass>hibbr330</jdbc.pass>
+ <jdbc.isolation />
+ </properties>
+ </profile>
+
+ <!-- The Oracle9i test envionment -->
+ <profile>
+ <id>oracle9i</id>
+ <dependencies>
+ <dependency>
+ <groupId>com.oracle</groupId>
+ <artifactId>ojdbc14</artifactId>
+ <!-- use the 10g drivers which are surprisingly largely bug free -->
+ <version>10.0.2.0</version>
+ </dependency>
+ </dependencies>
+ <properties>
+ <db.dialect>org.hibernate.dialect.Oracle9iDialect</db.dialect>
+ <jdbc.driver>oracle.jdbc.driver.OracleDriver</jdbc.driver>
+ <jdbc.url>jdbc:oracle:thin:@dev20.qa.atl.jboss.com:1521:qa</jdbc.url>
+ <jdbc.user>hibbr330</jdbc.user>
+ <jdbc.pass>hibbr330</jdbc.pass>
+ <jdbc.isolation />
+ </properties>
+ </profile>
+
+ <!-- The Oracle10g test envionment -->
+ <profile>
+ <id>oracle10g</id>
+ <dependencies>
+ <dependency>
+ <groupId>com.oracle</groupId>
+ <artifactId>ojdbc14</artifactId>
+ <!-- use the 10g drivers which are surprisingly largely bug free -->
+ <version>10.0.2.0</version>
+ </dependency>
+ </dependencies>
+ <properties>
+ <db.dialect>org.hibernate.dialect.Oracle10gDialect</db.dialect>
+ <jdbc.driver>oracle.jdbc.driver.OracleDriver</jdbc.driver>
+ <jdbc.url>jdbc:oracle:thin:@dev01.qa.atl.jboss.com:1521:qadb01</jdbc.url>
+ <jdbc.user>hibbr330</jdbc.user>
+ <jdbc.pass>hibbr330</jdbc.pass>
+ <jdbc.isolation />
+ </properties>
+ </profile>
+
+ <!-- The Sybase 15 test envionment -->
+ <profile>
+ <id>sybase15</id>
+ <dependencies>
+ <dependency>
+ <groupId>com.sybase</groupId>
+ <artifactId>jconnect</artifactId>
+ <version>6.0.5</version>
+ </dependency>
+ </dependencies>
+ <properties>
+ <db.dialect>org.hibernate.dialect.SybaseASE15Dialect</db.dialect>
+ <jdbc.driver>com.sybase.jdbc3.jdbc.SybDriver</jdbc.driver>
+ <jdbc.url>jdbc:sybase:Tds:dev77.qa.atl2.redhat.com:5000/hibbr330</jdbc.url>
+ <jdbc.user>hibbr330</jdbc.user>
+ <jdbc.pass>hibbr330</jdbc.pass>
+ <jdbc.isolation />
+ </properties>
+ </profile>
+
+ <!-- The SQLServer2005 (MS JDBC) test envionment -->
+ <profile>
+ <id>mssql2005</id>
+ <dependencies>
+ <dependency>
+ <groupId>com.microsoft.sqlserver</groupId>
+ <artifactId>msjdbc</artifactId>
+ <version>1.1</version>
+ </dependency>
+ </dependencies>
+ <properties>
+ <db.dialect>org.hibernate.dialect.SQLServerDialect</db.dialect>
+ <jdbc.driver>com.microsoft.sqlserver.jdbc.SQLServerDriver</jdbc.driver>
+ <jdbc.url>jdbc:sqlserver://dev30.qa.atl.jboss.com:3918</jdbc.url>
+ <jdbc.user>hibbr330</jdbc.user>
+ <jdbc.pass>hibbr330</jdbc.pass>
+ <jdbc.isolation>4096</jdbc.isolation>
+ </properties>
+ </profile>
+
+ </profiles>
+ <properties>
+ <slf4jVersion>1.5.8</slf4jVersion>
+ </properties>
</project>
\ No newline at end of file
15 years, 2 months
Hibernate SVN: r18079 - annotations/branches.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2009-11-27 15:04:42 -0500 (Fri, 27 Nov 2009)
New Revision: 18079
Added:
annotations/branches/v3_4_0_GA_CP-r17982/
Log:
JBPAPP-3150 create branch v3_4_0_GA_CP-r17982, for resurrectting the log info
Copied: annotations/branches/v3_4_0_GA_CP-r17982 (from rev 17982, annotations/branches/v3_4_0_GA_CP)
15 years, 2 months
Hibernate SVN: r18078 - in search/trunk/src: main/java/org/hibernate/search/cfg and 2 other directories.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2009-11-27 12:30:32 -0500 (Fri, 27 Nov 2009)
New Revision: 18078
Modified:
search/trunk/src/main/docbook/en-US/modules/mapping.xml
search/trunk/src/main/java/org/hibernate/search/cfg/EntityMapping.java
search/trunk/src/main/java/org/hibernate/search/cfg/FullTextFilterDefMapping.java
search/trunk/src/main/java/org/hibernate/search/cfg/IndexedMapping.java
search/trunk/src/main/java/org/hibernate/search/cfg/ProvidedIdMapping.java
search/trunk/src/main/java/org/hibernate/search/cfg/SearchMapping.java
search/trunk/src/main/java/org/hibernate/search/cfg/TokenFilterDefMapping.java
search/trunk/src/main/java/org/hibernate/search/impl/MappingModelMetadataProvider.java
search/trunk/src/main/java/org/hibernate/search/impl/SearchFactoryImpl.java
search/trunk/src/test/java/org/hibernate/search/test/configuration/ProgrammaticMappingTest.java
Log:
HSEARCH-411 fix various issues on programmatic API
Modified: search/trunk/src/main/docbook/en-US/modules/mapping.xml
===================================================================
--- search/trunk/src/main/docbook/en-US/modules/mapping.xml 2009-11-27 16:53:33 UTC (rev 18077)
+++ search/trunk/src/main/docbook/en-US/modules/mapping.xml 2009-11-27 17:30:32 UTC (rev 18078)
@@ -1548,7 +1548,7 @@
<classname>SearchMapping</classname> object. This object is passed to
Hibernate Search via a property set to the <classname>Configuration
</classname>object. The property key is
- <literal>hibernate.search.mapping_model</literal>. </para>
+ <literal>hibernate.search.mapping_model</literal>.</para>
<programlisting>SearchMapping mapping = new SearchMapping();
[...]
@@ -1736,18 +1736,19 @@
</section>
<section>
- <title>Defining fields for indexing</title>
+ <title>Defining full text filter definitions</title>
- <para>When defining fields for indexing using the programmatic API, call
- <methodname>field()</methodname> on the <methodname>property(String
- propertyName, ElementType elementType)</methodname> method. From
- <methodname>field()</methodname> you can specify the <methodname>name,
- index</methodname>, <methodname>store</methodname>,
- <methodname>bridge</methodname> and <methodname>analyzer</methodname>
- definitions.</para>
+ <para>The programmatic API provides easy mechanism for defining full
+ text filter definitions which is available via
+ <classname>@FullTextFilterDef</classname> and
+ <classname>@FullTextFilterDefs</classname>. Note that contrary to the
+ annotation equivalent, full text filter definitions are a global
+ construct and are not tied to an entity. The next example depicts the
+ creation of full text filter definition using the
+ <methodname>fullTextFilterDef </methodname>method.</para>
<para><example>
- <title>Indexing fields using programmatic API</title>
+ <title>Defining full text definition programmatically</title>
<programlisting>SearchMapping mapping = new SearchMapping();
@@ -1755,26 +1756,30 @@
.analyzerDef( "en", StandardTokenizerFactory.class )
.filter( LowerCaseFilterFactory.class )
.filter( EnglishPorterFilterFactory.class )
- .entity(Address.class).indexed()
+ <emphasis role="bold">.fullTextFilterDef("security", SecurityFilterFactory.class)
+ .cache(FilterCacheModeType.INSTANCE_ONLY)</emphasis>
+ .entity(Address.class)
+ .indexed()
.property("addressId", ElementType.METHOD)
.documentId()
.name("id")
.property("street1", ElementType.METHOD)
- <emphasis role="bold">.field()
+ .field()
.analyzer("en")
.store(Store.YES)
- .index(Index.TOKENIZED) //no useful here as it's the default
.field()
.name("address_data")
- .analyzer("en");</emphasis>
+ .analyzer("en")
+ .store(Store.NO);
cfg.getProperties().put( "hibernate.search.mapping_model", mapping );</programlisting>
- <para>The above example of marking fields as indexable is equivalent
- to defining fields using <classname>@Field</classname> as seen
+ <para>The previous example can effectively been seen as annotating
+ your entity with <classname>@FullTextFilterDef</classname> like
below:</para>
</example><example>
- <title>Indexing fields using annotation</title>
+ <title>Using annotation to define full text filter
+ definition</title>
<programlisting>@Entity
@Indexed
@@ -1786,39 +1791,42 @@
@TokenFilterDef(factory = EnglishPorterFilterFactory.class)
})
})
+@FullTextFilterDefs({
+ @FullTextFilterDef(name = "security", impl = SecurityFilterFactory.class, cache = FilterCacheModeType.INSTANCE_ONLY)
+})
public class Address {
@Id
@GeneratedValue
@DocumentId(name="id")
- private Long getAddressId() {...};
+ pubblic Long getAddressId() {...};
@Fields({
@Field(index=Index.TOKENIZED, store=Store.YES,
analyzer=@Analyzer(definition="en")),
@Field(name="address_data", analyzer=@Analyzer(definition="en"))
})
- public String getAddress1() {...}
+ public String getAddress1() {...};
......
+
}</programlisting>
-
- <para></para>
</example></para>
</section>
<section>
- <title>Defining full text filter definitions</title>
+ <title>Defining fields for indexing</title>
- <para>The programmatic API provides easy mechanism for defining full
- text filter definitions which is available via
- <classname>@FullTextFilterDef</classname> and
- <classname>@FullTextFilterDefs</classname>. The next example depicts the
- creation of full text filter definition using the
- <methodname>fullTextFilterDef </methodname>method.</para>
+ <para>When defining fields for indexing using the programmatic API, call
+ <methodname>field()</methodname> on the <methodname>property(String
+ propertyName, ElementType elementType)</methodname> method. From
+ <methodname>field()</methodname> you can specify the <methodname>name,
+ index</methodname>, <methodname>store</methodname>,
+ <methodname>bridge</methodname> and <methodname>analyzer</methodname>
+ definitions.</para>
<para><example>
- <title>Defining full text definition programmatically</title>
+ <title>Indexing fields using programmatic API</title>
<programlisting>SearchMapping mapping = new SearchMapping();
@@ -1826,29 +1834,26 @@
.analyzerDef( "en", StandardTokenizerFactory.class )
.filter( LowerCaseFilterFactory.class )
.filter( EnglishPorterFilterFactory.class )
- .entity(Address.class)
- .indexed()
- <emphasis role="bold">.fullTextFilterDef("security", SecurityFilterFactory.class)
- .cache(FilterCacheModeType.INSTANCE_ONLY)</emphasis>
+ .entity(Address.class).indexed()
.property("addressId", ElementType.METHOD)
.documentId()
.name("id")
.property("street1", ElementType.METHOD)
- .field()
+ <emphasis role="bold">.field()
.analyzer("en")
.store(Store.YES)
+ .index(Index.TOKENIZED) //no useful here as it's the default
.field()
.name("address_data")
- .analyzer("en")
- .store(Store.NO);
+ .analyzer("en");</emphasis>
cfg.getProperties().put( "hibernate.search.mapping_model", mapping );</programlisting>
- <para>The previous example can effectively been seen as annotating
- your entity with @FullTextFilterDef like below:</para>
+ <para>The above example of marking fields as indexable is equivalent
+ to defining fields using <classname>@Field</classname> as seen
+ below:</para>
</example><example>
- <title>Using annotation to define full text filter
- definition</title>
+ <title>Indexing fields using annotation</title>
<programlisting>@Entity
@Indexed
@@ -1860,26 +1865,24 @@
@TokenFilterDef(factory = EnglishPorterFilterFactory.class)
})
})
-@FullTextFilterDefs({
- @FullTextFilterDef(name = "security", impl = SecurityFilterFactory.class, cache = FilterCacheModeType.INSTANCE_ONLY)
-})
public class Address {
@Id
@GeneratedValue
@DocumentId(name="id")
- pubblic Long getAddressId() {...};
+ private Long getAddressId() {...};
@Fields({
@Field(index=Index.TOKENIZED, store=Store.YES,
analyzer=@Analyzer(definition="en")),
@Field(name="address_data", analyzer=@Analyzer(definition="en"))
})
- public String getAddress1() {...};
+ public String getAddress1() {...}
......
-
}</programlisting>
+
+ <para></para>
</example></para>
</section>
Modified: search/trunk/src/main/java/org/hibernate/search/cfg/EntityMapping.java
===================================================================
--- search/trunk/src/main/java/org/hibernate/search/cfg/EntityMapping.java 2009-11-27 16:53:33 UTC (rev 18077)
+++ search/trunk/src/main/java/org/hibernate/search/cfg/EntityMapping.java 2009-11-27 17:30:32 UTC (rev 18078)
@@ -70,7 +70,7 @@
public FullTextFilterDefMapping fullTextFilterDef(String name, Class<?> impl) {
- return new FullTextFilterDefMapping(mapping, entity, name, impl);
+ return new FullTextFilterDefMapping(mapping,name, impl);
}
public PropertyMapping property(String name, ElementType type) {
Modified: search/trunk/src/main/java/org/hibernate/search/cfg/FullTextFilterDefMapping.java
===================================================================
--- search/trunk/src/main/java/org/hibernate/search/cfg/FullTextFilterDefMapping.java 2009-11-27 16:53:33 UTC (rev 18077)
+++ search/trunk/src/main/java/org/hibernate/search/cfg/FullTextFilterDefMapping.java 2009-11-27 17:30:32 UTC (rev 18078)
@@ -39,15 +39,13 @@
private final SearchMapping mapping;
private final Map<String,Object> fullTextFilterDef;
- private final EntityDescriptor entity;
- public FullTextFilterDefMapping(SearchMapping mapping, EntityDescriptor entity, String name, Class<?> impl) {
+ public FullTextFilterDefMapping(SearchMapping mapping, String name, Class<?> impl) {
this.mapping = mapping;
- this.entity = entity;
this.fullTextFilterDef =new HashMap<String, Object>();
this.fullTextFilterDef.put("name", name);
this.fullTextFilterDef.put("impl", impl);
- entity.addFulltextFilterDef(fullTextFilterDef);
+ mapping.addFulltextFilterDef(fullTextFilterDef);
}
/**
@@ -61,13 +59,9 @@
}
public FullTextFilterDefMapping fullTextFilterDef(String name, Class<?> impl) {
- return new FullTextFilterDefMapping(mapping,entity,name, impl);
+ return new FullTextFilterDefMapping(mapping, name, impl);
}
- public PropertyMapping property(String name, ElementType type) {
- return new PropertyMapping(name, type, entity, mapping);
- }
-
public AnalyzerDefMapping analyzerDef(String name, Class<? extends TokenizerFactory> tokenizerFactory) {
return new AnalyzerDefMapping(name, tokenizerFactory, mapping);
}
@@ -75,10 +69,4 @@
public EntityMapping entity(Class<?> entityType) {
return new EntityMapping(entityType, mapping);
}
-
- public ProvidedIdMapping providedId() {
- return new ProvidedIdMapping(mapping,entity);
- }
-
-
}
Modified: search/trunk/src/main/java/org/hibernate/search/cfg/IndexedMapping.java
===================================================================
--- search/trunk/src/main/java/org/hibernate/search/cfg/IndexedMapping.java 2009-11-27 16:53:33 UTC (rev 18077)
+++ search/trunk/src/main/java/org/hibernate/search/cfg/IndexedMapping.java 2009-11-27 17:30:32 UTC (rev 18078)
@@ -74,7 +74,7 @@
public FullTextFilterDefMapping fullTextFilterDef(String name, Class<?> impl) {
- return new FullTextFilterDefMapping(mapping, entity, name, impl);
+ return new FullTextFilterDefMapping(mapping, name, impl);
}
public PropertyMapping property(String name, ElementType type) {
Modified: search/trunk/src/main/java/org/hibernate/search/cfg/ProvidedIdMapping.java
===================================================================
--- search/trunk/src/main/java/org/hibernate/search/cfg/ProvidedIdMapping.java 2009-11-27 16:53:33 UTC (rev 18077)
+++ search/trunk/src/main/java/org/hibernate/search/cfg/ProvidedIdMapping.java 2009-11-27 17:30:32 UTC (rev 18078)
@@ -53,7 +53,7 @@
}
public FullTextFilterDefMapping fullTextFilterDef(String name, Class<?> impl) {
- return new FullTextFilterDefMapping(searchMapping, entity, name, impl);
+ return new FullTextFilterDefMapping(searchMapping, name, impl);
}
public PropertyMapping property(String name, ElementType type) {
Modified: search/trunk/src/main/java/org/hibernate/search/cfg/SearchMapping.java
===================================================================
--- search/trunk/src/main/java/org/hibernate/search/cfg/SearchMapping.java 2009-11-27 16:53:33 UTC (rev 18077)
+++ search/trunk/src/main/java/org/hibernate/search/cfg/SearchMapping.java 2009-11-27 17:30:32 UTC (rev 18078)
@@ -38,12 +38,17 @@
*/
public class SearchMapping {
private Set<Map<String, Object>> analyzerDefs = new HashSet<Map<String, Object>>();
+ private Set<Map<String, Object>> fullTextFilterDefs = new HashSet<Map<String, Object>>();
private Map<Class<?>, EntityDescriptor> entities = new HashMap<Class<?>, EntityDescriptor>();
public Set<Map<String, Object>> getAnalyzerDefs() {
return analyzerDefs;
}
+ public Set<Map<String, Object>> getFullTextFilerDefs() {
+ return fullTextFilterDefs;
+ }
+
public EntityDescriptor getEntityDescriptor(Class<?> entityType) {
return entities.get( entityType );
}
@@ -51,18 +56,23 @@
public AnalyzerDefMapping analyzerDef(String name, Class<? extends TokenizerFactory> tokenizerFactory) {
return new AnalyzerDefMapping(name, tokenizerFactory, this);
}
-
+
public EntityMapping entity(Class<?> entityType) {
return new EntityMapping(entityType, this);
}
+
+ public FullTextFilterDefMapping fullTextFilterDef(String name, Class<?> impl) {
+ return new FullTextFilterDefMapping(this, name, impl );
+ }
/**
* eg @Containing(things={@Thing(...), @Thing(...)}
* Map<String, Object> addedThing = addElementToAnnotationArray(containing, "things");
*/
+
static Map<String, Object> addElementToAnnotationArray(Map<String, Object> containingAnnotation,
String attributeName) {
- List<Map<String, Object>> array = (List<Map<String, Object>>) containingAnnotation.get( attributeName );
+ @SuppressWarnings("unchecked") List<Map<String, Object>> array = (List<Map<String, Object>>) containingAnnotation.get( attributeName );
if ( array == null) {
array = new ArrayList<Map<String, Object>>();
containingAnnotation.put( attributeName, array );
@@ -84,5 +94,9 @@
}
return entity;
}
+
+ void addFulltextFilterDef(Map<String, Object> fullTextFilterDef) {
+ fullTextFilterDefs.add(fullTextFilterDef);
+ }
}
Modified: search/trunk/src/main/java/org/hibernate/search/cfg/TokenFilterDefMapping.java
===================================================================
--- search/trunk/src/main/java/org/hibernate/search/cfg/TokenFilterDefMapping.java 2009-11-27 16:53:33 UTC (rev 18077)
+++ search/trunk/src/main/java/org/hibernate/search/cfg/TokenFilterDefMapping.java 2009-11-27 17:30:32 UTC (rev 18078)
@@ -69,4 +69,8 @@
return new AnalyzerDefMapping(name, tokenizerFactory, mapping);
}
+ public FullTextFilterDefMapping fullTextFilterDef(String name, Class<?> impl) {
+ return new FullTextFilterDefMapping(mapping, name, impl );
+ }
+
}
Modified: search/trunk/src/main/java/org/hibernate/search/impl/MappingModelMetadataProvider.java
===================================================================
--- search/trunk/src/main/java/org/hibernate/search/impl/MappingModelMetadataProvider.java 2009-11-27 16:53:33 UTC (rev 18077)
+++ search/trunk/src/main/java/org/hibernate/search/impl/MappingModelMetadataProvider.java 2009-11-27 17:30:32 UTC (rev 18078)
@@ -101,10 +101,15 @@
new HashMap<Object, Object>() :
new HashMap<Object, Object>(delegateDefaults);
defaults.put( AnalyzerDefs.class, createAnalyzerDefArray() );
+ if (!mapping.getFullTextFilerDefs().isEmpty()) {
+ defaults.put(FullTextFilterDefs.class, createFullTextFilterDefsForMapping());
+ }
}
return defaults;
}
+
+
public AnnotationReader getAnnotationReader(AnnotatedElement annotatedElement) {
AnnotationReader reader = cache.get(annotatedElement);
if (reader == null) {
@@ -124,7 +129,36 @@
return defs;
}
+ private FullTextFilterDef[] createFullTextFilterDefsForMapping() {
+ Set<Map<String, Object>> fullTextFilterDefs = mapping.getFullTextFilerDefs();
+ FullTextFilterDef[] filters = new FullTextFilterDef[fullTextFilterDefs.size()];
+ int index = 0;
+ for(Map<String,Object> filterDef : fullTextFilterDefs) {
+ filters[index] = createFullTextFilterDef(filterDef);
+ index++;
+ }
+ return filters;
+ }
+ private static FullTextFilterDef createFullTextFilterDef(Map<String,Object> filterDef) {
+ AnnotationDescriptor fullTextFilterDefAnnotation = new AnnotationDescriptor( FullTextFilterDef.class );
+ for (Entry<String, Object> entry : filterDef.entrySet()) {
+ fullTextFilterDefAnnotation.setValue(entry.getKey(), entry.getValue());
+ }
+
+ return AnnotationFactory.create( fullTextFilterDefAnnotation );
+ }
+
+ private static FullTextFilterDef[] createFullTextFilterDefArray(Set<Map<String, Object>> fullTextFilterDefs) {
+ FullTextFilterDef[] filters = new FullTextFilterDef[fullTextFilterDefs.size()];
+ int index = 0;
+ for(Map<String,Object> filterDef : fullTextFilterDefs) {
+ filters[index] = createFullTextFilterDef(filterDef);
+ index++;
+ }
+ return filters;
+ }
+
private AnalyzerDef createAnalyzerDef(Map<String, Object> analyzerDef) {
AnnotationDescriptor analyzerDefAnnotation = new AnnotationDescriptor( AnalyzerDef.class );
for ( Map.Entry<String, Object> entry : analyzerDef.entrySet() ) {
@@ -436,7 +470,7 @@
}
if (entity.getFullTextFilterDefs().size() > 0) {
AnnotationDescriptor fullTextFilterDefsAnnotation = new AnnotationDescriptor( FullTextFilterDefs.class );
- FullTextFilterDef[] fullTextFilterDefArray = createFullTextFilterDefArray(entity);
+ FullTextFilterDef[] fullTextFilterDefArray = createFullTextFilterDefArray(entity.getFullTextFilterDefs());
fullTextFilterDefsAnnotation.setValue("value", fullTextFilterDefArray);
annotations.put( FullTextFilterDefs.class, AnnotationFactory.create( fullTextFilterDefsAnnotation ) );
}
@@ -469,27 +503,6 @@
annotations.put( ProvidedId.class, AnnotationFactory.create( annotation ) );
}
-
- private FullTextFilterDef[] createFullTextFilterDefArray(EntityDescriptor entity) {
- Set<Map<String, Object>> fullTextFilterDefs = entity.getFullTextFilterDefs();
- FullTextFilterDef[] filters = new FullTextFilterDef[fullTextFilterDefs.size()];
- int index = 0;
- for(Map<String,Object> filterDef : fullTextFilterDefs) {
- filters[index] = createFullTextFilterDef(filterDef);
- index++;
- }
- return filters;
- }
-
- private FullTextFilterDef createFullTextFilterDef(Map<String,Object> filterDef) {
- AnnotationDescriptor fullTextFilterDefAnnotation = new AnnotationDescriptor( FullTextFilterDef.class );
- for (Entry<String, Object> entry : filterDef.entrySet()) {
- fullTextFilterDefAnnotation.setValue(entry.getKey(), entry.getValue());
- }
-
- return AnnotationFactory.create( fullTextFilterDefAnnotation );
- }
-
private void populateAnnotationArray() {
annotationsArray = new Annotation[ annotations.size() ];
int index = 0;
Modified: search/trunk/src/main/java/org/hibernate/search/impl/SearchFactoryImpl.java
===================================================================
--- search/trunk/src/main/java/org/hibernate/search/impl/SearchFactoryImpl.java 2009-11-27 16:53:33 UTC (rev 18077)
+++ search/trunk/src/main/java/org/hibernate/search/impl/SearchFactoryImpl.java 2009-11-27 17:30:32 UTC (rev 18078)
@@ -281,6 +281,20 @@
}
}
}
+
+
+ private void initProgrammaticallyDefinedFilterDef(ReflectionManager reflectionManager) {
+ @SuppressWarnings("unchecked") Map defaults = reflectionManager.getDefaults();
+ FullTextFilterDef[] filterDefs = (FullTextFilterDef[]) defaults.get(FullTextFilterDefs.class);
+ if (filterDefs != null && filterDefs.length != 0) {
+ for (FullTextFilterDef defAnn : filterDefs) {
+ if ( filterDefinitions.containsKey( defAnn.name() ) ) {
+ throw new SearchException("Multiple definition of @FullTextFilterDef.name=" + defAnn.name());
+ }
+ bindFullTextFilterDef(defAnn);
+ }
+ }
+ }
private void bindFilterDef(FullTextFilterDef defAnn, XClass mappedXClass) {
if ( filterDefinitions.containsKey( defAnn.name() ) ) {
@@ -290,6 +304,10 @@
);
}
+ bindFullTextFilterDef(defAnn);
+ }
+
+ private void bindFullTextFilterDef(FullTextFilterDef defAnn) {
FilterDef filterDef = new FilterDef( defAnn );
if ( filterDef.getImpl().equals( ShardSensitiveOnlyFilter.class ) ) {
//this is a placeholder don't process regularly
@@ -463,6 +481,7 @@
DirectoryProviderFactory factory = new DirectoryProviderFactory();
initProgrammaticAnalyzers(context, reflectionManager);
+ initProgrammaticallyDefinedFilterDef(reflectionManager);
while ( iter.hasNext() ) {
Class mappedClass = iter.next();
Modified: search/trunk/src/test/java/org/hibernate/search/test/configuration/ProgrammaticMappingTest.java
===================================================================
--- search/trunk/src/test/java/org/hibernate/search/test/configuration/ProgrammaticMappingTest.java 2009-11-27 16:53:33 UTC (rev 18077)
+++ search/trunk/src/test/java/org/hibernate/search/test/configuration/ProgrammaticMappingTest.java 2009-11-27 17:30:32 UTC (rev 18078)
@@ -44,7 +44,6 @@
import org.apache.solr.analysis.NGramFilterFactory;
import org.apache.solr.analysis.SnowballPorterFilterFactory;
import org.apache.solr.analysis.StandardTokenizerFactory;
-import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.cfg.Configuration;
import org.hibernate.search.FullTextQuery;
@@ -54,12 +53,16 @@
import org.hibernate.search.annotations.Index;
import org.hibernate.search.annotations.Resolution;
import org.hibernate.search.annotations.Store;
+import org.hibernate.search.backend.Work;
+import org.hibernate.search.backend.WorkType;
import org.hibernate.search.bridge.builtin.LongBridge;
import org.hibernate.search.cfg.ConcatStringBridge;
import org.hibernate.search.cfg.SearchMapping;
+import org.hibernate.search.engine.SearchFactoryImplementor;
import org.hibernate.search.store.DirectoryProvider;
import org.hibernate.search.test.SearchTestCase;
import org.hibernate.search.test.analyzer.inheritance.ISOLatin1Analyzer;
+import org.hibernate.search.test.id.providedId.ManualTransactionContext;
/**
* @author Emmanuel Bernard
@@ -320,6 +323,9 @@
public void testProvidedIdMapping() throws Exception{
+ FullTextSession fullTextSession = Search.getFullTextSession( openSession() );
+ SearchFactoryImplementor sf = (SearchFactoryImplementor) fullTextSession.getSearchFactory();
+
ProvidedIdEntry person1 = new ProvidedIdEntry();
person1.setName( "Big Goat" );
person1.setBlurb( "Eats grass" );
@@ -332,17 +338,18 @@
person3.setName( "Regular goat" );
person3.setBlurb( "Is anorexic" );
- Session session = openSession();
- FullTextSession fullTextSession = Search.getFullTextSession( session );
- Transaction transaction = session.beginTransaction();
- session.persist( person1 );
- session.persist( person2 );
- session.persist( person3 );
+ ManualTransactionContext tc = new ManualTransactionContext();
- transaction.commit();
- session.clear();
+ Work<ProvidedIdEntry> work = new Work<ProvidedIdEntry>( person1, 1, WorkType.INDEX );
+ sf.getWorker().performWork( work, tc );
+ work = new Work<ProvidedIdEntry>( person2, 2, WorkType.INDEX );
+ sf.getWorker().performWork( work, tc );
+ Work<ProvidedIdEntry> work2 = new Work<ProvidedIdEntry>( person3, 3, WorkType.INDEX );
+ sf.getWorker().performWork( work2, tc );
- transaction = fullTextSession.beginTransaction();
+ tc.end();
+
+ Transaction transaction = fullTextSession.beginTransaction();
QueryParser parser = new QueryParser( "providedidentry.name", new StandardAnalyzer() );
Query luceneQuery = parser.parse( "Goat" );
@@ -364,7 +371,7 @@
- public void testFullTextFilterDef() throws Exception{
+ public void testFullTextFilterDefAtMappingLevel() throws Exception{
FullTextSession s = Search.getFullTextSession( openSession() );
Transaction tx = s.beginTransaction();
@@ -408,7 +415,6 @@
s.close();
}
-
public void testIndexEmbedded() throws Exception{
FullTextSession s = Search.getFullTextSession( openSession() );
Transaction tx = s.beginTransaction();
@@ -514,7 +520,8 @@
//cfg.setProperty( "hibernate.search.default.directory_provider", FSDirectoryProvider.class.getName() );
SearchMapping mapping = new SearchMapping();
- mapping.analyzerDef( "ngram", StandardTokenizerFactory.class )
+ mapping.fullTextFilterDef("security", SecurityFilterFactory.class).cache(FilterCacheModeType.INSTANCE_ONLY)
+ .analyzerDef( "ngram", StandardTokenizerFactory.class )
.filter( LowerCaseFilterFactory.class )
.filter( NGramFilterFactory.class )
.param( "minGramSize", "3" )
@@ -525,10 +532,10 @@
.analyzerDef( "de", StandardTokenizerFactory.class )
.filter( LowerCaseFilterFactory.class )
.filter( GermanStemFilterFactory.class )
- .entity( Address.class ).indexed()
+ .entity( Address.class )
+ .indexed()
.similarity( DefaultSimilarity.class )
.boost( 2 )
- .fullTextFilterDef("security", SecurityFilterFactory.class).cache(FilterCacheModeType.INSTANCE_ONLY)
.property( "addressId", ElementType.FIELD ).documentId().name( "id" )
.property("lastUpdated", ElementType.FIELD)
.field().name("last-updated")
15 years, 2 months
Hibernate SVN: r18077 - in core/trunk/cache-infinispan: src/test/java/org/hibernate/test/cache/infinispan/functional and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: galder.zamarreno(a)jboss.com
Date: 2009-11-27 11:53:33 -0500 (Fri, 27 Nov 2009)
New Revision: 18077
Modified:
core/trunk/cache-infinispan/pom.xml
core/trunk/cache-infinispan/src/test/java/org/hibernate/test/cache/infinispan/functional/ConcurrentWriteTest.java
Log:
[ISPN-277] (LRU data container endlesly looping or exhibiting heavy contention) Update to trunk and check if testManyUsers runs fine now.
Modified: core/trunk/cache-infinispan/pom.xml
===================================================================
--- core/trunk/cache-infinispan/pom.xml 2009-11-27 16:51:42 UTC (rev 18076)
+++ core/trunk/cache-infinispan/pom.xml 2009-11-27 16:53:33 UTC (rev 18077)
@@ -17,7 +17,7 @@
<description>Integration of Hibernate with Infinispan</description>
<properties>
- <version.infinispan>4.0.0.CR2</version.infinispan>
+ <version.infinispan>4.0.0-SNAPSHOT</version.infinispan>
<version.hsqldb>1.8.0.2</version.hsqldb>
<version.cglib>2.2</version.cglib>
<version.javassist>3.4.GA</version.javassist>
Modified: core/trunk/cache-infinispan/src/test/java/org/hibernate/test/cache/infinispan/functional/ConcurrentWriteTest.java
===================================================================
--- core/trunk/cache-infinispan/src/test/java/org/hibernate/test/cache/infinispan/functional/ConcurrentWriteTest.java 2009-11-27 16:51:42 UTC (rev 18076)
+++ core/trunk/cache-infinispan/src/test/java/org/hibernate/test/cache/infinispan/functional/ConcurrentWriteTest.java 2009-11-27 16:53:33 UTC (rev 18077)
@@ -189,40 +189,40 @@
}
-// /**
-// * TODO: This will fail until ISPN-??? has been fixed.
-// *
-// * @throws Exception
-// */
-// public void testManyUsers() throws Throwable {
-// try {
-// // setup - create users
-// for (int i = 0; i < USER_COUNT; i++) {
-// Customer customer = createCustomer(0);
-// getCustomerIDs().add(customer.getId());
-// }
-// assertEquals("failed to create enough Customers", USER_COUNT, getCustomerIDs().size());
-//
-// final ExecutorService executor = Executors.newFixedThreadPool(USER_COUNT);
-//
-// CyclicBarrier barrier = new CyclicBarrier(USER_COUNT + 1);
-// List<Future<Void>> futures = new ArrayList<Future<Void>>(USER_COUNT);
-// for (Integer customerId : getCustomerIDs()) {
-// Future<Void> future = executor.submit(new UserRunner(customerId, barrier));
-// futures.add(future);
-// Thread.sleep(LAUNCH_INTERVAL_MILLIS); // rampup
-// }
-//// barrier.await(); // wait for all threads to be ready
-// barrier.await(45, TimeUnit.SECONDS); // wait for all threads to finish
-// log.info("All threads finished, let's shutdown the executor and check whether any exceptions were reported");
-// for (Future<Void> future : futures) future.get();
-// log.info("All future gets checked");
-// } catch (Throwable t) {
-// log.error("Error running test", t);
-// throw t;
-// }
-// }
+ /**
+ * TODO: This will fail until ISPN-??? has been fixed.
+ *
+ * @throws Exception
+ */
+ public void testManyUsers() throws Throwable {
+ try {
+ // setup - create users
+ for (int i = 0; i < USER_COUNT; i++) {
+ Customer customer = createCustomer(0);
+ getCustomerIDs().add(customer.getId());
+ }
+ assertEquals("failed to create enough Customers", USER_COUNT, getCustomerIDs().size());
+ final ExecutorService executor = Executors.newFixedThreadPool(USER_COUNT);
+
+ CyclicBarrier barrier = new CyclicBarrier(USER_COUNT + 1);
+ List<Future<Void>> futures = new ArrayList<Future<Void>>(USER_COUNT);
+ for (Integer customerId : getCustomerIDs()) {
+ Future<Void> future = executor.submit(new UserRunner(customerId, barrier));
+ futures.add(future);
+ Thread.sleep(LAUNCH_INTERVAL_MILLIS); // rampup
+ }
+// barrier.await(); // wait for all threads to be ready
+ barrier.await(45, TimeUnit.SECONDS); // wait for all threads to finish
+ log.info("All threads finished, let's shutdown the executor and check whether any exceptions were reported");
+ for (Future<Void> future : futures) future.get();
+ log.info("All future gets checked");
+ } catch (Throwable t) {
+ log.error("Error running test", t);
+ throw t;
+ }
+ }
+
public void cleanup() throws Exception {
getCustomerIDs().clear();
String deleteContactHQL = "delete from Contact";
15 years, 2 months
Hibernate SVN: r18076 - search/trunk/src/main/docbook/en-US/modules.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2009-11-27 11:51:42 -0500 (Fri, 27 Nov 2009)
New Revision: 18076
Modified:
search/trunk/src/main/docbook/en-US/modules/mapping.xml
Log:
HSEARCH-410 Write documentation for what's available of the programmatic mapping API (Amin Mohammed-Coleman)
Modified: search/trunk/src/main/docbook/en-US/modules/mapping.xml
===================================================================
--- search/trunk/src/main/docbook/en-US/modules/mapping.xml 2009-11-27 16:44:34 UTC (rev 18075)
+++ search/trunk/src/main/docbook/en-US/modules/mapping.xml 2009-11-27 16:51:42 UTC (rev 18076)
@@ -1507,4 +1507,648 @@
</example>
</section>
</section>
-</chapter>
+
+ <section>
+ <title>Programmatic API</title>
+
+ <para><warning>
+ <para>This feature is considered experimental. While stable code-wise,
+ the API is subject to change in the future.</para>
+ </warning>Although the recommended approach for mapping indexed entities
+ is to use annotations, it is sometimes more convenient to use a different
+ approach:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>the same entity is mapped differently depending on deployment
+ needs (customization for clients)</para>
+ </listitem>
+
+ <listitem>
+ <para>some automatization process requires the dynamic mapping of many
+ entities sharing a common traits</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>While it has been a popular demand in the past, the Hibernate team
+ never found the idea of an XML alternative to annotations appealing due to
+ it's heavy duplication, lack of code refactoring safety, because it did
+ not cover all the use case spectrum and because we are in the 21st century
+ :)</para>
+
+ <para>Th idea of a programmatic API was much more appealing and has now
+ become a reality. You can programmatically and safely define your mapping
+ using a programmatic API: you define entities and fields as indexable by
+ using mapping classes which effectively mirror the annotation concepts in
+ Hibernate Search. Note that fan(s) of XML approach can design their own
+ schema and use the programmatic API to create the mapping while parsing
+ the XML stream.</para>
+
+ <para>In order to use the programmatic model you must first construct a
+ <classname>SearchMapping</classname> object. This object is passed to
+ Hibernate Search via a property set to the <classname>Configuration
+ </classname>object. The property key is
+ <literal>hibernate.search.mapping_model</literal>. </para>
+
+ <programlisting>SearchMapping mapping = new SearchMapping();
+[...]
+configuration.setProperty( "hibernate.search.mapping_model", mapping );
+
+//or in JPA
+SearchMapping mapping = new SearchMapping();
+[...]
+Map<String,String> properties = new HashMap<String,String)(1);
+properties.put( "hibernate.search.mapping_model", mapping );
+EntityManagerFactory emf = Persistence.createEntityManagerFactory( "userPU", properties );</programlisting>
+
+ <para>The <classname>SearchMapping</classname> is the root object which
+ contains all the necessary indexable entities and fields. From there, the
+ <classname>SearchMapping</classname> object exposes a fluent (and thus
+ intuitive) API to express your mappings: it contextually exposes the
+ relevant mapping options in a type-safe way, just let your IDE
+ autocompletion feature guide you through.</para>
+
+ <para>Today, the programmatic API cannot be used on a class annotated with
+ Hibernate Search annotations, chose one approach or the other. Also note
+ that the same default values apply in annotations and the programmatic
+ API. For example, the <methodname>@Field.name</methodname> is defaulted to
+ the property name and does not have to be set.</para>
+
+ <para>Each core concept of the programmatic API has a corresponding
+ example to depict how the same definition would look using annotation.
+ Therefore seeing an annotation example of the programmatic approach should
+ give you a clear picture of what Hibernate Search will build with the
+ marked entities and associated properties.</para>
+
+ <section>
+ <title>Mapping an entity as indexable</title>
+
+ <para>The first concept of the programmatic API is to define an entity
+ as indexable. Using the annotation approach a user would mark the entity
+ as <classname>@Indexed</classname>, the following example demonstrates
+ how to programmatically achieve this.</para>
+
+ <para><example>
+ <title>Marking an entity indexable</title>
+
+ <programlisting>SearchMapping mapping = new SearchMapping();
+
+mapping.entity(Address.class)
+ .indexed()
+ .indexName("Address_Index"); //optional
+
+cfg.getProperties().put( "hibernate.search.mapping_model", mapping );</programlisting>
+
+ <para>As you can see you must first create a
+ <classname>SearchMapping</classname> object which is the root object
+ that is then passed to the <classname>Configuration</classname>
+ object as property. You must declare an entity and if you wish to
+ make that entity as indexable then you must call the
+ <methodname>indexed()</methodname> method. The <methodname>indexed()
+ </methodname>method has an optional <methodname>indexName(String
+ indexName)</methodname> which can be used to change the default
+ index name that is created by Hibernate Search. Using the annotation
+ model the above can be achieved as:</para>
+
+ <para><example>
+ <title>Annotation example of indexing entity</title>
+
+ <programlisting>@Entity
+@Indexed(index="Address_Index")
+public class Address {
+....
+}</programlisting>
+ </example></para>
+ </example></para>
+ </section>
+
+ <section>
+ <title>Adding DocumentId to indexed entity</title>
+
+ <para>To set a property as a document id:</para>
+
+ <para><example>
+ <title>Enabling document id with programmatic model</title>
+
+ <programlisting>SearchMapping mapping = new SearchMapping();
+
+mapping.entity(Address.class).indexed()
+ .property("addressId", ElementType.FIELD) //field access
+ .documentId()
+ .name("id");
+
+cfg.getProperties().put( "hibernate.search.mapping_model", mapping);</programlisting>
+
+ <para>The above is equivalent to annotating a property in the entity
+ as <classname>@DocumentId</classname> as seen in the following
+ example:</para>
+
+ <para><example>
+ <title>DocumentId annotation definition</title>
+
+ <programlisting>@Entity
+@Indexed
+public class Address {
+ @Id
+ @GeneratedValue
+ @DocumentId(name="id")
+ private Long addressId;
+
+ ....
+}</programlisting>
+ </example></para>
+ </example>The next section demonstrates how to programmatically define
+ analyzers.</para>
+ </section>
+
+ <section>
+ <title>Defining analyzers</title>
+
+ <para>Analyzers can be programmatically defined using the
+ <methodname>analyzerDef(String analyzerDef, Class<? extends
+ TokenizerFactory> tokenizerFactory) </methodname>method. This method
+ also enables you to define filters for the analyzer definition. Each
+ filter that you define can optionally take in parameters as seen in the
+ following example :</para>
+
+ <para><example>
+ <title>Defining analyzers using programmatic model</title>
+
+ <programlisting>SearchMapping mapping = new SearchMapping();
+
+mapping
+ <emphasis role="bold">.analyzerDef( "ngram", StandardTokenizerFactory.class )
+ .filter( LowerCaseFilterFactory.class )
+ .filter( NGramFilterFactory.class )
+ .param( "minGramSize", "3" )
+ .param( "maxGramSize", "3" )
+ .analyzerDef( "en", StandardTokenizerFactory.class )
+ .filter( LowerCaseFilterFactory.class )
+ .filter( EnglishPorterFilterFactory.class )
+ .analyzerDef( "de", StandardTokenizerFactory.class )
+ .filter( LowerCaseFilterFactory.class )
+ .filter( GermanStemFilterFactory.class )</emphasis>
+ .entity(Address.class).indexed()
+ .property("addressId", ElementType.METHOD) //getter access
+ .documentId()
+ .name("id");
+
+cfg.getProperties().put( "hibernate.search.mapping_model", mapping );</programlisting>
+
+ <para>The analyzer mapping defined above is equivalent to the
+ annotation model using <classname>@AnalyzerDef</classname> in
+ conjunction with <classname>@AnalyzerDefs</classname>:</para>
+ </example><example>
+ <title>Analyzer definition using annotation</title>
+
+ <programlisting>@Indexed
+@Entity
+@AnalyzerDefs({
+ @AnalyzerDef(name = "ngram",
+ tokenizer = @TokenizerDef(factory = StandardTokenizerFactory.class),
+ filters = {
+ @TokenFilterDef(factory = LowerCaseFilterFactory.class),
+ @TokenFilterDef(factory = NGramFilterFactory.class,
+ params = {
+ @Parameter(name = "minGramSize",value = "3"),
+ @Parameter(name = "maxGramSize",value = "3")
+ })
+ }),
+ @AnalyzerDef(name = "en",
+ tokenizer = @TokenizerDef(factory = StandardTokenizerFactory.class),
+ filters = {
+ @TokenFilterDef(factory = LowerCaseFilterFactory.class),
+ @TokenFilterDef(factory = EnglishPorterFilterFactory.class)
+ }),
+
+ @AnalyzerDef(name = "de",
+ tokenizer = @TokenizerDef(factory = StandardTokenizerFactory.class),
+ filters = {
+ @TokenFilterDef(factory = LowerCaseFilterFactory.class),
+ @TokenFilterDef(factory = GermanStemFilterFactory.class)
+ })
+
+})
+public class Address {
+...
+}</programlisting>
+ </example></para>
+ </section>
+
+ <section>
+ <title>Defining fields for indexing</title>
+
+ <para>When defining fields for indexing using the programmatic API, call
+ <methodname>field()</methodname> on the <methodname>property(String
+ propertyName, ElementType elementType)</methodname> method. From
+ <methodname>field()</methodname> you can specify the <methodname>name,
+ index</methodname>, <methodname>store</methodname>,
+ <methodname>bridge</methodname> and <methodname>analyzer</methodname>
+ definitions.</para>
+
+ <para><example>
+ <title>Indexing fields using programmatic API</title>
+
+ <programlisting>SearchMapping mapping = new SearchMapping();
+
+mapping
+ .analyzerDef( "en", StandardTokenizerFactory.class )
+ .filter( LowerCaseFilterFactory.class )
+ .filter( EnglishPorterFilterFactory.class )
+ .entity(Address.class).indexed()
+ .property("addressId", ElementType.METHOD)
+ .documentId()
+ .name("id")
+ .property("street1", ElementType.METHOD)
+ <emphasis role="bold">.field()
+ .analyzer("en")
+ .store(Store.YES)
+ .index(Index.TOKENIZED) //no useful here as it's the default
+ .field()
+ .name("address_data")
+ .analyzer("en");</emphasis>
+
+cfg.getProperties().put( "hibernate.search.mapping_model", mapping );</programlisting>
+
+ <para>The above example of marking fields as indexable is equivalent
+ to defining fields using <classname>@Field</classname> as seen
+ below:</para>
+ </example><example>
+ <title>Indexing fields using annotation</title>
+
+ <programlisting>@Entity
+@Indexed
+@AnalyzerDefs({
+ @AnalyzerDef(name = "en",
+ tokenizer = @TokenizerDef(factory = StandardTokenizerFactory.class),
+ filters = {
+ @TokenFilterDef(factory = LowerCaseFilterFactory.class),
+ @TokenFilterDef(factory = EnglishPorterFilterFactory.class)
+ })
+})
+public class Address {
+
+ @Id
+ @GeneratedValue
+ @DocumentId(name="id")
+ private Long getAddressId() {...};
+
+ @Fields({
+ @Field(index=Index.TOKENIZED, store=Store.YES,
+ analyzer=@Analyzer(definition="en")),
+ @Field(name="address_data", analyzer=@Analyzer(definition="en"))
+ })
+ public String getAddress1() {...}
+
+ ......
+}</programlisting>
+
+ <para></para>
+ </example></para>
+ </section>
+
+ <section>
+ <title>Defining full text filter definitions</title>
+
+ <para>The programmatic API provides easy mechanism for defining full
+ text filter definitions which is available via
+ <classname>@FullTextFilterDef</classname> and
+ <classname>@FullTextFilterDefs</classname>. The next example depicts the
+ creation of full text filter definition using the
+ <methodname>fullTextFilterDef </methodname>method.</para>
+
+ <para><example>
+ <title>Defining full text definition programmatically</title>
+
+ <programlisting>SearchMapping mapping = new SearchMapping();
+
+mapping
+ .analyzerDef( "en", StandardTokenizerFactory.class )
+ .filter( LowerCaseFilterFactory.class )
+ .filter( EnglishPorterFilterFactory.class )
+ .entity(Address.class)
+ .indexed()
+ <emphasis role="bold">.fullTextFilterDef("security", SecurityFilterFactory.class)
+ .cache(FilterCacheModeType.INSTANCE_ONLY)</emphasis>
+ .property("addressId", ElementType.METHOD)
+ .documentId()
+ .name("id")
+ .property("street1", ElementType.METHOD)
+ .field()
+ .analyzer("en")
+ .store(Store.YES)
+ .field()
+ .name("address_data")
+ .analyzer("en")
+ .store(Store.NO);
+
+cfg.getProperties().put( "hibernate.search.mapping_model", mapping );</programlisting>
+
+ <para>The previous example can effectively been seen as annotating
+ your entity with @FullTextFilterDef like below:</para>
+ </example><example>
+ <title>Using annotation to define full text filter
+ definition</title>
+
+ <programlisting>@Entity
+@Indexed
+@AnalyzerDefs({
+ @AnalyzerDef(name = "en",
+ tokenizer = @TokenizerDef(factory = StandardTokenizerFactory.class),
+ filters = {
+ @TokenFilterDef(factory = LowerCaseFilterFactory.class),
+ @TokenFilterDef(factory = EnglishPorterFilterFactory.class)
+ })
+})
+@FullTextFilterDefs({
+ @FullTextFilterDef(name = "security", impl = SecurityFilterFactory.class, cache = FilterCacheModeType.INSTANCE_ONLY)
+})
+public class Address {
+
+ @Id
+ @GeneratedValue
+ @DocumentId(name="id")
+ pubblic Long getAddressId() {...};
+
+ @Fields({
+ @Field(index=Index.TOKENIZED, store=Store.YES,
+ analyzer=@Analyzer(definition="en")),
+ @Field(name="address_data", analyzer=@Analyzer(definition="en"))
+ })
+ public String getAddress1() {...};
+
+ ......
+
+}</programlisting>
+ </example></para>
+ </section>
+
+ <section>
+ <title>Programmatically defining embedded entities</title>
+
+ <para>In this section you will see how to programmatically define
+ entities to be embedded into the indexed entity similar to using the
+ <classname>@IndexEmbedded</classname> model. In order to define this you
+ must mark the property as <methodname>indexEmbedded. </methodname>The is
+ the option to add a prefix to the embedded entity definition and this
+ can be done by calling <methodname>prefix</methodname> as seen in the
+ example below:</para>
+
+ <para><example>
+ <title>Programmatically defining embedded entites</title>
+
+ <programlisting>SearchMapping mapping = new SearchMapping();
+
+mappping
+ .entity(ProductCatalog.class)
+ .indexed()
+ .property("catalogId", ElementType.METHOD)
+ .documentId()
+ .name("id")
+ .property("title", ElementType.METHOD)
+ .field()
+ .index(Index.TOKENIZED)
+ .store(Store.NO)
+ .property("description", ElementType.METHOD)
+ .field()
+ .index(Index.TOKENIZED)
+ .store(Store.NO)
+ .property("items", ElementType.METHOD)
+ <emphasis role="bold">.indexEmbedded()
+ .prefix("catalog.items"); //optional</emphasis>
+
+cfg.getProperties().put( "hibernate.search.mapping_model", mapping );</programlisting>
+
+ <para>The next example shows the same definition using annotation
+ (<classname>@IndexEmbedded</classname>):</para>
+ </example><example>
+ <title>Using @IndexEmbedded</title>
+
+ <programlisting>@Entity
+@Indexed
+public class ProductCatalog {
+ @Id
+ @GeneratedValue
+ @DocumentId(name="id")
+ public Long getCatalogId() {...}
+
+ @Field(store=Store.NO, index=Index.TOKENIZED)
+ public String getTitle() {...}
+
+ @Field(store=Store.NO, index=Index.TOKENIZED)
+ public String getDescription();
+
+ @OneToMany(fetch = FetchType.LAZY)
+ @IndexColumn(name = "list_position")
+ @Cascade(org.hibernate.annotations.CascadeType.ALL)
+ @IndexEmbedded(prefix="catalog.items")
+ public List<Item> getItems() {...}
+
+ ...
+
+}</programlisting>
+ </example></para>
+ </section>
+
+ <section>
+ <title>Contained In definition</title>
+
+ <para><classname>@ContainedIn</classname> can be define as seen in the
+ example below:<example>
+ <title>Programmatically defining ContainedIn</title>
+
+ <programlisting>SearchMapping mapping = new SearchMapping();
+
+mappping
+ .entity(ProductCatalog.class)
+ .indexed()
+ .property("catalogId", ElementType.METHOD)
+ .documentId()
+ .property("title", ElementType.METHOD)
+ .field()
+ .property("description", ElementType.METHOD)
+ .field()
+ .property("items", ElementType.METHOD)
+ .indexEmbedded()
+
+ .entity(Item.class)
+ .property("description", ElementType.METHOD)
+ .field()
+ .property("productCatalog", ElementType.METHOD)
+ <emphasis role="bold">.containedIn()</emphasis>;
+
+cfg.getProperties().put( "hibernate.search.mapping_model", mapping );</programlisting>
+
+ <para>This is equivalent to defining
+ <classname>@ContainedIn</classname> in your entity:</para>
+
+ <para><example>
+ <title>Annotation approach for ContainedIn</title>
+
+ <programlisting>@Entity
+@Indexed
+public class ProductCatalog {
+
+ @Id
+ @GeneratedValue
+ @DocumentId
+ public Long getCatalogId() {...}
+
+ @Field
+ public String getTitle() {...}
+
+ @Field
+ public String getDescription() {...}
+
+ @OneToMany(fetch = FetchType.LAZY)
+ @IndexColumn(name = "list_position")
+ @Cascade(org.hibernate.annotations.CascadeType.ALL)
+ @IndexEmbedded
+ private List<Item> getItems() {...}
+
+ ...
+
+}
+
+
+@Entity
+public class Item {
+
+ @Id
+ @GeneratedValue
+ private Long itemId;
+
+ @Field
+ public String getDescription() {...}
+
+ @ManyToOne( cascade = { CascadeType.PERSIST, CascadeType.REMOVE } )
+ @ContainedIn
+ public ProductCatalog getProductCatalog() {...}
+
+ ...
+}</programlisting>
+ </example></para>
+ </example></para>
+ </section>
+
+ <section>
+ <title>Date/Calendar Bridge</title>
+
+ <para>In order to define a calendar or date bridge mapping, call the
+ <methodname>dateBridge(Resolution resolution) </methodname>or
+ <methodname>calendarBridge(Resolution resolution)</methodname> methods
+ after you have defined a <methodname>field()</methodname> in the
+ <classname>SearchMapping </classname>hierarchy.</para>
+
+ <para><example>
+ <title>Programmatic model for defining calendar/date bridge</title>
+
+ <programlisting>SearchMapping mapping = new SearchMapping();
+
+mapping
+ .entity(Address.class)
+ .indexed()
+ .property("addressId", ElementType.FIELD)
+ .documentId()
+ .property("street1", ElementType.FIELD()
+ .field()
+ .property("createdOn", ElementType.FIELD)
+ .field()
+ <emphasis role="bold">.dateBridge(Resolution.DAY)</emphasis>
+ .property("lastUpdated", ElementType.FIELD)
+ <emphasis role="bold">.calendarBridge(Resolution.DAY)</emphasis>;
+
+cfg.getProperties().put( "hibernate.search.mapping_model", mapping );</programlisting>
+
+ <para>See below for defining the above using
+ <classname>@CalendarBridge</classname> and
+ <classname>@DateBridge</classname>:</para>
+ </example><example>
+ <title>@CalendarBridge and @DateBridge definition</title>
+
+ <programlisting>@Entity
+@Indexed
+public class Address {
+
+ @Id
+ @GeneratedValue
+ @DocumentId
+ private Long addressId;
+
+ @Field
+ private String address1;
+
+ @Field
+ @DateBridge(resolution=Resolution.DAY)
+ private Date createdOn;
+
+ @CalendarBridge(resolution=Resolution.DAY)
+ private Calendar lastUpdated;
+
+ ...
+}</programlisting>
+ </example></para>
+ </section>
+
+ <section>
+ <title>Defining bridges</title>
+
+ <para>It is possible to associate bridges to programmatically defined
+ fields. When you define a <methodname>field()</methodname>
+ programmatically you can use the <methodname>bridge(Class<?>
+ impl)</methodname> to associate a <classname>FieldBridge
+ </classname>implementation class. The bridge method also provides
+ optional methods to include any parameters required for the bridge
+ class. The below shows an example of programmatically defining a
+ bridge:</para>
+
+ <para><example>
+ <title>Defining field bridges programmatically</title>
+
+ <programlisting>SearchMapping mapping = new SearchMapping();
+
+mapping
+ .entity(Address.class)
+ .indexed()
+ .property("addressId", ElementType.FIELD)
+ .documentId()
+ .property("street1", ElementType.FIELD)
+ .field()
+ .field()
+ .name("street1_abridged")
+ <emphasis role="bold">.bridge( ConcatStringBridge.class )
+ .param( "size", "4" )</emphasis>;
+
+cfg.getProperties().put( "hibernate.search.mapping_model", mapping );</programlisting>
+
+ <para>The above can equally be defined using annotations, as seen in
+ the next example.</para>
+
+ <para><example>
+ <title>Defining field bridges using annotation</title>
+
+ <programlisting>@Entity
+@Indexed
+
+public class Address {
+
+ @Id
+ @GeneratedValue
+ @DocumentId(name="id")
+ private Long addressId;
+
+ @Fields({
+ @Field,
+ @Field(name="street1_abridged",
+ bridge= @FieldBridge(impl = ConcatStringBridge.class,
+ params = @Parameter( name="size", value="4" ))
+ })
+ private String address1;
+
+ ...
+}</programlisting>
+ </example></para>
+ </example></para>
+ </section>
+ </section>
+</chapter>
\ No newline at end of file
15 years, 2 months