You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openmeetings.apache.org by "seba.wagner@gmail.com" <se...@gmail.com> on 2013/02/05 05:55:23 UTC

No foreign columns created by openJPA

Hi,

we are using InnoDB, however OpenJPA does not create a single Foreign key.
It does already create indice's (at least for some or even the majority).
But the FK's are not created when the schema is populated to the database.
Is there any setting we have overseen or is this a desired behaviour
because of some other requirement?

Thanks!
Sebastian
-- 
Sebastian Wagner
https://twitter.com/#!/dead_lock
http://www.webbase-design.de
http://www.wagner-sebastian.com
seba.wagner@gmail.com

Re: No foreign columns created by openJPA

Posted by Maxim Solodovnik <so...@gmail.com>.
Should I try to add the property? or you will do it yourself?


On Tue, Feb 5, 2013 at 12:46 PM, seba.wagner@gmail.com <
seba.wagner@gmail.com> wrote:

> I think we should investigate a bit further before we start to add this
> annotation
> will ping the openJPA list
>
> Sebastian
>
>
> 2013/2/5 Maxim Solodovnik <so...@gmail.com>
>
> > So we need to add ForeignKey annotations?
> > Or maybe we can write to openjpa mailing list first?
> >
> >
> > On Tue, Feb 5, 2013 at 12:23 PM, seba.wagner@gmail.com <
> > seba.wagner@gmail.com> wrote:
> >
> > >
> > >
> >
> http://openjpa.apache.org/builds/2.2.1/apache-openjpa/docs/ref_guide_mapping_jpa.html#ref_guide_mapping_jpa_fk
> > >
> > >
> > > 2013/2/5 seba.wagner@gmail.com <se...@gmail.com>
> > >
> > > > There is an annotation @ForeignKey that you can set at each
> attribute.
> > > > But I also thought it would happen automatically for those attributes
> > > that
> > > > are defined as @ManyToOne, @OneToMany or @ManyToMany. Those seem to
> > have
> > > > also the Indices correctly set. Just FK's missing.
> > > >
> > > > Sebastian
> > > >
> > > >
> > > > 2013/2/5 Maxim Solodovnik <so...@gmail.com>
> > > >
> > > >> It is weird, I was sure OpenJPA should create all PK, FK and Indices
> > :(
> > > >>
> > > >>
> > > >> On Tue, Feb 5, 2013 at 11:55 AM, seba.wagner@gmail.com <
> > > >> seba.wagner@gmail.com> wrote:
> > > >>
> > > >> > Hi,
> > > >> >
> > > >> > we are using InnoDB, however OpenJPA does not create a single
> > Foreign
> > > >> key.
> > > >> > It does already create indice's (at least for some or even the
> > > >> majority).
> > > >> > But the FK's are not created when the schema is populated to the
> > > >> database.
> > > >> > Is there any setting we have overseen or is this a desired
> behaviour
> > > >> > because of some other requirement?
> > > >> >
> > > >> > Thanks!
> > > >> > Sebastian
> > > >> > --
> > > >> > Sebastian Wagner
> > > >> > https://twitter.com/#!/dead_lock
> > > >> > http://www.webbase-design.de
> > > >> > http://www.wagner-sebastian.com
> > > >> > seba.wagner@gmail.com
> > > >> >
> > > >>
> > > >>
> > > >>
> > > >> --
> > > >> WBR
> > > >> Maxim aka solomax
> > > >>
> > > >
> > > >
> > > >
> > > > --
> > > > Sebastian Wagner
> > > > https://twitter.com/#!/dead_lock
> > > > http://www.webbase-design.de
> > > > http://www.wagner-sebastian.com
> > > > seba.wagner@gmail.com
> > > >
> > >
> > >
> > >
> > > --
> > > Sebastian Wagner
> > > https://twitter.com/#!/dead_lock
> > > http://www.webbase-design.de
> > > http://www.wagner-sebastian.com
> > > seba.wagner@gmail.com
> > >
> >
> >
> >
> > --
> > WBR
> > Maxim aka solomax
> >
>
>
>
> --
> Sebastian Wagner
> https://twitter.com/#!/dead_lock
> http://www.webbase-design.de
> http://www.wagner-sebastian.com
> seba.wagner@gmail.com
>



-- 
WBR
Maxim aka solomax

Re: No foreign columns created by openJPA

Posted by "seba.wagner@gmail.com" <se...@gmail.com>.
I think we should investigate a bit further before we start to add this
annotation
will ping the openJPA list

Sebastian


2013/2/5 Maxim Solodovnik <so...@gmail.com>

