2

I am working on a transaction table in MySQL, and according to some requirements I have to ALTER table (Transaction) and apply a partition on it (Year) wise, and (Sub-Partition) month-wise, and it worked successfully in MySQL workbench. the query I applied is,

 ALTER TABLE transaction
   PARTITION BY RANGE (YEAR(TransactionDate)) 
   SUBPARTITION BY KEY (month) 
   SUBPARTITIONS 12 (
      partition p0 VALUES LESS THAN (2021),
      partition p1 VALUES LESS THAN (2022),
      partition p2 VALUES LESS THAN (2023),
      partition p3 VALUES LESS THAN (2024),
      partition p4 VALUES LESS THAN (2025),
      partition p5 VALUES LESS THAN (2026),
      partition p6 VALUES LESS THAN  MAXVALUE
  )

Now after applying this query in mySql DB , I want to write a JPA query in spring boot in eclipse which like,

SELECT Address,Number FROM Transaction **partition(p1)** where CustomerId =1;

as mentioned between (*) just to highlight the word (partition), this query is working fine in MySQL , but Spring boot is not supporting word partition any idea how should use partition in spring boot JPA query

peerpressure
  • 390
  • 4
  • 19

0 Answers0