问:
How to pass data from intent to callback?
I downloaded an react-native npm package which is android barcode scanner based on zxing library. However, it turned out that it was using a depricated method with Integrator. As a clue, it recommended to use ScanOptions and ScanContract. I don't know Java or Android, nevertheless I tried my best and this is what I have as of now:

so, there are three Java files in the folder of this native module:, module itself:
`

```<code>// BarcodeZxingScanModule.java

public class BarcodeZxingScanModule extends ReactContextBaseJavaModule implements ActivityEventListener {

    private final ReactApplicationContext reactContext;

    public BarcodeZxingScanModule(ReactApplicationContext reactContext) {
        super(reactContext);
        this.reactContext = reactContext;
    }

    @Override
    public String getName() {
        return "BarcodeZxingScan";
    }

    @ReactMethod
    public void sampleMethod(String stringArgument, Promise promise) {
        // TODO: Implement some actually useful functionality
        try {
            promise.resolve(stringArgument);
        } catch (Exception e) {
            promise.reject(e);
            //TODO: handle exception
        }
    }

    @ReactMethod
    public void showQrReader(Callback callback) {
//        ContinuousCaptureActivity captureActivity = new ContinuousCaptureActivity();
//
//        captureActivity.fragmentLauncher.launch(options);
        Callback mCallback = callback;
        //IntentIntegrator integrator = new IntentIntegrator(getCurrentActivity());
        //integrator.setOrientationLocked(true);
        //integrator.setCaptureActivity(ContinuousCaptureActivity.class);
         //integrator.initiateScan();

//

//        Intent intent = new Intent(getCurrentActivity(), ContinuousCaptureActivity.class);
//        reactContext.startActivity(intent);

        Intent intent = new Intent(getReactApplicationContext(), ContinuousCaptureActivity.class);
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        getReactApplicationContext().startActivityForResult(intent, 1, null);
        reactContext.addActivityEventListener(this);
    }

    @Override
    public void onActivityResult(Activity activity, int requestCode, int resultCode, Intent data) {
        Log.d("Barcode scanner :",  "data" + data);
    }

    @Override
    public void onNewIntent(Intent intent) {
    }

}

</code>```

`
package, that I haven't made any changes to :

`

```<code>public class BarcodeZxingScanPackage implements ReactPackage {
    @Override
    public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
        return Arrays.<NativeModule>asList(new BarcodeZxingScanModule(reactContext));
    }

    public List<Class<? extends JavaScriptModule>> createJSModules() {
        return null;
    }

    @Override
    public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
        return Collections.emptyList();
    }
}
</code>```

`
and activity:

`

```<code>public class ContinuousCaptureActivity extends AppCompatActivity {

    public final ActivityResultLauncher<ScanOptions> fragmentLauncher = registerForActivityResult(new ScanContract(),
            result -> {
                if(result.getContents() == null) {
                    Log.d("BarcodeReader", "info : " + result.getContents());

                } else {
                    Log.d("BarcodeReader", "info : " + result.getContents());
                    Intent intent = new Intent();
                    intent.putExtra("STRING", result.getContents());
                    setResult(this.RESULT_OK, intent);
                }
                finish();
            });
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        ScanOptions options = new ScanOptions();
        options.setDesiredBarcodeFormats(ScanOptions.DATA_MATRIX);
        options.setOrientationLocked(true);
        options.setBeepEnabled(false);
        options.setTorchEnabled(false);
        fragmentLauncher.launch(options);
    }

}
</code>```

`

as of now, I am getting log in the activity file, however, I need it to return that data to the callback that I am sending from react:

`

```<code>const BarcodeScanner = () => {

  const barcodeScanned = (data) => {
    console.log("Barcode ", data);
  };

  const handleClick = () => {
    console.log('starting the process')
    BarcodeZxingScan.showQrReader(barcodeScanned);
  };

  return (
    <View>
      <TouchableOpacity
        onPress={() => handleClick()}
        style={{
          margin: 20,
          backgroundColor: "steelblue",
          justifyContent: "center",
          alignItems: "center",
        }}
      >
        <Text style={{ fontSize: 26 }}>SCAN</Text>
      </TouchableOpacity>
    </View>
  );
};

export default BarcodeScanner;
</code>```

`
how can I make this possible. Thank you!

I re-write the mail logic from Itgrator to Intent and all the code within activity class is new (based on ScanOptions and ScanContract)

Body:
I downloaded an react-native npm package which is android barcode scanner based on zxing library. However, it turned out that it was using a depricated method with Integrator. As a clue, it recommended to use ScanOptions and ScanContract. I don't know Java or Android, nevertheless I tried my best and this is what I have as of now:

so, there are three Java files in the folder of this native module:, module itself:
`

// BarcodeZxingScanModule.java

public class BarcodeZxingScanModule extends ReactContextBaseJavaModule implements ActivityEventListener {

    private final ReactApplicationContext reactContext;

    public BarcodeZxingScanModule(ReactApplicationContext reactContext) {
        super(reactContext);
        this.reactContext = reactContext;
    }

    @Override
    public String getName() {
        return "BarcodeZxingScan";
    }

    @ReactMethod
    public void sampleMethod(String stringArgument, Promise promise) {
        // TODO: Implement some actually useful functionality
        try {
            promise.resolve(stringArgument);
        } catch (Exception e) {
            promise.reject(e);
            //TODO: handle exception
        }
    }

    @ReactMethod
    public void showQrReader(Callback callback) {
//        ContinuousCaptureActivity captureActivity = new ContinuousCaptureActivity();
//
//        captureActivity.fragmentLauncher.launch(options);
        Callback mCallback = callback;
        //IntentIntegrator integrator = new IntentIntegrator(getCurrentActivity());
        //integrator.setOrientationLocked(true);
        //integrator.setCaptureActivity(ContinuousCaptureActivity.class);
         //integrator.initiateScan();

//

//        Intent intent = new Intent(getCurrentActivity(), ContinuousCaptureActivity.class);
//        reactContext.startActivity(intent);

        Intent intent = new Intent(getReactApplicationContext(), ContinuousCaptureActivity.class);
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        getReactApplicationContext().startActivityForResult(intent, 1, null);
        reactContext.addActivityEventListener(this);
    }

    @Override
    public void onActivityResult(Activity activity, int requestCode, int resultCode, Intent data) {
        Log.d("Barcode scanner :",  "data" + data);
    }

    @Override
    public void onNewIntent(Intent intent) {
    }

}

`
package, that I haven't made any changes to :

`

public class BarcodeZxingScanPackage implements ReactPackage {
    @Override
    public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
        return Arrays.<NativeModule>asList(new BarcodeZxingScanModule(reactContext));
    }

    public List<Class<? extends JavaScriptModule>> createJSModules() {
        return null;
    }

    @Override
    public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
        return Collections.emptyList();
    }
}

`
and activity:

`

public class ContinuousCaptureActivity extends AppCompatActivity {

    public final ActivityResultLauncher<ScanOptions> fragmentLauncher = registerForActivityResult(new ScanContract(),
            result -> {
                if(result.getContents() == null) {
                    Log.d("BarcodeReader", "info : " + result.getContents());

                } else {
                    Log.d("BarcodeReader", "info : " + result.getContents());
                    Intent intent = new Intent();
                    intent.putExtra("STRING", result.getContents());
                    setResult(this.RESULT_OK, intent);
                }
                finish();
            });
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        ScanOptions options = new ScanOptions();
        options.setDesiredBarcodeFormats(ScanOptions.DATA_MATRIX);
        options.setOrientationLocked(true);
        options.setBeepEnabled(false);
        options.setTorchEnabled(false);
        fragmentLauncher.launch(options);
    }

}

`

as of now, I am getting log in the activity file, however, I need it to return that data to the callback that I am sending from react:

`

const BarcodeScanner = () => {

  const barcodeScanned = (data) => {
    console.log("Barcode ", data);
  };

  const handleClick = () => {
    console.log('starting the process')
    BarcodeZxingScan.showQrReader(barcodeScanned);
  };

  return (
    <View>
      <TouchableOpacity
        onPress={() => handleClick()}
        style={{
          margin: 20,
          backgroundColor: "steelblue",
          justifyContent: "center",
          alignItems: "center",
        }}
      >
        <Text style={{ fontSize: 26 }}>SCAN</Text>
      </TouchableOpacity>
    </View>
  );
};

export default BarcodeScanner;

`
how can I make this possible. Thank you!

