ContentLocation.hbm.xml 1.78 KB
Newer Older
Thitichaipun Wutthisak committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
<?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.pentaho.repository.content.ContentLocation" table="CONTENTLOCATION">

	<cache usage="read-write"/>

	  <id column="CONTENTID" name="id" type="string" length="100">
	  	<generator class="assigned" />
	  </id>
      <version column="REVISION" name="revision" unsaved-value="negative" />
      <property name="name" type="string" not-null="true">
        <column name="NAME" length="200" not-null="true" />
      </property>
      <property name="solutionId" type="string" not-null="true">
        <column name="SOLNID" length="100" not-null="true" />
      </property>
      <property name="description" type="string" not-null="true">
        <column name="DESCRIPTION" length="200" not-null="true" />
      </property>
      <property name="dirPath" type="string" not-null="true">
        <!-- 
        MySQL-specific change. Varchars above 767 bytes can't be indexed.
         -->
        <column name="DIRPATH" length="767" not-null="true" unique-key="ICONTLOCPATH"/>
      </property>
      <query name="findContentLocationByPath">
       <![CDATA[
       from org.pentaho.repository.content.ContentLocation cLoc where cLoc.dirPath = :inPath
       ]]>
      </query>
      <query name="findAllContentLocations">
       <![CDATA[
       from org.pentaho.repository.content.ContentLocation cLoc
       ]]>
      </query>
      <query name="locationSearcher">
       <![CDATA[
       from org.pentaho.repository.content.ContentLocation loc where 
       name like :searchTerm or description like :searchTerm or dirPath like :searchTerm
       ]]>
      </query>
      
  </class>
</hibernate-mapping>