Changing the annotation of ProjectIdea#match from @ManyToOne to @OneToOne.

This commit is contained in:
Tom Vahlman 2012-01-19 20:31:19 +01:00
parent b049f978a4
commit e7ccb4be73
2 changed files with 6 additions and 5 deletions
resources/db_update_scripts
src/main/java/se/su/dsv/scipro/match/dataobject

@ -1,9 +1,7 @@
-- required database changes
-- required database changes for the property Match#rejectedBy
ALTER TABLE matchings ADD COLUMN rejectedBy_id bigint(20);
ALTER TABLE matchings ADD CONSTRAINT `FK24A2D416D0C9D7F5` FOREIGN KEY (`rejectedBy_id`) REFERENCES `user` (`id`);
/* The results running the queries above should look exactly like the hibernate generated table below, this can be tested by
running "show create table matchings;" from the command prompt
@ -31,4 +29,7 @@ CREATE TABLE IF NOT EXISTS `matchings` (
CONSTRAINT `FK24A2D4169AA5FCB` FOREIGN KEY (`createdBy_id`) REFERENCES `user` (`id`),
CONSTRAINT `FK24A2D416BCA56165` FOREIGN KEY (`supervisor_id`) REFERENCES `role` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=latin1 |
*/
*/
-- no database changes were required for changing the annotation of ProjectIdea#match from @ManyToOne to @OneToOne

@ -79,7 +79,7 @@ public class ProjectIdea extends DomainObject {
@OrderBy("dateCreated DESC, id DESC")
private List<Match> matchHistory = new ArrayList<Match>();
@ManyToOne
@OneToOne(optional = true)
private Match match;
@Override