I re-write the mail logic from Itgrator to Intent and all the code within activity class is new (based on ScanOptions and ScanContract)


来源: stackexchange

问:
How to mock hierarchical methods having Db calls using Moq and Xunit
I have one service method with below syntax -

```<code>public async Task<List<responseModel>> SearchAsync(RequestModel request)
{
     var temp = await _dbservice.searchAsyncDB(request);
// manipulation with temp
 foreach(var i in temp)
   {
     // manipulation with i
      var order = await checkstatus(i.orders); // this is a private method call
   }
return order;
}
private async Task<someModel> CheckStatus(int orderNumbers)
{
// manipulation with ordernumber
  var model = await checkagain(orderNumber) // private call that has Database Call
}

private async Task<someModel> checkagain(int ordernumber)
{
var temp = await _dbservice.checkagainDB(); // database call
}
</code>```

Basically Multiple private methods with database call. Not sure if I can mock this using Moq or need to refactor the whole code.

ContentLicense: CC BY-SA 4.0

Body:
I have one service method with below syntax -

public async Task<List<responseModel>> SearchAsync(RequestModel request)
{
     var temp = await _dbservice.searchAsyncDB(request);
// manipulation with temp
 foreach(var i in temp)
   {
     // manipulation with i
      var order = await checkstatus(i.orders); // this is a private method call
   }
return order;
}
private async Task<someModel> CheckStatus(int orderNumbers)
{
// manipulation with ordernumber
  var model = await checkagain(orderNumber) // private call that has Database Call
}

private async Task<someModel> checkagain(int ordernumber)
{
var temp = await _dbservice.checkagainDB(); // database call
}

Basically Multiple private methods with database call. Not sure if I can mock this using Moq or need to refactor the whole code.


问:
Deploy and hosting blazor wsam with individual accounts
I create Blazor web assembly Withe individual accounts Option(SQL server).
It works fine on my computer. Register new user and login is fine.
But After Publish and Hosting error 500 appear and app not load.
What should I change during publish? I change connection string to server address and set database user name and password and then Update-DataBase.
But app cannot connect to DB and send error.
Thank you

I tried many ways, but unfortunately I did not get the result.


问:
Error SC424 connecting Make.com to google analytics
Ive added a new api app in GCS for GA4 & UA data connection to make.com. I granted credentials and added google analytics scope. The authorised redirect URI I used was https://www.integromat.com/oauth/cb/google/. I keep getting the following error when trying to connect make.com via the OAuth 2.0 module:

{"message":"The request failed due to failure of a previous request.","code":"SC424","suberrors":[{"message":"Account error (invalid_request)","name":"Error"}]}


问:
How can I pass event when addEventListener is in the loop?
I have the following code:

```<code>codeBox1.forEach(el => el.addEventListener("keyup", onKeyUpEvent(1, e)));
</code>```

It throws e is not defiend. Any idea how can I pass it?

Body:
I have the following code:

codeBox1.forEach(el => el.addEventListener("keyup", onKeyUpEvent(1, e)));

It throws e is not defiend. Any idea how can I pass it?


问:
How to add additional info from exclusive namespace that should be covered only in one tag
My initial input look that

```<code><option xmlns:currency="http://www.fpml.org/coding-scheme/external/iso4217">

<currency>eur</currency>

</option>
</code>```

But, according to external file, there no currency "eur", or "Eur", or "eUr" only EUR exist. So, my goal is when I synchronized with external file, and make sure that value will be according that external file. In our case "EUR" correct value. "eur" - not correct. And I wish use only those content which represents in our external document that has correct values.
I mean I just want that elements build by according external file.

Body:
My initial input look that

<option xmlns:currency="http://www.fpml.org/coding-scheme/external/iso4217">

<currency>eur</currency>

</option>

But, according to external file, there no currency "eur", or "Eur", or "eUr" only EUR exist. So, my goal is when I synchronized with external file, and make sure that value will be according that external file. In our case "EUR" correct value. "eur" - not correct. And I wish use only those content which represents in our external document that has correct values.
I mean I just want that elements build by according external file.


问:
I am use customtkinter and trying to add background image in GUI python
```<code>MyImage = PhotoImage(file='bg.png')

liMyImage = PhotoImage(file='bg.png')
</code>```

NameError: name 'PhotoImage' is not defined

Body:
MyImage = PhotoImage(file='bg.png')

liMyImage = PhotoImage(file='bg.png')

NameError: name 'PhotoImage' is not defined


问:
Decrypt JSEncrypt-encrypted message in Bash
What RSA encryption algorithm does JSEncrypt use? Is it no-oaep, PKCS1 padding? Could you please share any examples if you've ever tried to make these to work together?

I've found these issues on GitHub but noone ever answered those:

Please give any advice!

https://github.com/travist/jsencrypt/issues/265

https://github.com/travist/jsencrypt/issues/140

My code looks like this: a 4096B key

```<code>const rsaEncrypt = new rsaEncryptLong();
  rsaEncrypt.setKey(
`-----BEGIN PUBLIC KEY-----
MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAkxsGzTiD1hDlzOZXm/oa
Kto2HUniu7yWXnmpWF3oRCNn1LVvh49uNpkAuEuJgO0126HrW1Xurc6d+UOrvErn
GTAXmbTVXk+p68sYpHZN6/1kmuvJm9pFCVSj3ZoKpCddR6hDLfjpznb6arYgBH3e
60v63yofXS+uQLifZN2VPrTsCh5zgtrQZXxUCEbPDHDBoc/4WvtcBWdGlvr4D58n
yPzk0LacmJTpzuGAo/N/3KB7d7G13z/2qfjnUbBX1KAqu7pSYb7SVzvIfq69ahjX
heZJ3FeiwE1hFo4VRhBAwSANpx800NRb/v4vp9ZKsqhJZlH9Xd/93nhY4CQFecFV
HLrPLbRN58WvdRIZb38M/wNDKiQom3wKzhDvX2lEa0dLCyKoF1dQeJpTpKTAeC68
KV6gIJBlc/oB2tYm7uCEQEtz1WT0YlJUButse2l5Ht43xPTTdDjryHQNsQn+H4Qw
r1cQvGpNs/3s6vVPKOOnODIpyK0Vr/5CJGYfNIVXZWy01bGMDwwLzAeN1jlmY/cm
C1ipAhRm8eeDnJFdY73CLoy73L2wflnr+fIeMgT3YybI2iizGfeth2/p+f61EKDV
bs5+gpevT8mamdLxkt59yNTG/Hm6lfY4k+phweu3YZUBbNCdj/dAziWS34nJMJwP
EDUqOTarCNPcyijkZqwsvwMCAwEAAQ==
-----END PUBLIC KEY-----`
  );

  const rsaDecrypt = new rsaEncryptLong();
  rsaDecrypt.setKey(
`-----BEGIN RSA PRIVATE KEY-----
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
-----END RSA PRIVATE KEY-----`
  );

  const encryptedKey = rsaEncrypt.encrypt(key);

  console.log(encryptedKey, rsaDecrypt.decrypt(encryptedKey));
</code>```

I'm using rsa-jsencrypt-long additionally

Body:
What RSA encryption algorithm does JSEncrypt use? Is it no-oaep, PKCS1 padding? Could you please share any examples if you've ever tried to make these to work together?

I've found these issues on GitHub but noone ever answered those:

Please give any advice!

https://github.com/travist/jsencrypt/issues/265

https://github.com/travist/jsencrypt/issues/140

My code looks like this: a 4096B key

