From: Boring, J. W, A. <jb...@at...> - 2002-09-27 17:24:41
|
Could someone explain the objects and tables. I really don not = understand the problem domain. How is vertex used here - math (The point = at which the sides of an angle intersect), Astronomy (The highest point = reached in the apparent motion of a celestial body), or Anatomy (The = highest point of the skull)? None of these jive with "sink" or "source." = Also, why does the edge table below need foreign keys to vertex?=20 Thanks much, ----------------------------------------------------------------- TABLES create table vertex ( creationDate DATE,=20 name VARCHAR(50) not null unique,=20 strength FLOAT,=20 version_number INTEGER not null,=20 vertex_id BIGINT not null,=20 vertex_type VARCHAR(255) not null,=20 primary key (vertex_id)) =09 create table edge ( creationDate DATE,=20 edge_cpcty FLOAT,=20 edge_id BIGINT not null,=20 edge_length FLOAT,=20 name VARCHAR(50) not null unique,=20 sink BIGINT not null,=20 source BIGINT not null,=20 primary key (edge_id)) =09 alter table edge add constraint=20 edgeFK1 foreign key (sink) references vertex =09 alter table edge add constraint=20 edgeFK0 foreign key (source) references vertex =09 create table hibernate_unique_key ( next_hi INTEGER ) insert into hibernate_unique_key values ( 0 ) -----------------------------------------------------------------=20 ----------------------------------------------------------------- = Classes public class Edge { private float length; private String name; private float capacity; private Vertex source; private Vertex sink; private long key; private Date creationDate =3D new Date(); } public class Vertex { private Set incoming =3D new HashSet(); private Set outgoing =3D new HashSet(); private String name; private long key; private int version; private Date creationDate =3D new Date(); } public class Source extends Vertex { private float strength; } -----------------------------------------------------------------=20 Jeff Boring Custom & Web Services Development AT&T Labs jb...@at... (813) 878-3367 |