// Path: src/main/java/net/canadensys/dataportal/occurrence/dao/OccurrenceExtensionDAO.java
// public interface OccurrenceExtensionDAO {
// 	
// 	/**
// 	 * Load a OccurrenceExtensionModel from an id
// 	 * @param id
// 	 * @return OccurrenceExtensionModel or null if nothing is found
// 	 */
// 	public OccurrenceExtensionModel load(Long id);
// 	
// 	/**
// 	 * Load all OccurrenceExtensionModel of a certain type linked to a resourceUUID/dwcaId
// 	 * @param extensionType e.g. multimedia
// 	 * @param resourceUUID
// 	 * @param dwcaId
// 	 * @return list of matching OccurrenceExtensionModel or empty list
// 	 */
// 	public List<OccurrenceExtensionModel> load(String extensionType, String resourceUUID, String dwcaId);
// 	
// 	/**
// 	 * Save a OccurrenceExtensionModel
// 	 * @param occurrenceExtensionModel
// 	 * @return success or not
// 	 */
// 	public boolean save(OccurrenceExtensionModel occurrenceExtensionModel);
// 
// }
// 
// Path: src/main/java/net/canadensys/dataportal/occurrence/model/OccurrenceExtensionModel.java
// @Entity
// @Table(name = "occurrence_extension")
// @TypeDefs( {@TypeDef( name= "KeyValueType", typeClass = KeyValueType.class)})
// public class OccurrenceExtensionModel {
// 	
// 	@Id
// 	private long auto_id;
// 	
// 	@NaturalId
// 	private String dwcaid;
// 	@NaturalId
// 	private String sourcefileid;
// 	@NaturalId
// 	private String resource_uuid;
// 	
// 	private String ext_type;
// 	private String ext_version;
// 	
// 	@Type(type="KeyValueType")
// 	private Map<String,String> ext_data;
// 		
// 	public long getAuto_id() {
// 		return auto_id;
// 	}
// 	public void setAuto_id(long auto_id) {
// 		this.auto_id = auto_id;
// 	}
// 	
// 	public String getDwcaid() {
// 		return dwcaid;
// 	}
// 	public void setDwcaid(String dwcaid) {
// 		this.dwcaid = dwcaid;
// 	}
// 	
// 	public String getSourcefileid() {
// 		return sourcefileid;
// 	}
// 	public void setSourcefileid(String sourcefileid) {
// 		this.sourcefileid = sourcefileid;
// 	}
// 	
// 	public String getResource_uuid() {
// 		return resource_uuid;
// 	}
// 	public void setResource_uuid(String resource_uuid) {
// 		this.resource_uuid = resource_uuid;
// 	}
// 	
// 	public String getExt_type() {
// 		return ext_type;
// 	}
// 	public void setExt_type(String ext_type) {
// 		this.ext_type = ext_type;
// 	}
// 	
// 	public String getExt_version() {
// 		return ext_version;
// 	}
// 	public void setExt_version(String ext_version) {
// 		this.ext_version = ext_version;
// 	}
// 	
// 	public Map<String,String> getExt_data() {
// 		return ext_data;
// 	}
// 	public void setExt_data(Map<String,String> ext_data) {
// 		this.ext_data = ext_data;
// 	}
// 
// }
// 
// Path: src/main/java/net/canadensys/dataportal/occurrence/model/OccurrenceFieldConstants.java
// public class OccurrenceFieldConstants {
// 	
// 	public static final String DWCA_ID = "dwcaid";
// 	public static final String SOURCE_FILE_ID = "sourcefileid";
// 	public static final String RESOURCE_UUID = "resource_uuid";
// 
// }


import java.util.List;
import net.canadensys.dataportal.occurrence.dao.OccurrenceExtensionDAO;
import net.canadensys.dataportal.occurrence.model.OccurrenceExtensionModel;
import net.canadensys.dataportal.occurrence.model.OccurrenceFieldConstants;
import org.apache.log4j.Logger;
import org.hibernate.Criteria;
import org.hibernate.HibernateException;
import org.hibernate.SessionFactory;
import org.hibernate.criterion.Restrictions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
package net.canadensys.dataportal.occurrence.dao.impl;




/**
 * Implementation for accessing occurrence extension data through Hibernate technology.
 * @author canadensys
 *
 */
@Repository("occurrenceExtensionDAO")
public class HibernateOccurrenceExtensionDAO implements OccurrenceExtensionDAO{
	
	//get log4j handler
	private static final Logger LOGGER = Logger.getLogger(HibernateOccurrenceExtensionDAO.class);
	private static final String MANAGED_ID = "id";
	private static final String EXTENSION_TYPE = "ext_type";
		
	@Autowired
	private SessionFactory sessionFactory;

	@Override
// Path: src/main/java/net/canadensys/dataportal/occurrence/dao/OccurrenceExtensionDAO.java
// public interface OccurrenceExtensionDAO {
// 	
// 	/**
// 	 * Load a OccurrenceExtensionModel from an id
// 	 * @param id
// 	 * @return OccurrenceExtensionModel or null if nothing is found
// 	 */
// 	public OccurrenceExtensionModel load(Long id);
// 	
// 	/**
// 	 * Load all OccurrenceExtensionModel of a certain type linked to a resourceUUID/dwcaId
// 	 * @param extensionType e.g. multimedia
// 	 * @param resourceUUID
// 	 * @param dwcaId
// 	 * @return list of matching OccurrenceExtensionModel or empty list
// 	 */
// 	public List<OccurrenceExtensionModel> load(String extensionType, String resourceUUID, String dwcaId);
// 	
// 	/**
// 	 * Save a OccurrenceExtensionModel
// 	 * @param occurrenceExtensionModel
// 	 * @return success or not
// 	 */
// 	public boolean save(OccurrenceExtensionModel occurrenceExtensionModel);
// 
// }
// 
// Path: src/main/java/net/canadensys/dataportal/occurrence/model/OccurrenceExtensionModel.java
// @Entity
// @Table(name = "occurrence_extension")
// @TypeDefs( {@TypeDef( name= "KeyValueType", typeClass = KeyValueType.class)})
// public class OccurrenceExtensionModel {
// 	
// 	@Id
// 	private long auto_id;
// 	
// 	@NaturalId
// 	private String dwcaid;
// 	@NaturalId
// 	private String sourcefileid;
// 	@NaturalId
// 	private String resource_uuid;
// 	
// 	private String ext_type;
// 	private String ext_version;
// 	
// 	@Type(type="KeyValueType")
// 	private Map<String,String> ext_data;
// 		
// 	public long getAuto_id() {
// 		return auto_id;
// 	}
// 	public void setAuto_id(long auto_id) {
// 		this.auto_id = auto_id;
// 	}
// 	
// 	public String getDwcaid() {
// 		return dwcaid;
// 	}
// 	public void setDwcaid(String dwcaid) {
// 		this.dwcaid = dwcaid;
// 	}
// 	
// 	public String getSourcefileid() {
// 		return sourcefileid;
// 	}
// 	public void setSourcefileid(String sourcefileid) {
// 		this.sourcefileid = sourcefileid;
// 	}
// 	
// 	public String getResource_uuid() {
// 		return resource_uuid;
// 	}
// 	public void setResource_uuid(String resource_uuid) {
// 		this.resource_uuid = resource_uuid;
// 	}
// 	
// 	public String getExt_type() {
// 		return ext_type;
// 	}
// 	public void setExt_type(String ext_type) {
// 		this.ext_type = ext_type;
// 	}
// 	
// 	public String getExt_version() {
// 		return ext_version;
// 	}
// 	public void setExt_version(String ext_version) {
// 		this.ext_version = ext_version;
// 	}
// 	
// 	public Map<String,String> getExt_data() {
// 		return ext_data;
// 	}
// 	public void setExt_data(Map<String,String> ext_data) {
// 		this.ext_data = ext_data;
// 	}
// 
// }
// 
// Path: src/main/java/net/canadensys/dataportal/occurrence/model/OccurrenceFieldConstants.java
// public class OccurrenceFieldConstants {
// 	
// 	public static final String DWCA_ID = "dwcaid";
// 	public static final String SOURCE_FILE_ID = "sourcefileid";
// 	public static final String RESOURCE_UUID = "resource_uuid";
// 
// }


// Path: src/main/java/net/canadensys/dataportal/occurrence/dao/impl/HibernateOccurrenceExtensionDAO.java
import java.util.List;
import net.canadensys.dataportal.occurrence.dao.OccurrenceExtensionDAO;
import net.canadensys.dataportal.occurrence.model.OccurrenceExtensionModel;
import net.canadensys.dataportal.occurrence.model.OccurrenceFieldConstants;
import org.apache.log4j.Logger;
import org.hibernate.Criteria;
import org.hibernate.HibernateException;
import org.hibernate.SessionFactory;
import org.hibernate.criterion.Restrictions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

package net.canadensys.dataportal.occurrence.dao.impl;




/**
 * Implementation for accessing occurrence extension data through Hibernate technology.
 * @author canadensys
 *
 */
@Repository("occurrenceExtensionDAO")
public class HibernateOccurrenceExtensionDAO implements OccurrenceExtensionDAO{
	
	//get log4j handler
	private static final Logger LOGGER = Logger.getLogger(HibernateOccurrenceExtensionDAO.class);
	private static final String MANAGED_ID = "id";
	private static final String EXTENSION_TYPE = "ext_type";
		
	@Autowired
	private SessionFactory sessionFactory;

	@Override
	public boolean save(OccurrenceExtensionModel occurrenceExtensionModel) {