const rsaEncrypt = new rsaEncryptLong();
  rsaEncrypt.setKey(
`-----BEGIN PUBLIC KEY-----
MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAkxsGzTiD1hDlzOZXm/oa
Kto2HUniu7yWXnmpWF3oRCNn1LVvh49uNpkAuEuJgO0126HrW1Xurc6d+UOrvErn
GTAXmbTVXk+p68sYpHZN6/1kmuvJm9pFCVSj3ZoKpCddR6hDLfjpznb6arYgBH3e
60v63yofXS+uQLifZN2VPrTsCh5zgtrQZXxUCEbPDHDBoc/4WvtcBWdGlvr4D58n
yPzk0LacmJTpzuGAo/N/3KB7d7G13z/2qfjnUbBX1KAqu7pSYb7SVzvIfq69ahjX
heZJ3FeiwE1hFo4VRhBAwSANpx800NRb/v4vp9ZKsqhJZlH9Xd/93nhY4CQFecFV
HLrPLbRN58WvdRIZb38M/wNDKiQom3wKzhDvX2lEa0dLCyKoF1dQeJpTpKTAeC68
KV6gIJBlc/oB2tYm7uCEQEtz1WT0YlJUButse2l5Ht43xPTTdDjryHQNsQn+H4Qw
r1cQvGpNs/3s6vVPKOOnODIpyK0Vr/5CJGYfNIVXZWy01bGMDwwLzAeN1jlmY/cm
C1ipAhRm8eeDnJFdY73CLoy73L2wflnr+fIeMgT3YybI2iizGfeth2/p+f61EKDV
bs5+gpevT8mamdLxkt59yNTG/Hm6lfY4k+phweu3YZUBbNCdj/dAziWS34nJMJwP
EDUqOTarCNPcyijkZqwsvwMCAwEAAQ==
-----END PUBLIC KEY-----`
  );

  const rsaDecrypt = new rsaEncryptLong();
  rsaDecrypt.setKey(
`-----BEGIN RSA PRIVATE KEY-----
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
-----END RSA PRIVATE KEY-----`
  );

  const encryptedKey = rsaEncrypt.encrypt(key);

  console.log(encryptedKey, rsaDecrypt.decrypt(encryptedKey));

I'm using rsa-jsencrypt-long additionally


问:
Trying to transform psql commands from using pg to using Knex
I have tried to transform my psql commands from using pg to using Knex, but not successfully.

Here is my code:

```<code>createBill = async (transaction_date: string, category_id_1: number, amount_1: number, category_id_2: number, amount_2: number, category_id_3: number, amount_3: number, category_id_4: number, amount_4: number, category_id_5: number, amount_5: number, category_id_6: number, amount_6: number, category_id_7: number, amount_7: number, category_id_8: number, amount_8: number, category_id_9: number, amount_9: number, category_id_10: number, amount_10: number, category_id_11: number, amount_11: number, category_id_12: number, amount_12: number) => {
        const transactionDateQueryResult = await this.knex"expenses_table")
        .insert({transaction_date: transaction_date})
        .returning(["id"]);

 let id = transactionDateQueryResult[0].id;
        await this.knex("expenses_category_mapping")
        .insert({
            transaction_date_id: id,
            expense_category_id: category_id_1,
            amount: amount_1,
        })

        if(amount_2){
            await this.knex("expenses_category_mapping")
                .insert({
                    transaction_date_id: id,
                    expense_category_id: category_id_2,
                    amount: amount_2,
                })
        }

        if(amount_3){
            await this.knex("expenses_category_mapping")
                .insert({
                    transaction_date_id: id,
                    expense_category_id: category_id_3,
                    amount: amount_3,
                })
        }

        if(amount_4){
            await this.knex("expenses_category_mapping")
                .insert({
                    transaction_date_id: id,
                    expense_category_id: category_id_4,
                    amount: amount_4,
                })
        }

        if(amount_5){
            await this.knex("expenses_category_mapping")
                .insert({
                    transaction_date_id: id,
                    expense_category_id: category_id_5,
                    amount: amount_5,
                })
        }

        if(amount_6){
            await this.knex("expenses_category_mapping")
                .insert({
                    transaction_date_id: id,
                    expense_category_id: category_id_6,
                    amount: amount_6,
                })
        }

        if(amount_7){
            await this.knex("expenses_category_mapping")
                .insert({
                    transaction_date_id: id,
                    expense_category_id: category_id_7,
                    amount: amount_7,
                })
        }

        if(amount_8){
            await this.knex("expenses_category_mapping")
                .insert({
                    transaction_date_id: id,
                    expense_category_id: category_id_8,
                    amount: amount_8,
                })
        }

        if(amount_9){
            await this.knex("expenses_category_mapping")
                .insert({
                    transaction_date_id: id,
                    expense_category_id: category_id_9,
                    amount: amount_9,
                })
        }

        if(amount_10){
            await this.knex("expenses_category_mapping")
                .insert({
                    transaction_date_id: id,
                    expense_category_id: category_id_10,
                    amount: amount_10,
                })
        }

        if(amount_11){
            await this.knex("expenses_category_mapping")
                .insert({
                    transaction_date_id: id,
                    expense_category_id: category_id_11,
                    amount: amount_11,
                })
        }

        if(amount_12){
            await this.knex("expenses_category_mapping")
                .insert({
                    transaction_date_id: id,
                    expense_category_id: category_id_12,
                    amount: amount_12,
                })
        }
}

</code>```

My original pg version was:

```<code>createBill = async (transaction_date: string, category_id_1: number, amount_1: number, category_id_2: number, amount_2: number, category_id_3: number, amount_3: number, category_id_4: number, amount_4: number, category_id_5: number, amount_5: number, category_id_6: number, amount_6: number, category_id_7: number, amount_7: number, category_id_8: number, amount_8: number, category_id_9: number, amount_9: number, category_id_10: number, amount_10: number, category_id_11: number, amount_11: number, category_id_12: number, amount_12: number) => {
    const transactionDateQueryResult = await this.dbClient.query<Expense>(
        `INSERT INTO expenses_table (transaction_date) VALUES ($1) RETURNING id`,
        [transaction_date]
    );

    let id = transactionDateQueryResult.rows[0].id;
    const insertSQL1 = `INSERT INTO expense_category_mapping (transaction_date_id, expense_category_id, amount) VALUES ($1, $2, $3)`;
    const categoryPlusAmountQueryResult1 = await this.dbClient.query(insertSQL1, [id, category_id_1, amount_1]);

    if(amount_2){
        const insertSQL2 = `INSERT INTO expense_category_mapping (transaction_date_id, expense_category_id, amount) VALUES ($1, $2, $3)`;
        const categoryPlusAmountQueryResult2 = await this.dbClient.query(insertSQL2, [id, category_id_2, amount_2]);
        };

    if(amount_3){
        const insertSQL3 = `INSERT INTO expense_category_mapping (transaction_date_id, expense_category_id, amount) VALUES ($1, $2, $3)`;
        const categoryPlusAmountQueryResult3 = await this.dbClient.query(insertSQL3, [id, category_id_3, amount_3]);
        };

    if(amount_4){
        const insertSQL4 = `INSERT INTO expense_category_mapping (transaction_date_id, expense_category_id, amount) VALUES ($1, $2, $3)`;
        const categoryPlusAmountQueryResult4 = await this.dbClient.query(insertSQL4, [id, category_id_4, amount_4]);
        // console.log(category_id_4, amount_4);
        };

    if(amount_5){
        const insertSQL5 = `INSERT INTO expense_category_mapping (transaction_date_id, expense_category_id, amount) VALUES ($1, $2, $3)`;
        const categoryPlusAmountQueryResult5 = await this.dbClient.query(insertSQL5, [id, category_id_5, amount_5]);
        };

    if(amount_6){
        const insertSQL6 = `INSERT INTO expense_category_mapping (transaction_date_id, expense_category_id, amount) VALUES ($1, $2, $3)`;
        const categoryPlusAmountQueryResult6 = await this.dbClient.query(insertSQL6, [id, category_id_6, amount_6]);
        };

    if(amount_7){
        const insertSQL7 = `INSERT INTO expense_category_mapping (transaction_date_id, expense_category_id, amount) VALUES ($1, $2, $3)`;
        const categoryPlusAmountQueryResult7 = await this.dbClient.query(insertSQL7, [id, category_id_7, amount_7]);
        };

    if(amount_8){
        const insertSQL8 = `INSERT INTO expense_category_mapping (transaction_date_id, expense_category_id, amount) VALUES ($1, $2, $3)`;
        const categoryPlusAmountQueryResult8 = await this.dbClient.query(insertSQL8, [id, category_id_8, amount_8]);
        };

    if(amount_9){
        const insertSQL9 = `INSERT INTO expense_category_mapping (transaction_date_id, expense_category_id, amount) VALUES ($1, $2, $3)`;
        const categoryPlusAmountQueryResult9 = await this.dbClient.query(insertSQL9, [id, category_id_9, amount_9]);
        };

    if(amount_10){
        const insertSQL10 = `INSERT INTO expense_category_mapping (transaction_date_id, expense_category_id, amount) VALUES ($1, $2, $3)`;
        const categoryPlusAmountQueryResult10 = await this.dbClient.query(insertSQL10, [id, category_id_10, amount_10]);
        };

    if(amount_11){
        const insertSQL11 = `INSERT INTO expense_category_mapping (transaction_date_id, expense_category_id, amount) VALUES ($1, $2, $3)`;
        const categoryPlusAmountQueryResult11 = await this.dbClient.query(insertSQL11, [id, category_id_11, amount_11]);
        };

    if(amount_12){
        const insertSQL12 = `INSERT INTO expense_category_mapping (transaction_date_id, expense_category_id, amount) VALUES ($1, $2, $3)`;
        const categoryPlusAmountQueryResult12 = await this.dbClient.query(insertSQL12, [id, category_id_12, amount_12]);
        };
};
</code>```

