peter petros

Greenhorn
+ Follow
since May 09, 2010
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by peter petros

Hi everyone,
I need help with an issue I’m facing.

The figure below shows a portion of my model.


Currently, I want to match records from MSG_EXC_REC with those in ERROR_MESSAGE.
Previously, we relied solely on the MSG_ID field for matching. However, we’ve observed that ERROR_MESSAGE contains multiple records with the same MSG_ID.
To resolve this, we’ve decided to use the following criteria for matching:
  • MSG_ID
  • DOMAIN
  • CORRE_ID
  • MSG_TYPE
  • SENDER (if in MSG_EXC_REC the value is BE in ERROR it van be ZZZ.BE)
  • RECIPIENT(if in MSG_EXC_REC the value is BE in ERROR it van be ZZZ.BE)


  • Moreover, in case of matching we get the record with the minimum received date from ERROR_MESSAGE having M_MIN_DATE <= MSG_REC_DATE.

    My existing code can be found below :


    Below you can find also a helper class to split in batches


    To support the modifications
    I have created a new class


    and I have modified the code as below


    However, with this approach, I would need to execute one query per row of criteria.
    Is there a more efficient way to perform this matching in batches? Additionally, in cases where multiple rows match, I’d like to apply a date comparison to determine the best match.

    Any guidance would be greatly appreciated!
    5 months ago
    There are materialised views in db.
    The code is just a demo class for explaining what is the issue.
    7 months ago
    Hi all,
    I have three materialized views in my project
    MV_MSG_EXC_REC_HISTORY : Summarizes message data for the past two years up to the beginning of the current year.
    MV_MSG_EXC_REC_RECENT : Summarizes message data from the beginning of the current year up to the current day.
    MV_MSG_EXC_REC_CURRENT_DAY : Summarizes messages for the current day, grouping by minute-level timestamps and updating based on the nearest half-hour.

    From the ui of the application I have two criteria, let it be "From" and "To"
    I want when user adds these criteria to translate it to Java in a Map<String, Pair<LocalDateTime, LocalDateTime>> which contains the name of the MV, the start_date and end_date in order to construct queries like below :
    eg.


    I want to have 4 cases :
    1. Both dates are filled then -> where min_date >= start_date and min_date <= end_date
    2. Left date is null then  -> where min_date <= end_date
    3. Right date is null then -> where min_date >= start_date
    4. Both dates null then -> no where clause

    Examples :
    Supposing I have the below ranges for all the cases
    MV_MSG_EXC_REC_HISTORY: 2022-01-01T00:00 - 2023-12-31T23:59:59.999
    MV_MSG_EXC_REC_RECENT: 2024-01-01T00:00 - 2024-11-04T23:59:59.999
    MV_MSG_EXC_REC_CURRENT_DAY: 2024-11-05T00:00 - 2024-11-05T07:30:00
    ====================
    Case 1
    And user selects the below from UI
    From: 2023-01-01T00:00:03
    To: 2024-10-10T03:56:04.235

    I want to make a Map<String, Pair<LocalDateTime, LocalDateTime>> like

    (the left date should be floored in minute level and the right date to be ceiled to next minute)

    Case 2
    And user selects the below from UI
    From: 2023-01-01T00:00:03
    To: 2024-12-31T03:56:04.235 (larger than current_date)
    ====================


    Case 3
    I have the below ranges
    MV_MSG_EXC_REC_HISTORY: 2022-01-01T00:00 - 2023-12-31T23:59:59.999
    MV_MSG_EXC_REC_RECENT: 2024-01-01T00:00 - 2024-11-04T23:59:59.999
    MV_MSG_EXC_REC_CURRENT_DAY: 2024-11-05T00:00 - 2024-11-05T07:30:00
    ====================
    And user selects the below from UI
    From: 2023-01-01T00:00:03
    To: 2024-11-03T03:56:04.235 (smaller than current_date)
    ====================



    My code is below :




    can you help me please to do the getMvNames to works as expected ?
    as now it works with MV ranges

    Thanks a lot
    7 months ago
    Hi, I have a class as follow :




    Until now, I had expressions with the operator on penultimate position ie BBB-CCC-DDD-LE-CC



    Now the operator can be on previous positions such as BBB-CCC-DDD-LE-AA-CC

    Could you help me please ?

    1 year ago

    Carey Brown wrote:What library are you using to interface with excel? POI?



    yes I am using org.apache.poi
    1 year ago
    Hello,
    I have a LocalDateTime field which I pass it as parameter in a method setCell of an interface (for creating excel) as below :



    When I open the excel I see that the column with the date cannot be sorted as expected as the value is defined as String
    2023-06-23T16:01:19.797

    Is there any way to replace the T with a space ?



    The method setCellValue is able to have as parameter one of the following classes
    Date, LocalDate, LocalDateTime, Calendar

    Could you help me please ?
    Thanks in advance
    1 year ago
    Hi all,
    I want to make an integration test and as first step I have to insert some data to a table.

    Let the table be 'TABLE_1' with the columns id (number) and comment (blob).

    I want to insert value 1 and a empty test.xlsx file.



    But I get the following error :
    Internal Exception: java.sql.SQLSyntaxErrorException: ORA-01704: string literal too long

    And I dont know if it is what I need.

    Can I make somehow differently ?

    For example creating a File and without having all this string ?

    Thanks in advance for your help
    Hi all,
    I am working on a multimodule application as follow :


    I want to read the file configuration.properties from TestService.java

    I have created the following code :



    and I call the method


    The problem is that I get NullPointerException as I cannot find the file.

    I tried to move the file in the same path with TestService.java and it works as expected

    Any ideas how to solve this problem ?

    Thanks in advance
    2 years ago
    Hi all, I am trying to make a method to return Map<Pair<String, String>, Set<String>>.
    But I don't know how ..

    Suppose I have a class called Person with attributes Name and Surname


    I also have a method which returns a list of Person objects


     
    I want to make a method returning the map which consists of
    Key : a Pair object phase_name and distinct Person name
    Value : an ordered set of surnames for the specific phase and Person name



    Expected, something like that :
      Map<Pair<"PHASE_1", "ADAM">, SET<"JOHNSON">>
      Map<Pair<"PHASE_1", "OLIVER">, SET<"JONES","SMITH">>
      Map<Pair<"PHASE_1", "JOHN">, SET<"JOHNSON">>

    Thanks in advance for your help
    2 years ago
    Hi all, I would like to save an image in an Image variable of a class.

    My class is the Student




    And in a form I have declared an array list : List<Student> list;
    And an JDesktopPane with a label included lbl_image   and a button called jMenuItem1


    How can I set the img to the database ?
    8 years ago
    Hi all,
    I have 20 jtable with names TABLE_1, ... ,TABLE_20   (in a pannelTab)
    In these tables I have data of list   List<STUDENT> students based on some criteria.

    Moreover, I am using 20 DefaultTableModel called model1, ...model20

    I want to click on a button and edit a row of the STUDENT but I don;t know how can I
    get the current tab in order to use the appropriate model.

    Could you help me please with an example ?

    8 years ago

    Paul Clapham wrote:In general I would recommend not mixing AWT components (e.g. Applet) with Swing components (e.g. JLabel). If you do you will see strange things happening. And in specific... do you have a question about that code? It's hard to do much without a question to answer.



    I changed my code to




    Questions
    1. I want the new game button to start the game from the beginning.
    I call init() but the image is not initialised.

    2. I would like the order of panels to be vertical structured like :
    New Game
    Grid
    moves

    Could someone help me please?>
    15 years ago
    Hi,
    I want to make an applet game like this on url :


    webpage

    Could someone help me please ???

    I am trying to write code but I don;t know good java.
    My code is :



    thanks a lot
    15 years ago