> So we need to add ForeignKey annotations?
> Or maybe we can write to openjpa mailing list first?
>
>
> On Tue, Feb 5, 2013 at 12:23 PM, seba.wagner@gmail.com <
> seba.wagner@gmail.com> wrote:
>
> >
> >
> http://openjpa.apache.org/builds/2.2.1/apache-openjpa/docs/ref_guide_mapping_jpa.html#ref_guide_mapping_jpa_fk
> >
> >
> > 2013/2/5 seba.wagner@gmail.com <se...@gmail.com>
> >
> > > There is an annotation @ForeignKey that you can set at each attribute.
> > > But I also thought it would happen automatically for those attributes
> > that
> > > are defined as @ManyToOne, @OneToMany or @ManyToMany. Those seem to
> have
> > > also the Indices correctly set. Just FK's missing.
> > >
> > > Sebastian
> > >
> > >
> > > 2013/2/5 Maxim Solodovnik <so...@gmail.com>
> > >
> > >> It is weird, I was sure OpenJPA should create all PK, FK and Indices
> :(
> > >>
> > >>
> > >> On Tue, Feb 5, 2013 at 11:55 AM, seba.wagner@gmail.com <
> > >> seba.wagner@gmail.com> wrote:
> > >>
> > >> > Hi,
> > >> >
> > >> > we are using InnoDB, however OpenJPA does not create a single
> Foreign
> > >> key.
> > >> > It does already create indice's (at least for some or even the
> > >> majority).
> > >> > But the FK's are not created when the schema is populated to the
> > >> database.
> > >> > Is there any setting we have overseen or is this a desired behaviour
> > >> > because of some other requirement?
> > >> >
> > >> > Thanks!
> > >> > Sebastian
> > >> > --
> > >> > Sebastian Wagner
> > >> > https://twitter.com/#!/dead_lock
> > >> > http://www.webbase-design.de
> > >> > http://www.wagner-sebastian.com
> > >> > seba.wagner@gmail.com
> > >> >
> > >>
> > >>
> > >>
> > >> --
> > >> WBR
> > >> Maxim aka solomax
> > >>
> > >
> > >
> > >
> > > --
> > > Sebastian Wagner
> > > https://twitter.com/#!/dead_lock
> > > http://www.webbase-design.de
> > > http://www.wagner-sebastian.com
> > > seba.wagner@gmail.com
> > >
> >
> >
> >
> > --
> > Sebastian Wagner
> > https://twitter.com/#!/dead_lock
> > http://www.webbase-design.de
> > http://www.wagner-sebastian.com
> > seba.wagner@gmail.com
> >
>
>
>
> --
> WBR
> Maxim aka solomax
>



-- 
Sebastian Wagner
https://twitter.com/#!/dead_lock
http://www.webbase-design.de
http://www.wagner-sebastian.com
seba.wagner@gmail.com

Re: No foreign columns created by openJPA

Posted by Maxim Solodovnik <so...@gmail.com>.
So we need to add ForeignKey annotations?
Or maybe we can write to openjpa mailing list first?


On Tue, Feb 5, 2013 at 12:23 PM, seba.wagner@gmail.com <
seba.wagner@gmail.com> wrote:

>
> http://openjpa.apache.org/builds/2.2.1/apache-openjpa/docs/ref_guide_mapping_jpa.html#ref_guide_mapping_jpa_fk
>
>
> 2013/2/5 seba.wagner@gmail.com <se...@gmail.com>
>
> > There is an annotation @ForeignKey that you can set at each attribute.
> > But I also thought it would happen automatically for those attributes
> that
> > are defined as @ManyToOne, @OneToMany or @ManyToMany. Those seem to have
> > also the Indices correctly set. Just FK's missing.
> >
> > Sebastian
> >
> >
> > 2013/2/5 Maxim Solodovnik <so...@gmail.com>
> >
> >> It is weird, I was sure OpenJPA should create all PK, FK and Indices :(
> >>
> >>
> >> On Tue, Feb 5, 2013 at 11:55 AM, seba.wagner@gmail.com <
> >> seba.wagner@gmail.com> wrote:
> >>
> >> > Hi,
> >> >
> >> > we are using InnoDB, however OpenJPA does not create a single Foreign
> >> key.
> >> > It does already create indice's (at least for some or even the
> >> majority).
> >> > But the FK's are not created when the schema is populated to the
> >> database.
> >> > Is there any setting we have overseen or is this a desired behaviour
> >> > because of some other requirement?
> >> >
> >> > Thanks!
> >> > Sebastian
> >> > --
> >> > Sebastian Wagner
> >> > https://twitter.com/#!/dead_lock
> >> > http://www.webbase-design.de
> >> > http://www.wagner-sebastian.com
> >> > seba.wagner@gmail.com
> >> >
> >>
> >>
> >>
> >> --
> >> WBR
> >> Maxim aka solomax
> >>
> >
> >
> >
> > --
> > Sebastian Wagner
> > https://twitter.com/#!/dead_lock
> > http://www.webbase-design.de
> > http://www.wagner-sebastian.com
> > seba.wagner@gmail.com
> >
>
>
>
> --
> Sebastian Wagner
> https://twitter.com/#!/dead_lock
> http://www.webbase-design.de
> http://www.wagner-sebastian.com
> seba.wagner@gmail.com
>



-- 
WBR
Maxim aka solomax

Re: No foreign columns created by openJPA

Posted by "seba.wagner@gmail.com" <se...@gmail.com>.
http://openjpa.apache.org/builds/2.2.1/apache-openjpa/docs/ref_guide_mapping_jpa.html#ref_guide_mapping_jpa_fk


2013/2/5 seba.wagner@gmail.com <se...@gmail.com>

> There is an annotation @ForeignKey that you can set at each attribute.
> But I also thought it would happen automatically for those attributes that
> are defined as @ManyToOne, @OneToMany or @ManyToMany. Those seem to have
> also the Indices correctly set. Just FK's missing.
>
> Sebastian
>
>
> 2013/2/5 Maxim Solodovnik <so...@gmail.com>
>
>> It is weird, I was sure OpenJPA should create all PK, FK and Indices :(
>>
>>
>> On Tue, Feb 5, 2013 at 11:55 AM, seba.wagner@gmail.com <
>> seba.wagner@gmail.com> wrote:
>>
>> > Hi,
>> >
>> > we are using InnoDB, however OpenJPA does not create a single Foreign
>> key.
>> > It does already create indice's (at least for some or even the
>> majority).
>> > But the FK's are not created when the schema is populated to the
>> database.
>> > Is there any setting we have overseen or is this a desired behaviour
>> > because of some other requirement?
>> >
>> > Thanks!
>> > Sebastian
>> > --
>> > Sebastian Wagner
>> > https://twitter.com/#!/dead_lock
>> > http://www.webbase-design.de
>> > http://www.wagner-sebastian.com
>> > seba.wagner@gmail.com
>> >
>>
>>
>>
>> --
>> WBR
>> Maxim aka solomax
>>
>
>
>
> --
> Sebastian Wagner
> https://twitter.com/#!/dead_lock
> http://www.webbase-design.de
> http://www.wagner-sebastian.com
> seba.wagner@gmail.com
>



-- 
Sebastian Wagner
https://twitter.com/#!/dead_lock
http://www.webbase-design.de
http://www.wagner-sebastian.com
seba.wagner@gmail.com

Re: No foreign columns created by openJPA

Posted by "seba.wagner@gmail.com" <se...@gmail.com>.
There is an annotation @ForeignKey that you can set at each attribute.
But I also thought it would happen automatically for those attributes that
are defined as @ManyToOne, @OneToMany or @ManyToMany. Those seem to have
also the Indices correctly set. Just FK's missing.

Sebastian


2013/2/5 Maxim Solodovnik <so...@gmail.com>

> It is weird, I was sure OpenJPA should create all PK, FK and Indices :(
>
>
> On Tue, Feb 5, 2013 at 11:55 AM, seba.wagner@gmail.com <
> seba.wagner@gmail.com> wrote:
>
> > Hi,
> >
> > we are using InnoDB, however OpenJPA does not create a single Foreign
> key.
> > It does already create indice's (at least for some or even the majority).
> > But the FK's are not created when the schema is populated to the
> database.
> > Is there any setting we have overseen or is this a desired behaviour
> > because of some other requirement?
> >
> > Thanks!
> > Sebastian
> > --
> > Sebastian Wagner
> > https://twitter.com/#!/dead_lock
> > http://www.webbase-design.de
> > http://www.wagner-sebastian.com
> > seba.wagner@gmail.com
> >
>
>
>
> --
> WBR
> Maxim aka solomax
>



-- 
Sebastian Wagner
https://twitter.com/#!/dead_lock
http://www.webbase-design.de
http://www.wagner-sebastian.com
seba.wagner@gmail.com

Re: No foreign columns created by openJPA

Posted by Maxim Solodovnik <so...@gmail.com>.
It is weird, I was sure OpenJPA should create all PK, FK and Indices :(


On Tue, Feb 5, 2013 at 11:55 AM, seba.wagner@gmail.com <
seba.wagner@gmail.com> wrote:

> Hi,
>
> we are using InnoDB, however OpenJPA does not create a single Foreign key.
> It does already create indice's (at least for some or even the majority).
> But the FK's are not created when the schema is populated to the database.
> Is there any setting we have overseen or is this a desired behaviour
> because of some other requirement?
>
> Thanks!
> Sebastian
> --
> Sebastian Wagner
> https://twitter.com/#!/dead_lock
> http://www.webbase-design.de
> http://www.wagner-sebastian.com
> seba.wagner@gmail.com
>



-- 
WBR
Maxim aka solomax