It is expected to insert the transaction_date_id, expense_Category_id, and amount into the database.

Body:
I have tried to transform my psql commands from using pg to using Knex, but not successfully.

Here is my code:

createBill = async (transaction_date: string, category_id_1: number, amount_1: number, category_id_2: number, amount_2: number, category_id_3: number, amount_3: number, category_id_4: number, amount_4: number, category_id_5: number, amount_5: number, category_id_6: number, amount_6: number, category_id_7: number, amount_7: number, category_id_8: number, amount_8: number, category_id_9: number, amount_9: number, category_id_10: number, amount_10: number, category_id_11: number, amount_11: number, category_id_12: number, amount_12: number) => {
        const transactionDateQueryResult = await this.knex"expenses_table")
        .insert({transaction_date: transaction_date})
        .returning(["id"]);

 let id = transactionDateQueryResult[0].id;
        await this.knex("expenses_category_mapping")
        .insert({
            transaction_date_id: id,
            expense_category_id: category_id_1,
            amount: amount_1,
        })

        if(amount_2){
            await this.knex("expenses_category_mapping")
                .insert({
                    transaction_date_id: id,
                    expense_category_id: category_id_2,
                    amount: amount_2,
                })
        }

        if(amount_3){
            await this.knex("expenses_category_mapping")
                .insert({
                    transaction_date_id: id,
                    expense_category_id: category_id_3,
                    amount: amount_3,
                })
        }

        if(amount_4){
            await this.knex("expenses_category_mapping")
                .insert({
                    transaction_date_id: id,
                    expense_category_id: category_id_4,
                    amount: amount_4,
                })
        }

        if(amount_5){
            await this.knex("expenses_category_mapping")
                .insert({
                    transaction_date_id: id,
                    expense_category_id: category_id_5,
                    amount: amount_5,
                })
        }

        if(amount_6){
            await this.knex("expenses_category_mapping")
                .insert({
                    transaction_date_id: id,
                    expense_category_id: category_id_6,
                    amount: amount_6,
                })
        }

        if(amount_7){
            await this.knex("expenses_category_mapping")
                .insert({
                    transaction_date_id: id,
                    expense_category_id: category_id_7,
                    amount: amount_7,
                })
        }

        if(amount_8){
            await this.knex("expenses_category_mapping")
                .insert({
                    transaction_date_id: id,
                    expense_category_id: category_id_8,
                    amount: amount_8,
                })
        }

        if(amount_9){
            await this.knex("expenses_category_mapping")
                .insert({
                    transaction_date_id: id,
                    expense_category_id: category_id_9,
                    amount: amount_9,
                })
        }

        if(amount_10){
            await this.knex("expenses_category_mapping")
                .insert({
                    transaction_date_id: id,
                    expense_category_id: category_id_10,
                    amount: amount_10,
                })
        }

        if(amount_11){
            await this.knex("expenses_category_mapping")
                .insert({
                    transaction_date_id: id,
                    expense_category_id: category_id_11,
                    amount: amount_11,
                })
        }

        if(amount_12){
            await this.knex("expenses_category_mapping")
                .insert({
                    transaction_date_id: id,
                    expense_category_id: category_id_12,
                    amount: amount_12,
                })
        }
}

My original pg version was:

createBill = async (transaction_date: string, category_id_1: number, amount_1: number, category_id_2: number, amount_2: number, category_id_3: number, amount_3: number, category_id_4: number, amount_4: number, category_id_5: number, amount_5: number, category_id_6: number, amount_6: number, category_id_7: number, amount_7: number, category_id_8: number, amount_8: number, category_id_9: number, amount_9: number, category_id_10: number, amount_10: number, category_id_11: number, amount_11: number, category_id_12: number, amount_12: number) => {
    const transactionDateQueryResult = await this.dbClient.query<Expense>(
        `INSERT INTO expenses_table (transaction_date) VALUES ($1) RETURNING id`,
        [transaction_date]
    );

    let id = transactionDateQueryResult.rows[0].id;
    const insertSQL1 = `INSERT INTO expense_category_mapping (transaction_date_id, expense_category_id, amount) VALUES ($1, $2, $3)`;
    const categoryPlusAmountQueryResult1 = await this.dbClient.query(insertSQL1, [id, category_id_1, amount_1]);

    if(amount_2){
        const insertSQL2 = `INSERT INTO expense_category_mapping (transaction_date_id, expense_category_id, amount) VALUES ($1, $2, $3)`;
        const categoryPlusAmountQueryResult2 = await this.dbClient.query(insertSQL2, [id, category_id_2, amount_2]);
        };

    if(amount_3){
        const insertSQL3 = `INSERT INTO expense_category_mapping (transaction_date_id, expense_category_id, amount) VALUES ($1, $2, $3)`;
        const categoryPlusAmountQueryResult3 = await this.dbClient.query(insertSQL3, [id, category_id_3, amount_3]);
        };

    if(amount_4){
        const insertSQL4 = `INSERT INTO expense_category_mapping (transaction_date_id, expense_category_id, amount) VALUES ($1, $2, $3)`;
        const categoryPlusAmountQueryResult4 = await this.dbClient.query(insertSQL4, [id, category_id_4, amount_4]);
        // console.log(category_id_4, amount_4);
        };

    if(amount_5){
        const insertSQL5 = `INSERT INTO expense_category_mapping (transaction_date_id, expense_category_id, amount) VALUES ($1, $2, $3)`;
        const categoryPlusAmountQueryResult5 = await this.dbClient.query(insertSQL5, [id, category_id_5, amount_5]);
        };

    if(amount_6){
        const insertSQL6 = `INSERT INTO expense_category_mapping (transaction_date_id, expense_category_id, amount) VALUES ($1, $2, $3)`;
        const categoryPlusAmountQueryResult6 = await this.dbClient.query(insertSQL6, [id, category_id_6, amount_6]);
        };

    if(amount_7){
        const insertSQL7 = `INSERT INTO expense_category_mapping (transaction_date_id, expense_category_id, amount) VALUES ($1, $2, $3)`;
        const categoryPlusAmountQueryResult7 = await this.dbClient.query(insertSQL7, [id, category_id_7, amount_7]);
        };

    if(amount_8){
        const insertSQL8 = `INSERT INTO expense_category_mapping (transaction_date_id, expense_category_id, amount) VALUES ($1, $2, $3)`;
        const categoryPlusAmountQueryResult8 = await this.dbClient.query(insertSQL8, [id, category_id_8, amount_8]);
        };

    if(amount_9){
        const insertSQL9 = `INSERT INTO expense_category_mapping (transaction_date_id, expense_category_id, amount) VALUES ($1, $2, $3)`;
        const categoryPlusAmountQueryResult9 = await this.dbClient.query(insertSQL9, [id, category_id_9, amount_9]);
        };

    if(amount_10){
        const insertSQL10 = `INSERT INTO expense_category_mapping (transaction_date_id, expense_category_id, amount) VALUES ($1, $2, $3)`;
        const categoryPlusAmountQueryResult10 = await this.dbClient.query(insertSQL10, [id, category_id_10, amount_10]);
        };

    if(amount_11){
        const insertSQL11 = `INSERT INTO expense_category_mapping (transaction_date_id, expense_category_id, amount) VALUES ($1, $2, $3)`;
        const categoryPlusAmountQueryResult11 = await this.dbClient.query(insertSQL11, [id, category_id_11, amount_11]);
        };

    if(amount_12){
        const insertSQL12 = `INSERT INTO expense_category_mapping (transaction_date_id, expense_category_id, amount) VALUES ($1, $2, $3)`;
        const categoryPlusAmountQueryResult12 = await this.dbClient.query(insertSQL12, [id, category_id_12, amount_12]);
        };
};

