Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Dali » Couple of problems with generated ddl
Couple of problems with generated ddl [message #588778] Wed, 24 May 2006 14:11
Kevin Sutter is currently offline Kevin Sutter
Messages: 104
Registered: July 2009
Senior Member
Hi,
Now that I have the Kodo tutorial examples properly loading into Eclipse
(thanks to the workaround for bug 143301), I attempted to generate the ddl
for these examples. I ran into the following problems and am wondering
whether these are known conditions or not.

o The SPECIES field didn't get generated. My code looks like this. The
Persistence Properties panel looks good, so the Discriminator column is
being recognized. But, the ddl didn't create the SPECIES field.

//@Entity(name="Animal") // Bug 143301
@Entity
@Table(name="JPA_TUT_ANIMAL")
@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name="SPECIES", length=100)
public abstract class Animal
:

o The GENDER and EXPIRED fields were generated as BIT fields, instead of
CHAR fields as required by Derby. I have my Derby database attached to
this Project, but somehow the DDL generator didn't know which database it
was processing against and created invalid field types. From the Rabbit
class, here's the annotated source:

@Basic @Column(name="GENDER")
private boolean isFemale = false;

@Basic @Column(name="EXPIRED")
private boolean isDead = false;

o The EATER_ID field was not generated at all. This is also part of the
Rabbit class. It's part of the @ManyToOne relationship. I can't remember
if that is fully supported yet or not...

@ManyToOne @JoinColumn(name="EATER_ID")
private Snake eater;

o I also told the DDL generator to generate fully-qualified names
(checkbox on the ddl generator wizard), but I got syntax that dropped the
schema name. Derby didn't like this (not sure if other databases are more
lenient).

CREATE TABLE .JPA_TUT_ANIMAL ( ...
CREATE TABLE .RABBIT_CHILDREN ( ...
ALTER TABLE .JPA_TUT_ANIMAL ADD CONSTRAINT JPA_TUT_ANIMAL_pk PRIMARY
KEY
(ID);

Thanks,
Kevin
Previous Topic:Viewlet Demos Update for M3
Next Topic:@ManyToMany kind of working...
Goto Forum:
  


Current Time: Mon Sep 22 06:26:26 GMT 2014

Powered by FUDForum. Page generated in 0.01504 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software