IDEMPIERE-6077: Translation of QueryMoreThanOneRecordsFound (#2282)

https://idempiere.atlassian.net/browse/IDEMPIERE-6077
This commit is contained in:
Nicolas Micoud 2024-03-30 04:02:46 +01:00 committed by Carlos Ruiz
parent 53e9c7161b
commit 0ffcc794b3
3 changed files with 21 additions and 3 deletions

View File

@ -0,0 +1,10 @@
-- IDEMPIERE-6077
SELECT register_migration_script('202403291639_IDEMPIERE-6077.sql') FROM dual;
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Mar 29, 2024, 4:39:08 PM CET
INSERT INTO AD_Message (MsgType,MsgText,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Message_ID,Value,EntityType,AD_Message_UU) VALUES ('I','The query returns more than one record',0,0,'Y',TO_TIMESTAMP('2024-03-29 16:39:08','YYYY-MM-DD HH24:MI:SS'),10,TO_TIMESTAMP('2024-03-29 16:39:08','YYYY-MM-DD HH24:MI:SS'),10,200880,'QueryMoreThanOneRecordsFound','D','f17d9113-2d74-4822-bfb2-21fa8db41021')
;

View File

@ -0,0 +1,7 @@
-- IDEMPIERE-6077
SELECT register_migration_script('202403291639_IDEMPIERE-6077.sql') FROM dual;
-- Mar 29, 2024, 4:39:08 PM CET
INSERT INTO AD_Message (MsgType,MsgText,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,AD_Message_ID,Value,EntityType,AD_Message_UU) VALUES ('I','The query returns more than one record',0,0,'Y',TO_TIMESTAMP('2024-03-29 16:39:08','YYYY-MM-DD HH24:MI:SS'),10,TO_TIMESTAMP('2024-03-29 16:39:08','YYYY-MM-DD HH24:MI:SS'),10,200880,'QueryMoreThanOneRecordsFound','D','f17d9113-2d74-4822-bfb2-21fa8db41021')
;

View File

@ -39,6 +39,7 @@ import org.adempiere.exceptions.DBException;
import org.compiere.util.CLogger; import org.compiere.util.CLogger;
import org.compiere.util.DB; import org.compiere.util.DB;
import org.compiere.util.Env; import org.compiere.util.Env;
import org.compiere.util.Msg;
import org.compiere.util.Util; import org.compiere.util.Util;
/** /**
@ -410,7 +411,7 @@ public class Query
} }
if (rs.next()) if (rs.next())
{ {
throw new DBException("QueryMoreThanOneRecordsFound"); // TODO : translate throw new DBException(Msg.getMsg(Env.getCtx(), "QueryMoreThanOneRecordsFound"));
} }
} }
catch (SQLException e) catch (SQLException e)
@ -483,7 +484,7 @@ public class Query
} }
if (assumeOnlyOneResult && rs.next()) if (assumeOnlyOneResult && rs.next())
{ {
throw new DBException("QueryMoreThanOneRecordsFound"); // TODO : translate throw new DBException(Msg.getMsg(Env.getCtx(), "QueryMoreThanOneRecordsFound"));
} }
} }
catch (SQLException e) catch (SQLException e)
@ -598,7 +599,7 @@ public class Query
} }
if (rs.next()) if (rs.next())
{ {
throw new DBException("QueryMoreThanOneRecordsFound"); // TODO : translate throw new DBException(Msg.getMsg(Env.getCtx(), "QueryMoreThanOneRecordsFound"));
} }
} }
catch (SQLException e) catch (SQLException e)