It is expected to insert the transaction_date_id, expense_Category_id, and amount into the database.


Title: Python find data in a multitude of databases

Body:
I have databases for everyday since April 2021 to the end of September 2022 (except saturdays and sundays) and I have to check if one file contains a certain type of participant and make a counter that counts the number of days that have to represent it, as an example I do like this for the percentage of participants like that in each month:

import matplotlib.pyplot as plt
import pandas as pd

db = pd.read_csv('X:\\...\\data\\database\\2022-09-30_attendedParticipants.csv', encoding = "ISO-8859-1", header=None, sep=',')

#Days = list([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31])
X = list(["Abril21","May21", "Jun21", "Jul21", "Ago21", "Sep21", "Oct21", "Nov21", "Dic21", "Ene22", "Feb22", "Mar22", "Abr22", "May22", "Jun22", "Jul22", "Ago22", "Sep22"])

Y = list([round((((db[(db.iloc[:,3].str[:7] == "2021-04") & (db.iloc[:,23].str[:4] == "3") ].shape[0])/(db[(db.iloc[:,3].str[:7] == "2021-04") ].shape[0]))*100),2)
        ,round((((db[(db.iloc[:,3].str[:7] == "2021-05") & (db.iloc[:,23].str[:4] == "3") ].shape[0])/(db[(db.iloc[:,3].str[:7] == "2021-05") ].shape[0]))*100),2)
        ,round((((db[(db.iloc[:,3].str[:7] == "2021-06") & (db.iloc[:,23].str[:4] == "3") ].shape[0])/(db[(db.iloc[:,3].str[:7] == "2021-06") ].shape[0]))*100),2)
        ,round((((db[(db.iloc[:,3].str[:7] == "2021-07") & (db.iloc[:,23].str[:4] == "3") ].shape[0])/(db[(db.iloc[:,3].str[:7] == "2021-07") ].shape[0]))*100),2)
        ,round((((db[(db.iloc[:,3].str[:7] == "2021-08") & (db.iloc[:,23].str[:4] == "3") ].shape[0])/(db[(db.iloc[:,3].str[:7] == "2021-08") ].shape[0]))*100),2)
        ,round((((db[(db.iloc[:,3].str[:7] == "2021-09") & (db.iloc[:,23].str[:4] == "3") ].shape[0])/(db[(db.iloc[:,3].str[:7] == "2021-09") ].shape[0]))*100),2)
        ,round((((db[(db.iloc[:,3].str[:7] == "2021-10") & (db.iloc[:,23].str[:4] == "3") ].shape[0])/(db[(db.iloc[:,3].str[:7] == "2021-10") ].shape[0]))*100),2)
        ,round((((db[(db.iloc[:,3].str[:7] == "2021-11") & (db.iloc[:,23].str[:4] == "3") ].shape[0])/(db[(db.iloc[:,3].str[:7] == "2021-11") ].shape[0]))*100),2)
        ,round((((db[(db.iloc[:,3].str[:7] == "2021-12") & (db.iloc[:,23].str[:4] == "3") ].shape[0])/(db[(db.iloc[:,3].str[:7] == "2021-12") ].shape[0]))*100),2)
        ,round((((db[(db.iloc[:,3].str[:7] == "2022-01") & (db.iloc[:,23].str[:4] == "3") ].shape[0])/(db[(db.iloc[:,3].str[:7] == "2022-01") ].shape[0]))*100),2)
        ,round((((db[(db.iloc[:,3].str[:7] == "2022-02") & (db.iloc[:,23].str[:4] == "3") ].shape[0])/(db[(db.iloc[:,3].str[:7] == "2022-02") ].shape[0]))*100),2)
        ,round((((db[(db.iloc[:,3].str[:7] == "2022-03") & (db.iloc[:,23].str[:4] == "3") ].shape[0])/(db[(db.iloc[:,3].str[:7] == "2022-03") ].shape[0]))*100),2)
        ,round((((db[(db.iloc[:,3].str[:7] == "2022-04") & (db.iloc[:,23].str[:4] == "3") ].shape[0])/(db[(db.iloc[:,3].str[:7] == "2022-04") ].shape[0]))*100),2)
        ,round((((db[(db.iloc[:,3].str[:7] == "2022-05") & (db.iloc[:,23].str[:4] == "3") ].shape[0])/(db[(db.iloc[:,3].str[:7] == "2022-05") ].shape[0]))*100),2)
        ,round((((db[(db.iloc[:,3].str[:7] == "2022-06") & (db.iloc[:,23].str[:4] == "3") ].shape[0])/(db[(db.iloc[:,3].str[:7] == "2022-06") ].shape[0]))*100),2)
        ,round((((db[(db.iloc[:,3].str[:7] == "2022-07") & (db.iloc[:,23].str[:4] == "3") ].shape[0])/(db[(db.iloc[:,3].str[:7] == "2022-07") ].shape[0]))*100),2)
        ,round((((db[(db.iloc[:,3].str[:7] == "2022-08") & (db.iloc[:,23].str[:4] == "3") ].shape[0])/(db[(db.iloc[:,3].str[:7] == "2022-08") ].shape[0]))*100),2)
        ,round((((db[(db.iloc[:,3].str[:7] == "2022-09") & (db.iloc[:,23].str[:4] == "3") ].shape[0])/(db[(db.iloc[:,3].str[:7] == "2022-09") ].shape[0]*100),2)])

print("Show X")
print(X)
print("Show Y")
print(Y)
# Plot the data using bar() method
fig, ax= plt.subplots(figsize=(15,5), dpi=100)
#text
bars = ax.bar(X, Y)
ax.bar_label(bars)
for bars in ax.containers:
    ax.bar_label(bars)

#Labels
plt.bar(X, Y, color='y')
plt.title("Porcentage of days \n volunteers type 3")
plt.xlabel("Months")
plt.ylabel("Porcentage")

# Show the plot

plt.show()

But my dilema is how to get the days to do a porcentage of days that have those participants, and for that I thought of maybe a program that checks everyday file using

glob.glob(pathname, *, root_dir=None, dir_fd=None, recursive=False, include_hidden=False)

https://docs.python.org/3/library/glob.html

And create a counter for every month, so if a month has that its:

counterApril21=0
for i in db:
    if(((db.iloc[:,3].str[:7] == "2021-04") & (db.iloc[:,23].str[:4] == "3"))
           counterApril21=counterApril21+1

But I don't quite know how to put it together I was thinking:

example file name: 2021-08-27_attendedParticipants

dir_in = "X:/.../data/database/"
datab = glob.glob(dir_in + "/**/*attendedParticipants*", recursive=True)
datab = [word.replace("\\","/") for word in datab]

Then I would do the same as up but using the data in the counters:

Y = list([round(((counterApril21/30)*100),0),...])

Can anyone give me an example to brainstorm from? im feeling quite lost where to start.

My CSV example with fake data, also usually its just divided by comas instead of cells:
2021-08-27_attendedParticipants.csv


问:
I am getting an error while Knitting officedown for the first time
Below is what I am trying to knit

```<code>---
date: "`r Sys.Date()`"
author: "Your Name"
title: "officedown template"
output:
  officedown::rdocx_document
---

```r
library(officedown)
#> Warning: S3 method 'print.dml' was declared in NAMESPACE but not found
```
</code>```

And I am getting the following error

Rendering: C:/Users/Dell/Desktop/AmaniRM/officedown/page1.Rmd
Error in (function (toc = FALSE, toc_depth = 3, number_sections = FALSE,  :
unused arguments (lib_dir = "site_libs", self_contained = FALSE)
Calls:  ... create_output_format -> do.call ->  -> do.call
Execution halted

Can some one please help me

Body:
Below is what I am trying to knit

---
date: "`r Sys.Date()`"
author: "Your Name"
title: "officedown template"
output:
  officedown::rdocx_document
---

```r
library(officedown)
#> Warning: S3 method 'print.dml' was declared in NAMESPACE but not found
```

And I am getting the following error

Rendering: C:/Users/Dell/Desktop/AmaniRM/officedown/page1.Rmd
Error in (function (toc = FALSE, toc_depth = 3, number_sections = FALSE,  :
unused arguments (lib_dir = "site_libs", self_contained = FALSE)
Calls:  ... create_output_format -> do.call ->  -> do.call
Execution halted

Can some one please help me


问:
How to PIP install package in a GitHub repo on MWAA
I have made a python package and hosted it on GitHub,it gets installed fine in my local machine using pip install git+url , but when I put it in the requirements.txt for AWS MWAA it's not getting installed.

tried putting the git+url in requirements.txt working fine in local but not in MWAA


问:
How to prevent developers/admins from reading data while allowing users to access other users info
So I'm building an employee performance review system for my company using google Firebase/Firestore and Reactjs, and the HR department is requiring that I as the developer can't see or edit the data of the performance reviews on the firebase console, while they and the employee's direct manager can see the them.

P.S: the performance review consists of three parts: employee self review, manager review, and HR department review.

My best idea is to encrypt the data and store it the database using a unique secret for each user using their password and decrypt the data using that key.

My problem is that I can't figure out how to decrypt the data of the self review/manager review and show it the HR/manager since the data is decrypted using the employee/manager unique key.

P.S: it's basically a hierarchical system in which the manager and HR can see the employee's self review, while he can't see his review scores until the review has been finalized


问:
NotSerializableException when trying to add hibernate cacheable to JpaRepository method using Enum with custom @Converter
I'm trying to make my JpaReposiory method cacheable using hibernate. It is throwing exception because I'm using custom Converter on enum field I guess.

My JpaRepository method where I'm using org.hibernate.cacheable:

```<code>@QueryHints({@javax.persistence.QueryHint(name = "org.hibernate.cacheable", value = "true")})
@EntityGraph(attributePaths = {"ticketOffer.event.venue", "ticketOffer.seller", "buyer"}, type = EntityGraphType.FETCH)
List<TicketPurchase> findByOrderStatusInOrderByCreatedDateDesc(List<OrderStatus> orderStatuses);
</code>```

OrderStatus is enum in TicketPurchase class which uses custom @Converter:

```<code>@Convert(converter = OrderStatusConverter.class)
private OrderStatus orderStatus;
</code>```

Mu custom converter class:

```<code>@Converter
public class OrderStatusConverter implements AttributeConverter<OrderStatus, String> {
    @Override
    public String convertToDatabaseColumn(OrderStatus orderStatus) {
        return orderStatus.getCode();
    }

    @Override
    public OrderStatus convertToEntityAttribute(String dbData) {
        return OrderStatus.fromCode(dbData);
    }
}
</code>```

And my OrderStatus class:

```<code>public enum OrderStatus {
   ORDER_CANCELED_WITH_REFUND("-2"), ORDER_FAILED("-1"), ORDER_SUBMITTED("0"), ORDER_CONFIRMED_PAYMENT("1"), ORDER_IN_DELIVERY("2"), ORDER_DELIVERED("3"), ORDER_PAYMENT_SENT("4");

    private String code;

   OrderStatus(String code) {
        this.code = code;
    }

    public String getCode() {
        return code;
    }

    @Override
    public String toString() {
       return this.code;
    }

    public static OrderStatus fromCode(String code) {
        switch (code) {
        case "-2":
            return OrderStatus.ORDER_CANCELED_WITH_REFUND;

        case "-1":
            return OrderStatus.ORDER_FAILED;

        case "0":
            return OrderStatus.ORDER_SUBMITTED;

        case "1":
            return OrderStatus.ORDER_CONFIRMED_PAYMENT;

        case "2":
            return OrderStatus.ORDER_IN_DELIVERY;

        case "3":
            return OrderStatus.ORDER_DELIVERED;

        case "4":
            return OrderStatus.ORDER_PAYMENT_SENT;

        default:
            throw new IllegalArgumentException("Code [" + code + "] not supported.");
        }
    }
}
</code>```

Exception stack trace:

```org.ehcache.spi.resilience.StoreAccessException: org.ehcache.spi.serialization.SerializerException: java.io.NotSerializableException: org.hibernate.metamodel.model.convert.internal.JpaAttributeConverterImpl
    at org.ehcache.core.exceptions.StorePassThroughException.handleException(StorePassThroughException.java:78)
    at org.ehcache.impl.internal.store.offheap.AbstractOffHeapStore.computeWithRetry(AbstractOffHeapStore.java:1046)
    at org.ehcache.impl.internal.store.offheap.AbstractOffHeapStore.put(AbstractOffHeapStore.java:250)
    at org.ehcache.impl.internal.store.tiering.TieredStore.put(TieredStore.java:108)
    at org.ehcache.core.Ehcache.doPut(Ehcache.java:94)
    at org.ehcache.core.EhcacheBase.put(EhcacheBase.java:189)
    at org.ehcache.jsr107.Eh107Cache.put(Eh107Cache.java:175)
    at org.hibernate.cache.jcache.internal.JCacheAccessImpl.putIntoCache(JCacheAccessImpl.java:43)
    at org.hibernate.cache.spi.support.DirectAccessRegionTemplate.putIntoCache(DirectAccessRegionTemplate.java:44)
    at org.hibernate.cache.internal.QueryResultsCacheImpl.put(QueryResultsCacheImpl.java:92)
    at org.hibernate.loader.Loader.putResultInQueryCache(Loader.java:2831)
    at org.hibernate.loader.Loader.listUsingQueryCache(Loader.java:2714)
    at org.hibernate.loader.Loader.list(Loader.java:2674)
    at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:540)
    at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:400)
    at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:219)
    at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1459)
    at org.hibernate.query.internal.AbstractProducedQuery.doList(AbstractProducedQuery.java:1649)
    at org.hibernate.query.internal.AbstractProducedQuery.list(AbstractProducedQuery.java:1617)
    at org.hibernate.query.Query.getResultList(Query.java:165)
    at org.hibernate.query.criteria.internal.compile.CriteriaQueryTypeQueryAdapter.getResultList(CriteriaQueryTypeQueryAdapter.java:76)
    at jdk.internal.reflect.GeneratedMethodAccessor307.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:564)
    at org.springframework.orm.jpa.SharedEntityManagerCreator$DeferredQueryInvocationHandler.invoke(SharedEntityManagerCreator.java:406)
    at com.sun.proxy.$Proxy267.getResultList(Unknown Source)
    at org.springframework.data.jpa.repository.query.JpaQueryExecution$CollectionExecution.doExecute(JpaQueryExecution.java:128)
    at org.springframework.data.jpa.repository.query.JpaQueryExecution.execute(JpaQueryExecution.java:90)
    at org.springframework.data.jpa.repository.query.AbstractJpaQuery.doExecute(AbstractJpaQuery.java:155)
    at org.springframework.data.jpa.repository.query.AbstractJpaQuery.execute(AbstractJpaQuery.java:143)
    at org.springframework.data.repository.core.support.RepositoryMethodInvoker.doInvoke(RepositoryMethodInvoker.java:137)
    at org.springframework.data.repository.core.support.RepositoryMethodInvoker.invoke(RepositoryMethodInvoker.java:121)
    at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.doInvoke(QueryExecutorMethodInterceptor.java:159)
    at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.invoke(QueryExecutorMethodInterceptor.java:138)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
    at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:80)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
    at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123)
    at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
    at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:137)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
    at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:145)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
    at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215)
    at pl.alebilet.web.cc.$Proxy237.findByOrderStatusInOrderByCreatedDateDesc(Unknown Source)
    at pl.alebilet.web.cc.CcIndexController.handleDashboardRefresh(CcIndexController.java:60)
    at pl.alebilet.web.cc.CcIndexController$$FastClassBySpringCGLIB$$da9d0e9c.invoke(<generated>)
    at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:793)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)
    at org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:61)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)
    at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:708)
    at pl.alebilet.web.cc.CcIndexController$$EnhancerBySpringCGLIB$$2ea27fc5.handleDashboardRefresh(<generated>)
    at jdk.internal.reflect.GeneratedMethodAccessor310.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:564)
    at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
    at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150)
    at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808)
    at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1067)
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:963)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
    at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:655)
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:764)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
    at pl.alebilet.urllocale.UrlLocaleExtractorFilter.doFilter(UrlLocaleExtractorFilter.java:39)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
    at org.springframework.web.servlet.resource.ResourceUrlEncodingFilter.doFilter(ResourceUrlEncodingFilter.java:67)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:327)
    at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:115)
    at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:81)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
    at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:122)
    at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:116)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
    at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:126)
    at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:81)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
    at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:109)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
    at org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:102)
    at org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:93)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
    at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:149)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
    at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
    at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:219)
    at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:213)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
    at pl.alebilet.filters.AjaxLoginFilter.doFilterInternal(AjaxLoginFilter.java:23)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
    at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:219)
    at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:213)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
    at org.springframework.security.oauth2.client.web.OAuth2AuthorizationRequestRedirectFilter.doFilterInternal(OAuth2AuthorizationRequestRedirectFilter.java:178)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
    at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:103)
    at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:89)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
    at org.springframework.security.web.header.HeaderWriterFilter.doHeadersAfter(HeaderWriterFilter.java:90)
    at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:75)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
    at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:110)
    at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:80)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
    at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:55)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
    at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:211)
    at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:183)
    at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:354)
    at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:267)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
    at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
    at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360)
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399)
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:890)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1743)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
    at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.base/java.lang.Thread.run(Thread.java:832)
Caused by: org.ehcache.spi.serialization.SerializerException: java.io.NotSerializableException: org.hibernate.metamodel.model.convert.internal.JpaAttributeConverterImpl
    at org.ehcache.impl.serialization.PlainJavaSerializer.serialize(PlainJavaSerializer.java:51)
    at org.ehcache.impl.internal.store.offheap.portability.SerializerPortability.encode(SerializerPortability.java:39)
    at org.ehcache.shadow.org.terracotta.offheapstore.storage.PortabilityBasedStorageEngine.writeMapping(PortabilityBasedStorageEngine.java:63)
    at org.ehcache.shadow.org.terracotta.offheapstore.OffHeapHashMap.tryWriteEntry(OffHeapHashMap.java:699)
    at org.ehcache.shadow.org.terracotta.offheapstore.OffHeapHashMap.writeEntry(OffHeapHashMap.java:683)
    at org.ehcache.shadow.org.terracotta.offheapstore.OffHeapHashMap.computeWithMetadata(OffHeapHashMap.java:1958)
    at org.ehcache.shadow.org.terracotta.offheapstore.AbstractLockedOffHeapHashMap.computeWithMetadata(AbstractLockedOffHeapHashMap.java:520)
    at org.ehcache.shadow.org.terracotta.offheapstore.concurrent.AbstractConcurrentOffHeapMap.computeWithMetadata(AbstractConcurrentOffHeapMap.java:725)
    at org.ehcache.impl.internal.store.offheap.EhcacheConcurrentOffHeapClockCache.compute(EhcacheConcurrentOffHeapClockCache.java:152)
    at org.ehcache.impl.internal.store.offheap.AbstractOffHeapStore.computeWithRetry(AbstractOffHeapStore.java:1031)
    ... 163 more
Caused by: java.io.NotSerializableException: org.hibernate.metamodel.model.convert.internal.JpaAttributeConverterImpl
    at java.base/java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1193)
    at java.base/java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1579)
    at java.base/java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1536)
    at java.base/java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1444)
    at java.base/java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1187)
    at java.base/java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1579)
    at java.base/java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1536)
    at java.base/java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1444)
    at java.base/java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1187)
    at java.base/java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1579)
    at java.base/java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1536)
    at java.base/java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1444)
    at java.base/java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1187)
    at java.base/java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:353)
    at java.base/java.util.HashMap.internalWriteEntries(HashMap.java:1931)
    at java.base/java.util.HashMap.writeObject(HashMap.java:1501)
    at java.base/jdk.internal.reflect.GeneratedMethodAccessor198.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:564)
    at java.base/java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:1196)
    at java.base/java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1523)
    at java.base/java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1444)
    at java.base/java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1187)
    at java.base/java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1579)
    at java.base/java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1536)
    at java.base/java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1444)
    at java.base/java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1187)
    at java.base/java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:353)
    at org.ehcache.impl.serialization.PlainJavaSerializer.serialize(PlainJavaSerializer.java:49)
    ... 172 more
```

I want to make JpaRepository method cacheable using org.hibernate.cacheable where I'm using enum with custom @Converter as a query parameter. Any ideas what should I do with this?

Body:
I'm trying to make my JpaReposiory method cacheable using hibernate. It is throwing exception because I'm using custom Converter on enum field I guess.

My JpaRepository method where I'm using org.hibernate.cacheable:

@QueryHints({@javax.persistence.QueryHint(name = "org.hibernate.cacheable", value = "true")})
@EntityGraph(attributePaths = {"ticketOffer.event.venue", "ticketOffer.seller", "buyer"}, type = EntityGraphType.FETCH)
List<TicketPurchase> findByOrderStatusInOrderByCreatedDateDesc(List<OrderStatus> orderStatuses);

OrderStatus is enum in TicketPurchase class which uses custom @Converter:

@Convert(converter = OrderStatusConverter.class)
private OrderStatus orderStatus;

Mu custom converter class:

@Converter
public class OrderStatusConverter implements AttributeConverter<OrderStatus, String> {
    @Override
    public String convertToDatabaseColumn(OrderStatus orderStatus) {
        return orderStatus.getCode();
    }

    @Override
    public OrderStatus convertToEntityAttribute(String dbData) {
        return OrderStatus.fromCode(dbData);
    }
}

And my OrderStatus class:

public enum OrderStatus {
   ORDER_CANCELED_WITH_REFUND("-2"), ORDER_FAILED("-1"), ORDER_SUBMITTED("0"), ORDER_CONFIRMED_PAYMENT("1"), ORDER_IN_DELIVERY("2"), ORDER_DELIVERED("3"), ORDER_PAYMENT_SENT("4");

    private String code;

   OrderStatus(String code) {
        this.code = code;
    }

    public String getCode() {
        return code;
    }

    @Override
    public String toString() {
       return this.code;
    }

    public static OrderStatus fromCode(String code) {
        switch (code) {
        case "-2":
            return OrderStatus.ORDER_CANCELED_WITH_REFUND;

        case "-1":
            return OrderStatus.ORDER_FAILED;

        case "0":
            return OrderStatus.ORDER_SUBMITTED;

        case "1":
            return OrderStatus.ORDER_CONFIRMED_PAYMENT;

        case "2":
            return OrderStatus.ORDER_IN_DELIVERY;

        case "3":
            return OrderStatus.ORDER_DELIVERED;

        case "4":
            return OrderStatus.ORDER_PAYMENT_SENT;

        default:
            throw new IllegalArgumentException("Code [" + code + "] not supported.");
        }
    }
}

Exception stack trace:

org.ehcache.spi.resilience.StoreAccessException: org.ehcache.spi.serialization.SerializerException: java.io.NotSerializableException: org.hibernate.metamodel.model.convert.internal.JpaAttributeConverterImpl
    at org.ehcache.core.exceptions.StorePassThroughException.handleException(StorePassThroughException.java:78)
    at org.ehcache.impl.internal.store.offheap.AbstractOffHeapStore.computeWithRetry(AbstractOffHeapStore.java:1046)
    at org.ehcache.impl.internal.store.offheap.AbstractOffHeapStore.put(AbstractOffHeapStore.java:250)
    at org.ehcache.impl.internal.store.tiering.TieredStore.put(TieredStore.java:108)
    at org.ehcache.core.Ehcache.doPut(Ehcache.java:94)
    at org.ehcache.core.EhcacheBase.put(EhcacheBase.java:189)
    at org.ehcache.jsr107.Eh107Cache.put(Eh107Cache.java:175)
    at org.hibernate.cache.jcache.internal.JCacheAccessImpl.putIntoCache(JCacheAccessImpl.java:43)
    at org.hibernate.cache.spi.support.DirectAccessRegionTemplate.putIntoCache(DirectAccessRegionTemplate.java:44)
    at org.hibernate.cache.internal.QueryResultsCacheImpl.put(QueryResultsCacheImpl.java:92)
    at org.hibernate.loader.Loader.putResultInQueryCache(Loader.java:2831)
    at org.hibernate.loader.Loader.listUsingQueryCache(Loader.java:2714)
    at org.hibernate.loader.Loader.list(Loader.java:2674)
    at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:540)
    at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:400)
    at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:219)
    at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1459)
    at org.hibernate.query.internal.AbstractProducedQuery.doList(AbstractProducedQuery.java:1649)
    at org.hibernate.query.internal.AbstractProducedQuery.list(AbstractProducedQuery.java:1617)
    at org.hibernate.query.Query.getResultList(Query.java:165)
    at org.hibernate.query.criteria.internal.compile.CriteriaQueryTypeQueryAdapter.getResultList(CriteriaQueryTypeQueryAdapter.java:76)
    at jdk.internal.reflect.GeneratedMethodAccessor307.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:564)
    at org.springframework.orm.jpa.SharedEntityManagerCreator$DeferredQueryInvocationHandler.invoke(SharedEntityManagerCreator.java:406)
    at com.sun.proxy.$Proxy267.getResultList(Unknown Source)
    at org.springframework.data.jpa.repository.query.JpaQueryExecution$CollectionExecution.doExecute(JpaQueryExecution.java:128)
    at org.springframework.data.jpa.repository.query.JpaQueryExecution.execute(JpaQueryExecution.java:90)
    at org.springframework.data.jpa.repository.query.AbstractJpaQuery.doExecute(AbstractJpaQuery.java:155)
    at org.springframework.data.jpa.repository.query.AbstractJpaQuery.execute(AbstractJpaQuery.java:143)
    at org.springframework.data.repository.core.support.RepositoryMethodInvoker.doInvoke(RepositoryMethodInvoker.java:137)
    at org.springframework.data.repository.core.support.RepositoryMethodInvoker.invoke(RepositoryMethodInvoker.java:121)
    at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.doInvoke(QueryExecutorMethodInterceptor.java:159)
    at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.invoke(QueryExecutorMethodInterceptor.java:138)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
    at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:80)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
    at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123)
    at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
    at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:137)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
    at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:145)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
    at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215)
    at pl.alebilet.web.cc.$Proxy237.findByOrderStatusInOrderByCreatedDateDesc(Unknown Source)
    at pl.alebilet.web.cc.CcIndexController.handleDashboardRefresh(CcIndexController.java:60)
    at pl.alebilet.web.cc.CcIndexController$$FastClassBySpringCGLIB$$da9d0e9c.invoke(<generated>)
    at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:793)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)
    at org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:61)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)
    at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:708)
    at pl.alebilet.web.cc.CcIndexController$$EnhancerBySpringCGLIB$$2ea27fc5.handleDashboardRefresh(<generated>)
    at jdk.internal.reflect.GeneratedMethodAccessor310.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:564)
    at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
    at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150)
    at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808)
    at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1067)
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:963)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
    at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:655)
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:764)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
    at pl.alebilet.urllocale.UrlLocaleExtractorFilter.doFilter(UrlLocaleExtractorFilter.java:39)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
    at org.springframework.web.servlet.resource.ResourceUrlEncodingFilter.doFilter(ResourceUrlEncodingFilter.java:67)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:327)
    at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:115)
    at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:81)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
    at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:122)
    at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:116)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
    at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:126)
    at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:81)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
    at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:109)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
    at org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:102)
    at org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:93)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
    at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:149)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
    at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
    at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:219)
    at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:213)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
    at pl.alebilet.filters.AjaxLoginFilter.doFilterInternal(AjaxLoginFilter.java:23)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
    at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:219)
    at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:213)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
    at org.springframework.security.oauth2.client.web.OAuth2AuthorizationRequestRedirectFilter.doFilterInternal(OAuth2AuthorizationRequestRedirectFilter.java:178)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
    at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:103)
    at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:89)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
    at org.springframework.security.web.header.HeaderWriterFilter.doHeadersAfter(HeaderWriterFilter.java:90)
    at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:75)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
    at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:110)
    at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:80)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
    at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:55)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
    at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:211)
    at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:183)
    at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:354)
    at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:267)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
    at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
    at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360)
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399)
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:890)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1743)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
    at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.base/java.lang.Thread.run(Thread.java:832)
