ContentItem.hbm.xml 2.43 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 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
<?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.ContentItem" table="CONTENTITEM">

	<cache usage="read-write"/>

	  <id column="CONTITEMID" 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>
      <many-to-one name="parent" 
        class="org.pentaho.repository.content.ContentLocation" 
        column="parent_id"
      />
      <property name="path" type="string" not-null="true">
        <!-- 
        MySQL-specific change. Varchars above 767 bytes can't be indexed.
         -->
        <column name="PATH" length="767" not-null="true" unique-key="ICONTITMPATH" />
      </property>
      <property name="title" type="string" not-null="true">
        <column name="TITLE" length="200" not-null="true" />
      </property>
      <property name="mimeType" type="string" not-null="false">
        <column name="MIMETYPE" length="100" not-null="false" />
      </property>
      <property name="url" type="string" not-null="false">
        <column name="URL" length="254" not-null="false" />
      </property>
      <property name="latestVersionNum" type="int" not-null="false" >
        <column name="LATESTVERNUM" not-null="false" />
      </property>
      <property name="extension" type="string" not-null="true" >
        <column name="EXTENSION" length="10" not-null="true" />
      </property>
      <property name="writeMode" type="int" not-null="true" >
        <column name="WRITEMODE" not-null="true" />
      </property>
      <query name="findItemByPath">
       <![CDATA[
       from org.pentaho.repository.content.ContentItem cItem where cItem.path = :inPath
       ]]>
      </query>
      <query name="findItemByName">
       <![CDATA[
       from org.pentaho.repository.content.ContentItem cItem where cItem.parent = :parent and cItem.name = :name
       ]]>
      </query>
      <query name="itemSearcher">
       <![CDATA[
       from org.pentaho.repository.content.ContentItem itm where 
       name like :searchTerm or title like :searchTerm or path like :searchTerm
       ]]>
      </query>
  </class>
</hibernate-mapping>