Error while inserting UUID array with PostgreSQL
up vote
1
down vote
favorite
I have an attribute in one of my entity class as below
@Column(name = "idc_reviewer", columnDefinition="_uuid")
private UUID reviewer;
While saving the entity, I am getting below error.
ERROR: column "idc_reviewer" is of type uuid but expression is of type bytea
Hint: You will need to rewrite or cast the expression.
I tried replacing columnDefinition with pg-uuid but that too didn't work.
Software Version:
Hibernate: 5.2.17
SpringBoot: 2.0.3
java postgresql hibernate spring-boot postgresql-10
add a comment |
up vote
1
down vote
favorite
I have an attribute in one of my entity class as below
@Column(name = "idc_reviewer", columnDefinition="_uuid")
private UUID reviewer;
While saving the entity, I am getting below error.
ERROR: column "idc_reviewer" is of type uuid but expression is of type bytea
Hint: You will need to rewrite or cast the expression.
I tried replacing columnDefinition with pg-uuid but that too didn't work.
Software Version:
Hibernate: 5.2.17
SpringBoot: 2.0.3
java postgresql hibernate spring-boot postgresql-10
How do you expect that postgres will store an array in a table column?
– M. Deinum
Nov 19 at 8:34
4
@M.Deinum: because Postgres supports it (but apparently Hibernate does not)
– a_horse_with_no_name
Nov 19 at 8:35
Hmm... Learned something new :). You probably need a custom type for this then. And of course Vlad has you already covered (see vladmihalcea.com/…).
– M. Deinum
Nov 19 at 9:49
@M.Deinum If there is no other approach, Thats a last option for me :)
– CuriousMind
Nov 19 at 10:30
Try adding my library to your dependencies. UUID types are something I haven't actually tested, so I'm curious of the result.
– coladict
Nov 26 at 19:06
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I have an attribute in one of my entity class as below
@Column(name = "idc_reviewer", columnDefinition="_uuid")
private UUID reviewer;
While saving the entity, I am getting below error.
ERROR: column "idc_reviewer" is of type uuid but expression is of type bytea
Hint: You will need to rewrite or cast the expression.
I tried replacing columnDefinition with pg-uuid but that too didn't work.
Software Version:
Hibernate: 5.2.17
SpringBoot: 2.0.3
java postgresql hibernate spring-boot postgresql-10
I have an attribute in one of my entity class as below
@Column(name = "idc_reviewer", columnDefinition="_uuid")
private UUID reviewer;
While saving the entity, I am getting below error.
ERROR: column "idc_reviewer" is of type uuid but expression is of type bytea
Hint: You will need to rewrite or cast the expression.
I tried replacing columnDefinition with pg-uuid but that too didn't work.
Software Version:
Hibernate: 5.2.17
SpringBoot: 2.0.3
java postgresql hibernate spring-boot postgresql-10
java postgresql hibernate spring-boot postgresql-10
edited Nov 19 at 8:37
asked Nov 19 at 8:33
CuriousMind
2,13522135
2,13522135
How do you expect that postgres will store an array in a table column?
– M. Deinum
Nov 19 at 8:34
4
@M.Deinum: because Postgres supports it (but apparently Hibernate does not)
– a_horse_with_no_name
Nov 19 at 8:35
Hmm... Learned something new :). You probably need a custom type for this then. And of course Vlad has you already covered (see vladmihalcea.com/…).
– M. Deinum
Nov 19 at 9:49
@M.Deinum If there is no other approach, Thats a last option for me :)
– CuriousMind
Nov 19 at 10:30
Try adding my library to your dependencies. UUID types are something I haven't actually tested, so I'm curious of the result.
– coladict
Nov 26 at 19:06
add a comment |
How do you expect that postgres will store an array in a table column?
– M. Deinum
Nov 19 at 8:34
4
@M.Deinum: because Postgres supports it (but apparently Hibernate does not)
– a_horse_with_no_name
Nov 19 at 8:35
Hmm... Learned something new :). You probably need a custom type for this then. And of course Vlad has you already covered (see vladmihalcea.com/…).
– M. Deinum
Nov 19 at 9:49
@M.Deinum If there is no other approach, Thats a last option for me :)
– CuriousMind
Nov 19 at 10:30
Try adding my library to your dependencies. UUID types are something I haven't actually tested, so I'm curious of the result.
– coladict
Nov 26 at 19:06
How do you expect that postgres will store an array in a table column?
– M. Deinum
Nov 19 at 8:34
How do you expect that postgres will store an array in a table column?
– M. Deinum
Nov 19 at 8:34
4
4
@M.Deinum: because Postgres supports it (but apparently Hibernate does not)
– a_horse_with_no_name
Nov 19 at 8:35
@M.Deinum: because Postgres supports it (but apparently Hibernate does not)
– a_horse_with_no_name
Nov 19 at 8:35
Hmm... Learned something new :). You probably need a custom type for this then. And of course Vlad has you already covered (see vladmihalcea.com/…).
– M. Deinum
Nov 19 at 9:49
Hmm... Learned something new :). You probably need a custom type for this then. And of course Vlad has you already covered (see vladmihalcea.com/…).
– M. Deinum
Nov 19 at 9:49
@M.Deinum If there is no other approach, Thats a last option for me :)
– CuriousMind
Nov 19 at 10:30
@M.Deinum If there is no other approach, Thats a last option for me :)
– CuriousMind
Nov 19 at 10:30
Try adding my library to your dependencies. UUID types are something I haven't actually tested, so I'm curious of the result.
– coladict
Nov 26 at 19:06
Try adding my library to your dependencies. UUID types are something I haven't actually tested, so I'm curious of the result.
– coladict
Nov 26 at 19:06
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53370908%2ferror-while-inserting-uuid-array-with-postgresql%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
How do you expect that postgres will store an array in a table column?
– M. Deinum
Nov 19 at 8:34
4
@M.Deinum: because Postgres supports it (but apparently Hibernate does not)
– a_horse_with_no_name
Nov 19 at 8:35
Hmm... Learned something new :). You probably need a custom type for this then. And of course Vlad has you already covered (see vladmihalcea.com/…).
– M. Deinum
Nov 19 at 9:49
@M.Deinum If there is no other approach, Thats a last option for me :)
– CuriousMind
Nov 19 at 10:30
Try adding my library to your dependencies. UUID types are something I haven't actually tested, so I'm curious of the result.
– coladict
Nov 26 at 19:06