Inerithance

91 views
Skip to first unread message

Paolo

unread,
Dec 15, 2010, 4:00:08 PM12/15/10
to ORMLite Developers
Hi,

I have a class abstract A, and two class B and C which ineriths from
A.

Which is the sintax, if is it possible, to create two table B and C
with columns the members ineriths from A (whitout create table A) ?

Is it possible ?!?!?

Thanks

Gray Watson

unread,
Dec 15, 2010, 4:14:31 PM12/15/10
to ormli...@googlegroups.com
On Dec 15, 2010, at 4:00 PM, Paolo wrote:

> I have a class abstract A, and two class B and C which inherits from
> A.
>
> Which is the syntax, if is it possible, to create two table B and C


> with columns the members ineriths from A (whitout create table A) ?

The fields in A (really in any super-classes), marked with @DatabaseField, will be stored in B and C like they were fields in those classes. This was added in version 4.3.

gray

Paolo

unread,
Dec 16, 2010, 8:15:01 AM12/16/10
to ORMLite Developers
Yes, but I don't want to create the A table. Declaring A as abstract
is the right way?

Gray Watson

unread,
Dec 16, 2010, 8:55:37 AM12/16/10
to ormli...@googlegroups.com
On Dec 16, 2010, at 8:15 AM, Paolo wrote:

> Yes, but I don't want to create the A table. Declaring A as abstract is the right way?

Yes. It won't create the A table unless you tell it to. The B and C tables will just contain A's fields.
gray


Reply all
Reply to author
Forward
0 new messages