<commit_before><?xml version="1.0"?>
<!DOCTYPE hibernate-mapping
    PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN"
    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping package="org.sakaiproject.profile2.model">

	<class name="SakaiPersonMeta" table="SAKAI_PERSON_META_T">

	    <id name="id">
	      <column name="ID" not-null="true" length="19" />
	      <generator class="native">
	        <param name="sequence">SAKAI_PERSON_META_S</param>
	      </generator>
	    </id>

	    <property name="userUuid" column="USER_UUID" length="99" not-null="true"/>
	    <property name="property" column="PROPERTY" not-null="true"/>
		<property name="value" column="VALUE" not-null="true" />
		
  	</class>
  	
	<query name="getProperty">
    	<![CDATA[from SakaiPersonMeta spm WHERE spm.userUuid = :userUuid AND spm.property = :property]]>
	</query>
	
	
	<!--  these are on the SakaiPerson object. -->
	<query name="findSakaiPersonsByNameOrEmail">
    	<![CDATA[select sp.agentUuid from org.sakaiproject.component.common.edu.person.SakaiPersonImpl as sp where sp.nickname like lower(:search) or sp.mail like :search]]>
  	</query>
  
 	<query name="findSakaiPersonsByInterest">
    	<![CDATA[select sp.agentUuid from org.sakaiproject.component.common.edu.person.SakaiPersonImpl as sp where sp.favouriteBooks like lower(:search) or sp.favouriteTvShows like lower(:search) or sp.favouriteMovies like lower(:search) or sp.favouriteQuotes like lower(:search) or sp.notes like lower(:search)]]>
  	</query>
  	
  	<query name="findSakaiPersonsByInterestAndBusinessBio">
    	<![CDATA[select sp.agentUuid from org.sakaiproject.component.common.edu.person.SakaiPersonImpl as sp where sp.favouriteBooks like lower(:search) or sp.favouriteTvShows like lower(:search) or sp.favouriteMovies like lower(:search) or sp.favouriteQuotes like lower(:search) or sp.notes like lower(:search) or sp.businessBiography like lower(:search)]]>
  	</query>
  	
  	<query name="getAllSakaiPersonIds">
    	<![CDATA[select sp.agentUuid from org.sakaiproject.component.common.edu.person.SakaiPersonImpl as sp]]>
  	</query>
  	
  	<query name="getAllSakaiPersonIdsCount">
    	<![CDATA[select count(distinct sp.agentUuid) from org.sakaiproject.component.common.edu.person.SakaiPersonImpl as sp]]>
  	</query>
  	
  	<!--  this is a native query to get only the fields that Profile2 currently uses, it is then transformed into a UserProfile object.
  	This should be chunked in the Hibernate call so as to only get a set of records at a time, say 100 -->
  	<sql-query name="getSakaiPerson"><commit_msg>PRFL-730 add lower to both sides of comparison in HQL<commit_after><?xml version="1.0"?>
<!DOCTYPE hibernate-mapping
    PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN"
    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping package="org.sakaiproject.profile2.model">

	<class name="SakaiPersonMeta" table="SAKAI_PERSON_META_T">

	    <id name="id">
	      <column name="ID" not-null="true" length="19" />
	      <generator class="native">
	        <param name="sequence">SAKAI_PERSON_META_S</param>
	      </generator>
	    </id>

	    <property name="userUuid" column="USER_UUID" length="99" not-null="true"/>
	    <property name="property" column="PROPERTY" not-null="true"/>
		<property name="value" column="VALUE" not-null="true" />
		
  	</class>
  	
	<query name="getProperty">
    	<![CDATA[from SakaiPersonMeta spm WHERE spm.userUuid = :userUuid AND spm.property = :property]]>
	</query>
	
	
	<!--  these are on the SakaiPerson object. -->
	<query name="findSakaiPersonsByNameOrEmail">
    	<![CDATA[select sp.agentUuid from org.sakaiproject.component.common.edu.person.SakaiPersonImpl as sp where lower(sp.nickname) like lower(:search) or lower(sp.mail) like lower(:search)]]>
  	</query>
  
 	<query name="findSakaiPersonsByInterest">
    	<![CDATA[select sp.agentUuid from org.sakaiproject.component.common.edu.person.SakaiPersonImpl as sp where lower(sp.favouriteBooks) like lower(:search) or lower(sp.favouriteTvShows) like lower(:search) or lower(sp.favouriteMovies) like lower(:search) or lower(sp.favouriteQuotes) like lower(:search) or lower(sp.notes) like lower(:search)]]>
  	</query>
  	
  	<query name="findSakaiPersonsByInterestAndBusinessBio">
    	<![CDATA[select sp.agentUuid from org.sakaiproject.component.common.edu.person.SakaiPersonImpl as sp where lower(sp.favouriteBooks) like lower(:search) or lower(sp.favouriteTvShows) like lower(:search) or lower(sp.favouriteMovies) like lower(:search) or lower(sp.favouriteQuotes) like lower(:search) or lower(sp.notes) like lower(:search) or lower(sp.businessBiography) like lower(:search)]]>
  	</query>
  	
  	<query name="getAllSakaiPersonIds">
    	<![CDATA[select sp.agentUuid from org.sakaiproject.component.common.edu.person.SakaiPersonImpl as sp]]>
  	</query>
  	
  	<query name="getAllSakaiPersonIdsCount">
    	<![CDATA[select count(distinct sp.agentUuid) from org.sakaiproject.component.common.edu.person.SakaiPersonImpl as sp]]>
  	</query>
  	
  	<!--  this is a native query to get only the fields that Profile2 currently uses, it is then transformed into a UserProfile object.
  	This should be chunked in the Hibernate call so as to only get a set of records at a time, say 100 -->
  	<sql-query name="getSakaiPerson">
{'fraction_non_alphanumeric': 0.13319595354065192, 'fraction_numerical': 0.005432746346946422, 'mean_word_length': 4.5211995863495344, 'pattern_counts': {'":': 0, '<': 75, '<?xml version=': 2, '>': 75, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3875041', 'n_tokens_mistral': 1910, 'n_tokens_neox': 1767, 'n_words': 412}