Caused by: org.ehcache.spi.serialization.SerializerException: java.io.NotSerializableException: org.hibernate.metamodel.model.convert.internal.JpaAttributeConverterImpl
    at org.ehcache.impl.serialization.PlainJavaSerializer.serialize(PlainJavaSerializer.java:51)
    at org.ehcache.impl.internal.store.offheap.portability.SerializerPortability.encode(SerializerPortability.java:39)
    at org.ehcache.shadow.org.terracotta.offheapstore.storage.PortabilityBasedStorageEngine.writeMapping(PortabilityBasedStorageEngine.java:63)
    at org.ehcache.shadow.org.terracotta.offheapstore.OffHeapHashMap.tryWriteEntry(OffHeapHashMap.java:699)
    at org.ehcache.shadow.org.terracotta.offheapstore.OffHeapHashMap.writeEntry(OffHeapHashMap.java:683)
    at org.ehcache.shadow.org.terracotta.offheapstore.OffHeapHashMap.computeWithMetadata(OffHeapHashMap.java:1958)
    at org.ehcache.shadow.org.terracotta.offheapstore.AbstractLockedOffHeapHashMap.computeWithMetadata(AbstractLockedOffHeapHashMap.java:520)
    at org.ehcache.shadow.org.terracotta.offheapstore.concurrent.AbstractConcurrentOffHeapMap.computeWithMetadata(AbstractConcurrentOffHeapMap.java:725)
    at org.ehcache.impl.internal.store.offheap.EhcacheConcurrentOffHeapClockCache.compute(EhcacheConcurrentOffHeapClockCache.java:152)
    at org.ehcache.impl.internal.store.offheap.AbstractOffHeapStore.computeWithRetry(AbstractOffHeapStore.java:1031)
    ... 163 more
