-
Notifications
You must be signed in to change notification settings - Fork 369
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
Column types in child entities, specified via AttributeOverrides, are ignored #567
Comments
You're not using the latest version. In fact, you're using the 2.x branch that's no longer supported. You will have to upgrade to version 3.x to benefit from the latest features that will be added.
The
Why are you using both the The |
Sounds good, thank you. I'll switch to the really-latest version and research this a bit more :)
In this example, I have a base entity that captures common settings. Then, I have 4-5 other child entities for each specific database type. So in reality, it would be: public class BaseEntity {
@Type(JsonType.class)
@Column(columnDefinition = "json")
private Map<String, List<Object>> attributes;
} Then: public class OracleEntity extends BaseEntity {
}
public class MySQLEntity extends BaseEntity {
} The attribute-override is a strategy here to override stuff in the parent entity. For example, I can make MySQL work with |
If you can find a way to fix it, then send a Pull Request with the change proposal. |
Sweet, thank you! Should I close out this issue, or would you prefer to keep this open? |
Why close it if you want to fix it? Usually, an issue is closed when it's done. |
Using the latest version of
com.vladmihalcea:hibernate-types-60:2.21.1
, I have run into a strange scenario with Oracle-XE.Suppose there is this entity class:
Then a child entity:
The type parameter that is resolved for
MyEntity
is alwaysjson
; notvarchar2
.This happens here:
As it appears, column types do not consider overrides:
I don't know if this is really me doing strange things, or whether this is in fact something that could be supported, but figured you likely may want to review.
(If I do not use
varchar2
ornvarchar2
as the override type, the value in the DB is stored as HEX, and then cannot be used for querying, etc. I think this project also has issues decoding the hex value back to JSON).The text was updated successfully, but these errors were encountered: