title: Hibernate Criteria with Oracle analytic windowing function
body: <p>Trying to override Oracle10gDialect and adding in over and partition functions. I read on <a href="https://forum.hibernate.org/viewtopic.php?p=2468846" rel="noreferrer">hibernate.org</a> about how to override the dialect. 
  I am using Hibernate 4.1.7.Final and cannot upgrade.
  I implemented it as specified, however i am getting this error. </p>
  
  <pre><code>     15:21:21,353  WARN SqlExceptionHelper:143 - SQL Error: 907, SQLState: 42000
  [10/8/13 15:21:21:354 CDT] 00000021 SystemOut     O ORA-00907: missing right parenthesis
  
  [10/8/13 15:21:21:354 CDT] 00000021 SystemOut     O 15:21:21,354 ERROR SqlExceptionHelper:144 - ORA-00907: missing right parenthesis
  </code></pre>
  
  <p>Here is the class that i build:</p>
  
  <pre><code>package com.edmann.util;
  
  import org.apache.log4j.Logger;
  import org.hibernate.dialect.Oracle10gDialect;
  import org.hibernate.dialect.function.StandardSQLFunction;
  
  /**
   * Because i need some analytic functions i am going to extend the
   * oracle10gDialect so i can register my functions i want to use.
   * 
   * @author Edward Mann
   * 
   */
  public class Oracle10gDialectExtended extends Oracle10gDialect {
      // get log4j handler
      private static final Logger LOG = Logger
              .getLogger(Oracle10gDialectExtended.class);
  
      /**
       * Override registerFunctions so that we can register the ones we want to
       * use, then we will call the registerFunctions from the parent class.
       * 
       */
      @Override
      protected void registerFunctions() {
          LOG.info("Trying to register custom functions");
          registerFunction("over", new StandardSQLFunction("over"));
          registerFunction("partition", new StandardSQLFunction("partition"));
          super.registerFunctions();
      }
  }
  </code></pre>
  
  <p>Here is my entry in my hbm.xml file:</p>
  
  <pre><code>&lt;property name="rank" type="integer" formula="(ROW_NUMBER() over(partition by ENTRY_NUMBER ORDER BY ENTRY_DATE DESC))"/&gt;
  </code></pre>
  
  <p>The challenge i am having is keeping hibernate from adding this_. to the partition. In the hibernate forum thread that i linked to, the last entry was a person having the same issue. I am not sure if this is even possible with Hibernate Criteria.</p>
  
  <p>Thanks for any help.</p>
  
  <p><strong>Update:</strong>
  I found my answer i added </p>
  
  <pre><code>registerKeyword("partition");
  </code></pre>
  
  <p>To my Oracle10gDialectExtended class in the registerFunctions method and it now works as expected.</p>