readthefuckingmanual.net

[SOLVED] org.hibernate.HibernateException: Wrong column type in public.tablename for column columnname. Found: bpchar, expected: varchar(32)

Error added: 2008-03-05T11:53:06Z

1 people waiting for the answer...

3 answers found.

Answer 1875 (50.0% helpful)

Errr, no — my Previous answer is not working...
I found out it worked independently of String/char[] thing – when:

@Id // or whatever
@Column(columnDefinition = "bpchar")
private String columnname;
Permalink

Answer 1874 (33.333332% helpful)

If you can not alter your table structure, make modifications in your Java class:
use char[] rather than String

i.e.

//////////////////////
@Id // or whatever
private String columnname;
//////////////////////

becomes

//////////////////////
@Id // or whatever
private char[] columname;
//////////////////////
Permalink

Answer 533 (0.0% helpful)

Change the type of columnname in public.tablename from character to character varying
Permalink

Add an answer/solution

If you know the answer, please add your own solution below.
If you don't know, but find out later, please come back and share your answer - there will be other people struggling with this too.


Please enter 61948 here

If you want to be notified via email when this is solved, enter your email address here: