Hi Gary: I thought you already had made more progress on the project. The description is not clear to me. You say "code for defining the table is already created" Do you mean that you have Java classes representing the tables? At one place you say "translate these constraints to Java code" at another one "Output: database program that would perform simple SQL-like queries". Please can you be more specific. -- Karl PS. Your midterm grade was 94: B I am returning the exam today to NNU. >From ggengo@mail11.mitre.org Thu Nov 19 12:29:33 1998 >Subject: project >From: ggengo@mail11.mitre.org (Gary Gengo) >To: lieber@ccs.neu.edu > >Name: Gary Gengo >Title: Aspects of Relational Database System > > >In a relational database system, you can specify various types of constraints. >My project is to use aspects to translate these constraints to Java code that >will enforce these constraints using AspectJ. > >Some Types of Constraints > -uniqueness constraints >no two Pilots can have same Social Security Number >no two Pilots can have the same First Name, Last Name, Suffix > no two Pilots can have exactly the same information (no >duplicate objects) > -referential integrity constraint >Suppose you want to enforce a constraint that every Flight must be assigned an >Aircraft. You can enforce this constraint by: >Disallowing new Flights unless you associate it with an existing Aircraft. > Disallow deleting an Aircraft unless you delete all the >Flights associated with it > Automatically delete all Flights associated with the >Aircraft (CASCADE DELETE option) > -cardinality constraints > -other constraints > DepartureTime must be before ArrivalTime. (assuming all times >are GMT) > >Input: set of constraints >Output: database program that would perform simple SQL-like queries and updates >that conform to the constraint specifications. For this project, I assume that >the code for defining the table is already created. I am not translating >database schemas to class structures. > >Above constraints might be specified as follows: > > Table Pilot ( > SSN UNIQUE, > FirstName, > LastName, > Suffix, > UNIQUE (FirstName,LastName,Suffix) >) > > Table Aircraft( > AircraftID UNIQUE > AircraftType > Capacity >) > > Table Flight( > FlightID UNIQUE > Aircraft REFERENCES Aircraft.AircraftID [CASCADE DELETE] > DepartPlace, > DepartTime, > ArrivePlace, > ArriveTime > ) > > Flight.DepartTime < Flight.ArriveTime > > //Relationships and cardinality constraint > Pilot 1+ FlyOn FlownBy 0+ Flight // (Pilot FlyOn Flight. Flight >FlownBy Pilot.) > // Pilots may be on zero or more >Flights > // Each Flight must have at least one >Pilot > > Aircraft 1 AssignedTo FlownOn 0+ Flight >// Aircraft AssignedTo Flight. Flight FlownOn Aircraft >// Aircraft may be assigned to zero or more Flights >// Each Flight has exactly one Aircraft > >