Caused by: java.io.NotSerializableException: org.hibernate.metamodel.model.convert.internal.JpaAttributeConverterImpl
    at java.base/java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1193)
    at java.base/java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1579)
    at java.base/java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1536)
    at java.base/java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1444)
    at java.base/java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1187)
    at java.base/java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1579)
    at java.base/java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1536)
    at java.base/java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1444)
    at java.base/java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1187)
    at java.base/java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1579)
    at java.base/java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1536)
    at java.base/java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1444)
    at java.base/java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1187)
    at java.base/java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:353)
    at java.base/java.util.HashMap.internalWriteEntries(HashMap.java:1931)
    at java.base/java.util.HashMap.writeObject(HashMap.java:1501)
    at java.base/jdk.internal.reflect.GeneratedMethodAccessor198.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:564)
    at java.base/java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:1196)
    at java.base/java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1523)
    at java.base/java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1444)
    at java.base/java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1187)
    at java.base/java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1579)
    at java.base/java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1536)
    at java.base/java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1444)
    at java.base/java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1187)
    at java.base/java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:353)
    at org.ehcache.impl.serialization.PlainJavaSerializer.serialize(PlainJavaSerializer.java:49)
    ... 172 more

I want to make JpaRepository method cacheable using org.hibernate.cacheable where I'm using enum with custom @Converter as a query parameter. Any ideas what should I do with this?


问:
How to add auto positioning in popover from reactstrap
I have a popover through which I am displaying a drop down list. Currently the position is set to top. However the drop down is taking up too much space, so I want the popover to detect how much space is there and set the position accordingly.

Here is the code for popover:

```<code><Popover
          isOpen={this.state.showDropDown}
          target={`dropdownbutton-${id}`}
          toggle={this.toggle}
          className={`dropdown-with-tags-popover ${this.props.className}`}
          placement={this.props.placement || 'top'}
          flip={false}
        >
//code for list of users and search bar
</Popover>
</code>```

Please comment if further information is needed

Body:
I have a popover through which I am displaying a drop down list. Currently the position is set to top. However the drop down is taking up too much space, so I want the popover to detect how much space is there and set the position accordingly.

Here is the code for popover:

<Popover
          isOpen={this.state.showDropDown}
          target={`dropdownbutton-${id}`}
          toggle={this.toggle}
          className={`dropdown-with-tags-popover ${this.props.className}`}
          placement={this.props.placement || 'top'}
          flip={false}
        >
//code for list of users and search bar
</Popover>

Please comment if further information is needed