jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clomb...@apache.org
Subject svn commit: r544959 - in /jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping: ./ src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/ src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/ src/main/ja...
Date Wed, 06 Jun 2007 21:23:03 GMT
Author: clombart
Date: Wed Jun  6 14:23:01 2007
New Revision: 544959

URL: http://svn.apache.org/viewvc?view=rev&rev=544959
Log:

* Review the interface AtomicTypeConverter : rename the method getString into getXPathQueryValue.
This method is mainly used by FiterImpl in order to build Xpath query expression based on
the object attribute. 
* Solve issue JCR-930 : now dates are not converted in long if UtilDateConverterImpl is used.


Added:
    jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/Date2LongTypeConverterImpl.java
Modified:
    jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/.classpath
    jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/.project
    jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/AtomicTypeConverter.java
    jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/BinaryTypeConverterImpl.java
    jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/BooleanTypeConverterImpl.java
    jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/ByteArrayTypeConverterImpl.java
    jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/CalendarTypeConverterImpl.java
    jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/DoubleTypeConverterImpl.java
    jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/IntTypeConverterImpl.java
    jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/LongTypeConverterImpl.java
    jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/NameTypeConverterImpl.java
    jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/NullTypeConverterImpl.java
    jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/PathTypeConverterImpl.java
    jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/ReferenceTypeConverterImpl.java
    jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/StringTypeConverterImpl.java
    jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/TimestampTypeConverterImpl.java
    jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/UndefinedTypeConverterImpl.java
    jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/UtilDateTypeConverterImpl.java
    jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/impl/PersistenceManagerImpl.java
    jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/query/impl/FilterImpl.java
    jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/query/impl/QueryManagerImpl.java
    jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/persistence/atomic/Int2BooleanTypeConverterImpl.java
    jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/persistence/query/PersistenceManagerAtomicQueryTest.java
    jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/xdocs/navigation.xml

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/.classpath
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/.classpath?view=diff&rev=544959&r1=544958&r2=544959
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/.classpath (original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/.classpath Wed Jun  6 14:23:01
2007
@@ -1,46 +1,32 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
 <classpath>
-  <classpathentry excluding="" kind="src" path="src/java">
-  </classpathentry>
-  <classpathentry output="target/test-classes" kind="src" path="src/test">
-  </classpathentry>
-  <classpathentry kind="var" path="MAVEN_REPO/junit/jars/junit-3.8.1.jar">
-  </classpathentry>
-  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
-  </classpathentry>
-  <classpathentry kind="var" path="MAVEN_REPO/org.apache.jackrabbit/jars/jackrabbit-core-1.0.jar">
-  </classpathentry>
-  <classpathentry kind="var" path="MAVEN_REPO/org.slf4j/jars/slf4j-log4j12-1.0.jar">
-  </classpathentry>
-  <classpathentry kind="var" path="MAVEN_REPO/concurrent/jars/concurrent-1.3.4.jar">
-  </classpathentry>
-  <classpathentry kind="var" path="MAVEN_REPO/commons-collections/jars/commons-collections-3.1.jar">
-  </classpathentry>
-  <classpathentry kind="var" path="MAVEN_REPO/geronimo-spec/jars/geronimo-spec-jta-1.0-M1.jar">
-  </classpathentry>
-  <classpathentry kind="var" path="MAVEN_REPO/jsr170/jars/jcr-1.0.jar">
-  </classpathentry>
-  <classpathentry kind="var" path="MAVEN_REPO/log4j/jars/log4j-1.2.8.jar">
-  </classpathentry>
-  <classpathentry kind="var" path="MAVEN_REPO/lucene/jars/lucene-1.4.3.jar">
-  </classpathentry>
-  <classpathentry kind="var" path="MAVEN_REPO/xerces/jars/xercesImpl-2.6.2.jar">
-  </classpathentry>
-  <classpathentry kind="var" path="MAVEN_REPO/xerces/jars/xmlParserAPIs-2.0.2.jar">
-  </classpathentry>
-  <classpathentry kind="var" path="MAVEN_REPO/org.apache.derby/jars/derby-10.1.1.0.jar">
-  </classpathentry>
-  <classpathentry kind="var" path="MAVEN_REPO/commons-beanutils/jars/commons-beanutils-1.7.0.jar">
-  </classpathentry>
-  <classpathentry kind="var" path="MAVEN_REPO/commons-digester/jars/commons-digester-1.7.jar">
-  </classpathentry>
-  <classpathentry kind="var" path="MAVEN_REPO/commons-logging/jars/commons-logging-1.0.2.jar">
-  </classpathentry>
-  <classpathentry kind="var" path="MAVEN_REPO/commons-lang/jars/commons-lang-2.1.jar">
-  </classpathentry>
-  <classpathentry kind="var" path="MAVEN_REPO/cglib/jars/cglib-full-2.0.2.jar">
-  </classpathentry>
-  <classpathentry kind="output" path="target/classes">
-  </classpathentry>
+  <classpathentry kind="src" path="src/main/java"/>
+  <classpathentry kind="src" path="src/test/java" output="target/test-classes"/>
+  <classpathentry kind="output" path="target/classes"/>
+  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/jackrabbit/jackrabbit-api/1.4-SNAPSHOT/jackrabbit-api-1.4-SNAPSHOT.jar"
sourcepath="M2_REPO/org/apache/jackrabbit/jackrabbit-api/1.4-SNAPSHOT/jackrabbit-api-1.4-SNAPSHOT-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar"/>
+  <classpathentry kind="var" path="M2_REPO/concurrent/concurrent/1.3.4/concurrent-1.3.4.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/jackrabbit/jackrabbit-jcr-commons/1.4-SNAPSHOT/jackrabbit-jcr-commons-1.4-SNAPSHOT.jar"
sourcepath="M2_REPO/org/apache/jackrabbit/jackrabbit-jcr-commons/1.4-SNAPSHOT/jackrabbit-jcr-commons-1.4-SNAPSHOT-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/commons-collections/commons-collections/3.1/commons-collections-3.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/derby/derby/10.1.1.0/derby-10.1.1.0.jar"/>
+  <classpathentry kind="var" path="M2_REPO/cglib/cglib-full/2.0.2/cglib-full-2.0.2.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/textmining/tm-extractors/0.4/tm-extractors-0.4.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/geronimo/specs/geronimo-jta_1.0.1B_spec/1.0.1/geronimo-jta_1.0.1B_spec-1.0.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/nekohtml/nekohtml/0.9.4/nekohtml-0.9.4.jar"/>
+  <classpathentry kind="var" path="M2_REPO/commons-lang/commons-lang/2.1/commons-lang-2.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-api/1.3.0/slf4j-api-1.3.0.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/jackrabbit/jackrabbit-text-extractors/1.4-SNAPSHOT/jackrabbit-text-extractors-1.4-SNAPSHOT.jar"
sourcepath="M2_REPO/org/apache/jackrabbit/jackrabbit-text-extractors/1.4-SNAPSHOT/jackrabbit-text-extractors-1.4-SNAPSHOT-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/poi/poi/2.5.1-final-20040804/poi-2.5.1-final-20040804.jar"/>
+  <classpathentry kind="var" path="M2_REPO/pdfbox/pdfbox/0.6.4/pdfbox-0.6.4.jar"/>
+  <classpathentry kind="var" path="M2_REPO/junit/junit/3.8.1/junit-3.8.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/xerces/xmlParserAPIs/2.0.2/xmlParserAPIs-2.0.2.jar"/>
+  <classpathentry kind="var" path="M2_REPO/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar"/>
+  <classpathentry kind="var" path="M2_REPO/xerces/xercesImpl/2.6.2/xercesImpl-2.6.2.jar"/>
+  <classpathentry kind="var" path="M2_REPO/log4j/log4j/1.2.8/log4j-1.2.8.jar"/>
+  <classpathentry kind="var" path="M2_REPO/javax/jcr/jcr/1.0/jcr-1.0.jar"/>
+  <classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging/1.0.2/commons-logging-1.0.2.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/lucene/lucene-core/2.0.0/lucene-core-2.0.0.jar"/>
+  <classpathentry kind="var" path="M2_REPO/commons-digester/commons-digester/1.7/commons-digester-1.7.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/jackrabbit/jackrabbit-core/1.4-SNAPSHOT/jackrabbit-core-1.4-SNAPSHOT.jar"
sourcepath="M2_REPO/org/apache/jackrabbit/jackrabbit-core/1.4-SNAPSHOT/jackrabbit-core-1.4-SNAPSHOT-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-log4j12/1.0/slf4j-log4j12-1.0.jar"/>
 </classpath>

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/.project
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/.project?view=diff&rev=544959&r1=544958&r2=544959
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/.project (original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/.project Wed Jun  6 14:23:01
2007
@@ -1,15 +1,10 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
 <projectDescription>
-  <name>graffito-jcr-mapping</name>
-  <comment>This subproject contains the JCR Mapping tools</comment>
-  <projects>
-  </projects>
+  <name>jackrabbit-ocm</name>
+  <comment>This Jackrabbit subproject is an object/JCR persistence and query service.
This tools lets you to persist java objects into a JCR compliant repository - including association,
inheritance, polymorphism, composition, and the Java collections framework. Furthermore, this
jcr-mapping allows you to express queries in Java-based Criteria, as well as in JCR query
language. It offers also features like version support and object locking.</comment>
+  <projects/>
   <buildSpec>
     <buildCommand>
       <name>org.eclipse.jdt.core.javabuilder</name>
-      <arguments>
-      </arguments>
     </buildCommand>
   </buildSpec>
   <natures>

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/AtomicTypeConverter.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/AtomicTypeConverter.java?view=diff&rev=544959&r1=544958&r2=544959
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/AtomicTypeConverter.java
(original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/AtomicTypeConverter.java
Wed Jun  6 14:23:01 2007
@@ -35,7 +35,8 @@
 {
 	/**
 	 * Convert an object into a JCR value.
-	 * 
+	 *
+     * @param valueFactory The JCR ValueFactory 
 	 * @param object The object to convert
 	 * @return the corresponding JCR value
 	 *  
@@ -53,8 +54,9 @@
 	/**
 	 * Get the string converted value. This is mainly used to build xpath expressions 
 	 * 
+	 * @param valueFactory The JCR ValueFactory
 	 * @param object The object value
 	 * @return The string converted value	 
 	 */
-	public String getStringValue(Object object);
+	public String getXPathQueryValue(ValueFactory valueFactory, Object object);
 }

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/BinaryTypeConverterImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/BinaryTypeConverterImpl.java?view=diff&rev=544959&r1=544958&r2=544959
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/BinaryTypeConverterImpl.java
(original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/BinaryTypeConverterImpl.java
Wed Jun  6 14:23:01 2007
@@ -69,7 +69,7 @@
      * 
      * @see org.apache.jackrabbit.ocm.persistence.atomictypeconverter.AtomicTypeConverter#getStringValue(java.lang.Object)
      */
-	public String getStringValue(Object object)
+	public String getXPathQueryValue(ValueFactory valueFactory,Object object)
 	{		
 		throw new IncorrectAtomicTypeException("Binary cannot be convert into string");
 	}

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/BooleanTypeConverterImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/BooleanTypeConverterImpl.java?view=diff&rev=544959&r1=544958&r2=544959
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/BooleanTypeConverterImpl.java
(original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/BooleanTypeConverterImpl.java
Wed Jun  6 14:23:01 2007
@@ -66,7 +66,7 @@
 	 * 
 	 * @see org.apache.jackrabbit.ocm.persistence.atomictypeconverter.AtomicTypeConverter#getStringValue(java.lang.Object)
 	 */
-	public String getStringValue(Object object)
+	public String getXPathQueryValue(ValueFactory valueFactory,Object object)
 	{
 		return ((Boolean) object).booleanValue() ? "true()" : "false()"; 
 	}

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/ByteArrayTypeConverterImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/ByteArrayTypeConverterImpl.java?view=diff&rev=544959&r1=544958&r2=544959
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/ByteArrayTypeConverterImpl.java
(original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/ByteArrayTypeConverterImpl.java
Wed Jun  6 14:23:01 2007
@@ -68,7 +68,7 @@
 	 * 
 	 * @see org.apache.jackrabbit.ocm.persistence.atomictypeconverter.AtomicTypeConverter#getStringValue(java.lang.Object)
 	 */
-	public String getStringValue(Object object)
+	public String getXPathQueryValue(ValueFactory valueFactory, Object object)
 	{
 		return  "'" + object.toString() + "'";
 	}

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/CalendarTypeConverterImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/CalendarTypeConverterImpl.java?view=diff&rev=544959&r1=544958&r2=544959
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/CalendarTypeConverterImpl.java
(original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/CalendarTypeConverterImpl.java
Wed Jun  6 14:23:01 2007
@@ -70,7 +70,7 @@
 	 * 
 	 * @see org.apache.jackrabbit.ocm.persistence.atomictypeconverter.AtomicTypeConverter#getStringValue(java.lang.Object)
 	 */
-	public String getStringValue(Object object)
+	public String getXPathQueryValue(ValueFactory valueFactory, Object object)
 	{
 		Calendar calendar = (Calendar) object;
     	return new Long(calendar.getTimeInMillis()).toString();		

Added: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/Date2LongTypeConverterImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/Date2LongTypeConverterImpl.java?view=auto&rev=544959
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/Date2LongTypeConverterImpl.java
(added)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/Date2LongTypeConverterImpl.java
Wed Jun  6 14:23:01 2007
@@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jackrabbit.ocm.persistence.atomictypeconverter.impl;
+
+import java.util.Date;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.Value;
+import javax.jcr.ValueFactory;
+
+import org.apache.jackrabbit.ocm.exception.IncorrectAtomicTypeException;
+import org.apache.jackrabbit.ocm.persistence.atomictypeconverter.AtomicTypeConverter;
+
+/**
+ * Util Date Converter
+ * 
+ * @author <a href="mailto:christophe.lombart@gmail.com">Christophe Lombart</a>
+ * @author <a href='mailto:the_mindstorm[at]evolva[dot]ro'>Alexandru Popescu</a>
+ */
+public class Date2LongTypeConverterImpl implements AtomicTypeConverter
+{
+	/**
+	 * 
+	 * @see org.apache.jackrabbit.ocm.persistence.atomictypeconverter.AtomicTypeConverter#getValue(java.lang.Object)
+	 */
+	public Value getValue(ValueFactory valueFactory, Object propValue)
+	{
+		if (propValue == null)
+		{
+			return null;
+		}
+		return valueFactory.createValue(((java.util.Date) propValue).getTime());		
+	}
+
+
+	/**
+	 * 
+	 * @see org.apache.jackrabbit.ocm.persistence.atomictypeconverter.AtomicTypeConverter#getObject(javax.jcr.Value)
+	 */
+	public Object getObject(Value value)
+    {
+		try
+		{
+			long time = value.getLong();
+			return new Date(time);
+		}
+		catch (RepositoryException e)
+		{
+			throw new IncorrectAtomicTypeException("Impossible to convert the value : " + value.toString(),
e);
+		}
+
+	}
+	
+	/**
+	 * 
+	 * @see org.apache.jackrabbit.ocm.persistence.atomictypeconverter.AtomicTypeConverter#getStringValue(java.lang.Object)
+	 */
+	public String getXPathQueryValue(ValueFactory valueFactory, Object object)
+	{
+		return new Long(((java.util.Date) object).getTime()).toString();
+	}
+}

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/DoubleTypeConverterImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/DoubleTypeConverterImpl.java?view=diff&rev=544959&r1=544958&r2=544959
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/DoubleTypeConverterImpl.java
(original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/DoubleTypeConverterImpl.java
Wed Jun  6 14:23:01 2007
@@ -68,7 +68,7 @@
 	 * 
 	 * @see org.apache.jackrabbit.ocm.persistence.atomictypeconverter.AtomicTypeConverter#getStringValue(java.lang.Object)
 	 */
-	public String getStringValue(Object object)
+	public String getXPathQueryValue(ValueFactory valueFactory, Object object)
 	{
 		return object.toString();
 	}

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/IntTypeConverterImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/IntTypeConverterImpl.java?view=diff&rev=544959&r1=544958&r2=544959
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/IntTypeConverterImpl.java
(original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/IntTypeConverterImpl.java
Wed Jun  6 14:23:01 2007
@@ -67,7 +67,7 @@
 	 * 
 	 * @see org.apache.jackrabbit.ocm.persistence.atomictypeconverter.AtomicTypeConverter#getStringValue(java.lang.Object)
 	 */
-	public String getStringValue(Object object)
+	public String getXPathQueryValue(ValueFactory valueFactory, Object object)
 	{
 		return object.toString();
 	}

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/LongTypeConverterImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/LongTypeConverterImpl.java?view=diff&rev=544959&r1=544958&r2=544959
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/LongTypeConverterImpl.java
(original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/LongTypeConverterImpl.java
Wed Jun  6 14:23:01 2007
@@ -69,7 +69,7 @@
 	 * 
 	 * @see org.apache.jackrabbit.ocm.persistence.atomictypeconverter.AtomicTypeConverter#getStringValue(java.lang.Object)
 	 */
-	public String getStringValue(Object object)
+	public String getXPathQueryValue(ValueFactory valueFactory, Object object)
 	{
 		return object.toString();
 	}

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/NameTypeConverterImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/NameTypeConverterImpl.java?view=diff&rev=544959&r1=544958&r2=544959
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/NameTypeConverterImpl.java
(original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/NameTypeConverterImpl.java
Wed Jun  6 14:23:01 2007
@@ -76,7 +76,7 @@
 	 * 
 	 * @see org.apache.jackrabbit.ocm.persistence.atomictypeconverter.AtomicTypeConverter#getStringValue(java.lang.Object)
 	 */
-	public String getStringValue(Object object)
+	public String getXPathQueryValue(ValueFactory valueFactory, Object object)
 	{
 		return "'" + object.toString() + "'";
 	}

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/NullTypeConverterImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/NullTypeConverterImpl.java?view=diff&rev=544959&r1=544958&r2=544959
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/NullTypeConverterImpl.java
(original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/NullTypeConverterImpl.java
Wed Jun  6 14:23:01 2007
@@ -50,7 +50,7 @@
      *
      * @see org.apache.jackrabbit.ocm.persistence.atomictypeconverter.AtomicTypeConverter#getStringValue(java.lang.Object)
      */
-    public String getStringValue(Object object) {
+    public String getXPathQueryValue(ValueFactory valueFactory, Object object) {
         return null;
     }
 }

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/PathTypeConverterImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/PathTypeConverterImpl.java?view=diff&rev=544959&r1=544958&r2=544959
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/PathTypeConverterImpl.java
(original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/PathTypeConverterImpl.java
Wed Jun  6 14:23:01 2007
@@ -76,7 +76,7 @@
 	 * 
 	 * @see org.apache.jackrabbit.ocm.persistence.atomictypeconverter.AtomicTypeConverter#getStringValue(java.lang.Object)
 	 */
-	public String getStringValue(Object object)
+	public String getXPathQueryValue(ValueFactory valueFactory, Object object)
 	{
 		return "'" + object.toString() + "'";
 	}

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/ReferenceTypeConverterImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/ReferenceTypeConverterImpl.java?view=diff&rev=544959&r1=544958&r2=544959
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/ReferenceTypeConverterImpl.java
(original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/ReferenceTypeConverterImpl.java
Wed Jun  6 14:23:01 2007
@@ -77,7 +77,7 @@
 	 * 
 	 * @see org.apache.jackrabbit.ocm.persistence.atomictypeconverter.AtomicTypeConverter#getStringValue(java.lang.Object)
 	 */
-	public String getStringValue(Object object)
+	public String getXPathQueryValue(ValueFactory valueFactory, Object object)
 	{
 		return "'" + object.toString() + "'";
 	}

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/StringTypeConverterImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/StringTypeConverterImpl.java?view=diff&rev=544959&r1=544958&r2=544959
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/StringTypeConverterImpl.java
(original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/StringTypeConverterImpl.java
Wed Jun  6 14:23:01 2007
@@ -67,7 +67,7 @@
 	 * 
 	 * @see org.apache.jackrabbit.ocm.persistence.atomictypeconverter.AtomicTypeConverter#getStringValue(java.lang.Object)
 	 */
-	public String getStringValue(Object object)
+	public String getXPathQueryValue(ValueFactory valueFactory, Object object)
 	{
 		return "'" + object.toString() + "'";
 	}

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/TimestampTypeConverterImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/TimestampTypeConverterImpl.java?view=diff&rev=544959&r1=544958&r2=544959
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/TimestampTypeConverterImpl.java
(original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/TimestampTypeConverterImpl.java
Wed Jun  6 14:23:01 2007
@@ -68,7 +68,7 @@
 	 * 
 	 * @see org.apache.jackrabbit.ocm.persistence.atomictypeconverter.AtomicTypeConverter#getStringValue(java.lang.Object)
 	 */
-	public String getStringValue(Object object)
+	public String getXPathQueryValue(ValueFactory valueFactory, Object object)
 	{
 		return new Long(((Timestamp) object).getTime()).toString();
 	}	

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/UndefinedTypeConverterImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/UndefinedTypeConverterImpl.java?view=diff&rev=544959&r1=544958&r2=544959
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/UndefinedTypeConverterImpl.java
(original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/UndefinedTypeConverterImpl.java
Wed Jun  6 14:23:01 2007
@@ -179,7 +179,7 @@
 	 * 
 	 * @see org.apache.jackrabbit.ocm.persistence.atomictypeconverter.AtomicTypeConverter#getStringValue(java.lang.Object)
 	 */
-	public String getStringValue(Object object)
+	public String getXPathQueryValue(ValueFactory valueFactory, Object object)
 	{
 		return "'" + object.toString() + "'";
 	}

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/UtilDateTypeConverterImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/UtilDateTypeConverterImpl.java?view=diff&rev=544959&r1=544958&r2=544959
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/UtilDateTypeConverterImpl.java
(original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/atomictypeconverter/impl/UtilDateTypeConverterImpl.java
Wed Jun  6 14:23:01 2007
@@ -17,11 +17,13 @@
 
 package org.apache.jackrabbit.ocm.persistence.atomictypeconverter.impl;
 
+import java.util.Calendar;
 import java.util.Date;
 
 import javax.jcr.RepositoryException;
 import javax.jcr.Value;
 import javax.jcr.ValueFactory;
+import javax.jcr.ValueFormatException;
 
 import org.apache.jackrabbit.ocm.exception.IncorrectAtomicTypeException;
 import org.apache.jackrabbit.ocm.persistence.atomictypeconverter.AtomicTypeConverter;
@@ -34,6 +36,7 @@
  */
 public class UtilDateTypeConverterImpl implements AtomicTypeConverter
 {
+	
 	/**
 	 * 
 	 * @see org.apache.jackrabbit.ocm.persistence.atomictypeconverter.AtomicTypeConverter#getValue(java.lang.Object)
@@ -43,8 +46,10 @@
 		if (propValue == null)
 		{
 			return null;
-		}
-		return valueFactory.createValue(((java.util.Date) propValue).getTime());		
+		}		
+		Calendar calendar =  Calendar.getInstance();
+		calendar.setTime((Date) propValue);
+		return valueFactory.createValue(calendar);		
 	}
 
 
@@ -56,8 +61,8 @@
     {
 		try
 		{
-			long time = value.getLong();
-			return new Date(time);
+			Calendar calendar = value.getDate();
+			return calendar.getTime();
 		}
 		catch (RepositoryException e)
 		{
@@ -70,8 +75,20 @@
 	 * 
 	 * @see org.apache.jackrabbit.ocm.persistence.atomictypeconverter.AtomicTypeConverter#getStringValue(java.lang.Object)
 	 */
-	public String getStringValue(Object object)
+	public String getXPathQueryValue(ValueFactory valueFactory, Object object)
 	{
-		return new Long(((java.util.Date) object).getTime()).toString();
+		try 
+		{
+			Calendar calendar =  Calendar.getInstance();
+			
+			calendar.setTime((Date) object);
+
+			return "xs:dateTime('" + valueFactory.createValue(calendar).getString() + "')";
+
+		} 
+		catch (RepositoryException e) 
+		{
+			throw new IncorrectAtomicTypeException("Impossible to get the sting value ", e);
+		}
 	}
 }

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/impl/PersistenceManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/impl/PersistenceManagerImpl.java?view=diff&rev=544959&r1=544958&r2=544959
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/impl/PersistenceManagerImpl.java
(original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/persistence/impl/PersistenceManagerImpl.java
Wed Jun  6 14:23:01 2007
@@ -127,13 +127,22 @@
      */
     public PersistenceManagerImpl(Session session,String[] xmlMappingFiles ) 
     {
-        this.session = session;
-		this.mapper = new DigesterMapperImpl(xmlMappingFiles);
-		DefaultAtomicTypeConverterProvider converterProvider = new DefaultAtomicTypeConverterProvider();
-        Map atomicTypeConverters = converterProvider.getAtomicTypeConverters();
-		this.queryManager = new QueryManagerImpl(mapper, atomicTypeConverters);
-        this.requestObjectCache = new RequestObjectCacheImpl();        
-        this.objectConverter = new ObjectConverterImpl(mapper, converterProvider, new ProxyManagerImpl(),
requestObjectCache);
+        try 
+        {
+			this.session = session;
+			this.mapper = new DigesterMapperImpl(xmlMappingFiles);
+			DefaultAtomicTypeConverterProvider converterProvider = new DefaultAtomicTypeConverterProvider();
+			Map atomicTypeConverters = converterProvider.getAtomicTypeConverters();
+			this.queryManager = new QueryManagerImpl(mapper, atomicTypeConverters, session.getValueFactory());
+			this.requestObjectCache = new RequestObjectCacheImpl();        
+			this.objectConverter = new ObjectConverterImpl(mapper, converterProvider, new ProxyManagerImpl(),
requestObjectCache);
+		} 
+        catch (RepositoryException e) 
+        {
+            throw new org.apache.jackrabbit.ocm.exception.RepositoryException(
+                    "Impossible to instantiate the persistence manager", e);
+
+		}
         
     }
     

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/query/impl/FilterImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/query/impl/FilterImpl.java?view=diff&rev=544959&r1=544958&r2=544959
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/query/impl/FilterImpl.java
(original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/query/impl/FilterImpl.java
Wed Jun  6 14:23:01 2007
@@ -20,6 +20,8 @@
 
 import java.util.Map;
 
+import javax.jcr.ValueFactory;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.jackrabbit.ocm.mapper.model.ClassDescriptor;
@@ -41,6 +43,7 @@
 
     private ClassDescriptor classDescriptor;
     private Map atomicTypeConverters;
+    private ValueFactory valueFactory;
 
     /**
      * Constructor
@@ -49,10 +52,11 @@
      * @param atomicTypeConverters
      * @param clazz
      */
-    public FilterImpl(ClassDescriptor classDescriptor, Map atomicTypeConverters, Class clazz)
{
+    public FilterImpl(ClassDescriptor classDescriptor, Map atomicTypeConverters, Class clazz,
ValueFactory valueFactory) {
         this.claszz = clazz;
         this.atomicTypeConverters = atomicTypeConverters;
         this.classDescriptor = classDescriptor;
+        this.valueFactory = valueFactory;
     }
 
     /**
@@ -265,7 +269,7 @@
         AtomicTypeConverter atomicTypeConverter = (AtomicTypeConverter) atomicTypeConverters.get(
                 value.getClass());
 
-        return atomicTypeConverter.getStringValue(value);
+        return atomicTypeConverter.getXPathQueryValue(valueFactory, value);
     }
 
     public String getJcrExpression() {

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/query/impl/QueryManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/query/impl/QueryManagerImpl.java?view=diff&rev=544959&r1=544958&r2=544959
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/query/impl/QueryManagerImpl.java
(original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/query/impl/QueryManagerImpl.java
Wed Jun  6 14:23:01 2007
@@ -20,6 +20,8 @@
 import java.util.Iterator;
 import java.util.Map;
 
+import javax.jcr.ValueFactory;
+
 import org.apache.jackrabbit.ocm.mapper.Mapper;
 import org.apache.jackrabbit.ocm.mapper.model.ClassDescriptor;
 import org.apache.jackrabbit.ocm.mapper.model.FieldDescriptor;
@@ -32,16 +34,18 @@
     
 	private Mapper mapper;
     private Map atomicTypeConverters;
+    private ValueFactory valueFactory;
 
-    public QueryManagerImpl(Mapper mapper, Map atomicTypeConverters) {
+    public QueryManagerImpl(Mapper mapper, Map atomicTypeConverters, ValueFactory valueFactory)
{
         this.mapper = mapper;
         this.atomicTypeConverters = atomicTypeConverters;
+        this.valueFactory = valueFactory;
     }
 
     public Filter createFilter(Class classQuery) {
         return new FilterImpl(mapper.getClassDescriptorByClass(classQuery),
                               atomicTypeConverters,
-                              classQuery);
+                              classQuery, valueFactory);
     }
 
     public Query createQuery(Filter filter) {

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/persistence/atomic/Int2BooleanTypeConverterImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/persistence/atomic/Int2BooleanTypeConverterImpl.java?view=diff&rev=544959&r1=544958&r2=544959
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/persistence/atomic/Int2BooleanTypeConverterImpl.java
(original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/persistence/atomic/Int2BooleanTypeConverterImpl.java
Wed Jun  6 14:23:01 2007
@@ -80,7 +80,7 @@
 	 * 
 	 * @see org.apache.jackrabbit.ocm.persistence.atomictypeconverter.AtomicTypeConverter#getStringValue(java.lang.Object)
 	 */
-	public String getStringValue(Object object)
+	public String getXPathQueryValue(ValueFactory valueFactory, Object object)
 	{
 		
 		return ((Boolean) object).booleanValue() ? "1" : "0"; 

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/persistence/query/PersistenceManagerAtomicQueryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/persistence/query/PersistenceManagerAtomicQueryTest.java?view=diff&rev=544959&r1=544958&r2=544959
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/persistence/query/PersistenceManagerAtomicQueryTest.java
(original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/persistence/query/PersistenceManagerAtomicQueryTest.java
Wed Jun  6 14:23:01 2007
@@ -149,7 +149,14 @@
 			
 			result = persistenceManager.getObjects(query);			
 			assertTrue("Invalid number of objects - should be = 100 ", result.size() == 100);
+
+			filter = queryManager.createFilter(Atomic.class);			
+			filter.addGreaterThan("date", date);
+			query = queryManager.createQuery(filter);
 			
+			result = persistenceManager.getObjects(query);			
+			assertTrue("Invalid number of objects - should be = 0 ", result.size() == 0);
+
 			// Test contains method
 			filter = queryManager.createFilter(Atomic.class);			
 			filter.addContains(".", "JCR");

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/xdocs/navigation.xml
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/xdocs/navigation.xml?view=diff&rev=544959&r1=544958&r2=544959
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/xdocs/navigation.xml (original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/xdocs/navigation.xml Wed Jun
 6 14:23:01 2007
@@ -35,7 +35,7 @@
 		
 		<menu name="Persistence Manager">			
 			<item name="Overview" href="engine-introduction.html"/>
-			<item name="Mapping Descriptor DTD" href="graffito-jcr-mapping.dtd.txt"/>
+			<item name="Mapping Descriptor DTD" href="jackrabbit-ocm.dtd.txt"/>
 			<item name="Setup" href="engine-setup.html"/>
 			<item name="Spring Integration" href="engine-spring.html"/>
 		</menu>			



Mime
View raw message