<?xml version='1.0' encoding='UTF-8'?>

<!DOCTYPE hibernate-mapping PUBLIC
    '-//Hibernate/Hibernate Mapping DTD 3.0//EN' 
    'http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd'>

<hibernate-mapping>

   <class
         name="org.alfresco.repo.domain.hibernate.AppliedPatchImpl"
         proxy="org.alfresco.repo.domain.AppliedPatch"
         table="applied_patch"
         dynamic-update="false"
         dynamic-insert="false"
         select-before-update="false"
         optimistic-lock="version" >
      <id column="id" length="64" name="id" type="string" />
      <property name="description" column="description" type="string" length="1024" />
      <property name="fixesFromSchema" column="fixes_from_schema" type="integer" />
      <property name="fixesToSchema" column="fixes_to_schema" type="integer" />
      <property name="appliedToSchema" column="applied_to_schema" type="integer" />
      <property name="targetSchema" column="target_schema" type="integer" />
      <property name="appliedOnDate" column="applied_on_date" type="timestamp" />
      <property name="appliedToServer" column="applied_to_server" type="string" length="64" />
      <property name="wasExecuted" column="was_executed" type="boolean" />
      <property name="succeeded" column="succeeded" type="boolean" />
      <property name="report" column="report" type="string" length="1024" />
   </class>

   <query name="patch.GetAllAppliedPatches">
      select
         appliedPatch
      from
         org.alfresco.repo.domain.hibernate.AppliedPatchImpl as appliedPatch
   </query>
   
   <query name="patch.GetAppliedPatchesByDate">
      <![CDATA[
      select
         appliedPatch
      from
         org.alfresco.repo.domain.hibernate.AppliedPatchImpl as appliedPatch
      where
         appliedPatch.appliedOnDate >= :fromDate and
         appliedPatch.appliedOnDate <= :toDate
      order by appliedPatch.appliedOnDate
      ]]>
   </query>
   
</hibernate-mapping>
