Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error in getPropertyIndex #707

Open
orousseil opened this issue Apr 8, 2024 · 1 comment
Open

error in getPropertyIndex #707

orousseil opened this issue Apr 8, 2024 · 1 comment

Comments

@orousseil
Copy link

orousseil commented Apr 8, 2024

https://github.com/vladmihalcea/hypersistence-utils/blob/07e2682fe927f92592d5ba20242b79224104ba5b/hypersistence-utils-hibernate-55/src/main/java/io/hypersistence/utils/hibernate/type/money/MonetaryAmountType.java#L108C19-L108C27

according to me, it should be for case 1, "currency" and not "property" :

@Override
public int getPropertyIndex(String propertyName) {
    switch (propertyName) {
        case "amount": return 0;
        case "currency": return 1;
        default: throw new IllegalArgumentException("Unknown property name: " + propertyName);
    }
}
@vladmihalcea
Copy link
Owner

Try to provide a replicating test case as it's not clear how that issue would be triggered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants