Discussion:
[Middlegen-user] relationship bug?
joe
2003-08-07 13:21:10 UTC
Permalink
hi,

i tried to create a relationship like this:

DBDesigner image: Loading Image...

or sql script:

CREATE TABLE Person (
idPerson INTEGER UNSIGNED NOT NULL,
idPersonOwner INTEGER UNSIGNED NOT NULL,
idPersonType INTEGER UNSIGNED NOT NULL,
DisplayName VARCHAR(255) NULL,
FirstName VARCHAR(255) NULL,
LastName VARCHAR(255) NULL,
ImagePath VARCHAR(255) NULL,
X509Cert VARCHAR(255) NULL,
BirthDate DATETIME NULL,
PRIMARY KEY(idPerson),
INDEX Person_FKIndex1(idPersonType),
INDEX Person_FKIndex2(idPersonOwner),
FOREIGN KEY(idPersonType)
REFERENCES PersonType(idPersonType)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
FOREIGN KEY(idPersonOwner)
REFERENCES Person(idPerson)
ON DELETE NO ACTION
ON UPDATE NO ACTION
)
TYPE=InnoDB;

CREATE TABLE Relationship (
idRelationship INTEGER UNSIGNED NOT NULL,
idPersonDown INTEGER UNSIGNED NOT NULL,
idPersonUp INTEGER UNSIGNED NOT NULL,
idRelationType INTEGER UNSIGNED NOT NULL,
isHierarchic BIT NULL,
PRIMARY KEY(idRelationship),
INDEX PersonIdUp(idPersonDown),
INDEX PersonIdDown(idPersonUp),
INDEX RelationshipType(idRelationType),
FOREIGN KEY(idPersonDown)
REFERENCES Person(idPerson)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
FOREIGN KEY(idPersonUp)
REFERENCES Person(idPerson)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
FOREIGN KEY(idRelationType)
REFERENCES RelationType(idRelationType)
ON DELETE NO ACTION
ON UPDATE NO ACTION
)
TYPE=InnoDB;

i get this warning:
[middlegen] (middlegen.RelationshipRole 160 ) WARNING: The
person table's primary key consists of 1 columns, but one of the relatio
nships uses 2 foreign keys. That is not a well-defined relationships, as
all columns in a primary key (and only primary key columns) should
be referenced by a foreign key (all columns in the foreign key).

the rest of the generation is running fine but the thing is not deplyable.
jboss errors:

Cause: Incomplete Deployment listing:
Packages waiting for a deployer:
<none>
Incompletely deployed packages:
<none>
MBeans waiting for classes:
<none>
MBeans waiting for other MBeans:
[ObjectName: jboss.j2ee:jndiName=datasol.PersonLocalHome,service=EJB
state: FAILED
I Depend On:
Depends On Me: org.jboss.deployment.DeploymentException: CMP field for
key not found: field name=idPerson, ObjectName: jboss.j2ee:jndiName=
middlegen.sequencegenerator.ejb.SequenceLocalHome,service=EJB
state: FAILED
I Depend On:
Depends On Me: org.jboss.deployment.DeploymentException: CMP field for
key not found: field name=idPerson, ObjectName: jboss.j2ee:jndiName=
datasol.I18nLocalHome,service=EJB
state: FAILED
I Depend On:
Depends On Me: org.jboss.deployment.DeploymentException: CMP field for
key not found: field name=idPerson, ObjectName: jboss.j2ee:jndiName=
datasol.PersontypeLocalHome,service=EJB
state: FAILED
I Depend On:
Depends On Me: org.jboss.deployment.DeploymentException: CMP field for
key not found: field name=idPerson, ObjectName: jboss.j2ee:jndiName=
datasol.ContacttypeLocalHome,service=EJB
state: FAILED
I Depend On:
Depends On Me: org.jboss.deployment.DeploymentException: CMP field for
key not found: field name=idPerson, ObjectName: jboss.j2ee:jndiName=
datasol.ContactLocalHome,service=EJB
state: FAILED
I Depend On:
Depends On Me: org.jboss.deployment.DeploymentException: CMP field for
key not found: field name=idPerson, ObjectName: jboss.j2ee:jndiName=
datasol.RelationtypeLocalHome,service=EJB
state: FAILED
I Depend On:
Depends On Me: org.jboss.deployment.DeploymentException: CMP field for
key not found: field name=idPerson, ObjectName: jboss.j2ee:jndiName=
datasol.PersonurlLocalHome,service=EJB
state: FAILED
I Depend On:
Depends On Me: org.jboss.deployment.DeploymentException: CMP field for
key not found: field name=idPerson, ObjectName: jboss.j2ee:jndiName=
datasol.RelationshipLocalHome,service=EJB
state: FAILED
I Depend On:
Depends On Me: org.jboss.deployment.DeploymentException: CMP field for
key not found: field name=idPerson]




i can edit the PersonBean and the RelationBean by hand and set up the
Relation by hand and everything is working fine.

is this a bug?

thanx, joe

Loading...