openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Zhi Xie <daxie...@gmail.com>
Subject Re: Existing column XXX on table XXXX is incompatible with the same column in the given schema definition.
Date Tue, 28 Aug 2012 00:53:29 GMT
Do you mean

@ManyToMany(cascade={CascadeType.PERSIST, CascadeType.MERGE})
@JoinTable(name="user_group", joinColumns=@JoinColumn(name="uName",
referencedColumnName="id", nullable=false) @Column(length=128)),
inverseJoinColumns=@JoinColumn(name="gName", referencedColumnName = "id")
@Column(length=256)) private Set<Group> groupsField;

It's not correct. Could you tell me the correct one?

2012/8/28 Albert Lee <allee8285@gmail.com>

> You can try annotate the length of the id column uName in the Entity with
> @Column(length=127) to match the length in the join table, assuming you can
> not change the join table's column length.
>
>
> On Mon, Aug 27, 2012 at 9:10 AM, Zhi Xie <daxiezhi@gmail.com> wrote:
>
> > I have met a problem using openjpa2.1.1.
> > I have defined a JoinTable "user_group" with a JoinColumn "uName", the
> >  uName is a column of Table user defined varchar(128). But there is not a
> > length attribute inJoinColumn. So the default value 255 is set on the
> > JoinColumn
> > uName.
> >
> > My question is how to avoid the warning.
> >
> > WARN  [Schema] Existing column "uName" on table "test.user_group" is
> > incompatible with the same column in the given schema definition.
> Existing
> > column:
> > Full Name: user_group.uName
> > Type: varchar
> > Size: 128
> > Default: null
> > Not Null: true
> > Given column:
> > Full Name: user_group.uName
> > Type: varchar
> > Size: 255
> > Default: null
> > Not Null: true
> >
> > I want to find a solution to avoid the warning.
> > Could anybody give me any comment?
> > --
> > Best Regards
> > Gary
> >
>
>
>
> --
> Albert Lee.
>



-- 
Best Regards
Gary

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message