<?xml version="1.0" encoding="UTF-8"?>
<domain-models xmlns="http://axelor.com/xml/ns/domain-models" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://axelor.com/xml/ns/domain-models http://axelor.com/xml/ns/domain-models/domain-models_5.2.xsd">
  
  <module name="exception" package="com.axelor.exception.db"/>
  
  <entity sequential="true" name="TraceBack" lang="java">
  
    <string title="Anomaly" name="exception" required="true" large="true"/>
    <integer title="Type" name="typeSelect" selection="trace.back.type.select"/>
    <integer title="Category" name="categorySelect" selection="trace.back.category.select"/>
    <string name="origin" selection="trace.back.origin.select" title="Origin" />
    <datetime title="Date" tz="true" name="date" required="true" column="date_val"/>
    <many-to-one ref="com.axelor.auth.db.User" title="User" name="internalUser"/>
    <string title="Error" name="error" large="true"/>
    <string title="Cause" name="cause" large="true"/>
    <string title="Message" name="message" large="true"/>
    <string title="Trace" name="trace" large="true"/>
    <long name="batchId" title="Batch" />
    <string name="ref" title="Reference" />
    <long name="refId" title="Reference ID" nullable="true" />

    <string search="id,date" name="name" namecolumn="true">
		
			return this.id + " : " + this.date;  
		
    </string>
    
     <extra-code><![CDATA[
	
	// TYPE SELECT
	/**
	 * @deprecated With current implementation of TraceBackService, all exceptions of type
	 *     AxelorException are flagged as functional exceptions. However there are many cases of
	 *     misuses of AxelorException due to confusion between TYPE and CATEGORY.
	 */
	@Deprecated
	public static final int TYPE_TECHNICAL = 0;
	/**
	 * @deprecated With current implementation of TraceBackService, all exceptions of type
	 *     AxelorException are flagged as functional exceptions. However there are many cases of
	 *     misuses of AxelorException due to confusion between TYPE and CATEGORY.
	 */
	@Deprecated
	public static final int TYPE_FUNCTIONNAL = 1;
	
	// CATEGORY SELECT
	public static final int CATEGORY_MISSING_FIELD = 1;
	public static final int CATEGORY_NO_UNIQUE_KEY = 2;
	public static final int CATEGORY_NO_VALUE = 3;
	public static final int CATEGORY_CONFIGURATION_ERROR = 4;
	public static final int CATEGORY_INCONSISTENCY = 5;
	
	]]></extra-code>
    
  </entity>
</domain-models>
