Thursday, July 14, 2011

HQL with where clause on map values

        "Select profileType from ProfileType profileType where profileType.profileProps['key'] = ?"
<hibernate-mapping default-cascade="delete" default-lazy="false">
  name="mypackage.ProfileType" table="PROFILETYPE">
  <id name="id" type="long" unsaved-value="0">
   <generator class="native"/>
  <property generated="never" lazy="false" name="profileTypeName" type="java.lang.String">
   <column name="PROFILETYPENAME"/>
  <map lazy="false" name="profileProps" sort="unsorted" table="PROFILEPROPS">
    <column name="ID" unique="false"/>
   <map-key type="java.lang.String">
    <column name="PROFILEPROPNAME" />
   <element type="java.lang.String">
    <column name="PROFILEPROPVALUE"/>
public class ProfileType {
        private long id;
        private String profileTypeName;
        private Map<String, String> profileProps;

Unix command to bind a certain process to specified core

taskset -c 1 -p 13545 (where c = core, p = process)
taskset -c 3 ./