[virtualcommons-svn] SF.net SVN: virtualcommons:[198] mentalmodels/trunk/src/main
Status: Beta
Brought to you by:
alllee
From: <see...@us...> - 2009-07-22 18:55:33
|
Revision: 198 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=198&view=rev Author: seematalele Date: 2009-07-22 18:55:20 +0000 (Wed, 22 Jul 2009) Log Message: ----------- Added InformationWindow entity which is used to to indicate which information window should be displayed to which block. Information Window part is not as generic as Questionnaire part right now. It can be extend in the future. Modified Paths: -------------- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Block.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StartupService.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StudentService.java mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.cfg.xml Added Paths: ----------- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/InformationWindow.java Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Block.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Block.java 2009-07-22 18:43:17 UTC (rev 197) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Block.java 2009-07-22 18:55:20 UTC (rev 198) @@ -49,7 +49,11 @@ @OrderBy("sequenceNo") private List<QuestionGroup> questionGroups; + @OneToMany(mappedBy="block") + @OrderBy("sequenceNo") + private List<InformationWindow> informationWindows; + public void setId(Long id) { this.id = id; } @@ -100,6 +104,14 @@ return duration; } + public void setInformationWindows(List<InformationWindow> informationWindows) { + this.informationWindows = informationWindows; + } + + public List<InformationWindow> getInformationWindows() { + return informationWindows; + } + /*public void setInformationWindows(List<Integer> informationWindows) { this.informationWindows = informationWindows; } Added: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/InformationWindow.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/InformationWindow.java (rev 0) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/InformationWindow.java 2009-07-22 18:55:20 UTC (rev 198) @@ -0,0 +1,64 @@ +package edu.asu.commons.mme.entity; + +import java.io.Serializable; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +@Entity +@Table(name="information_window") +public class InformationWindow implements Serializable{ + + private static final long serialVersionUID = -1060692155087738338L; + + @Id + @GeneratedValue + private Long id; + + @Column(name="sequence_no",nullable=false) + private Integer sequenceNo; + + @Column(name="title",nullable=false) + private String title; + + @ManyToOne + @JoinColumn(nullable=false) + private Block block; + + public void setId(Long id) { + this.id = id; + } + + public Long getId() { + return id; + } + + public void setSequenceNo(Integer sequenceNo) { + this.sequenceNo = sequenceNo; + } + + public Integer getSequenceNo() { + return sequenceNo; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getTitle() { + return title; + } + + public void setBlock(Block block) { + this.block = block; + } + + public Block getBlock() { + return block; + } +} Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StartupService.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StartupService.java 2009-07-22 18:43:17 UTC (rev 197) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StartupService.java 2009-07-22 18:55:20 UTC (rev 198) @@ -5,6 +5,7 @@ import org.springframework.context.event.ContextRefreshedEvent; import edu.asu.commons.mme.entity.Module; +import edu.asu.commons.mme.entity.Student; public class StartupService implements ApplicationListener { @@ -32,7 +33,7 @@ this.studentService = studentService; } - public Long createStudent(Integer birthYear, String semester,String gender,String major) { + public Student createStudent(Integer birthYear, String semester,String gender,String major) { return studentService.createStudent(birthYear, semester, gender, major); } Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StudentService.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StudentService.java 2009-07-22 18:43:17 UTC (rev 197) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StudentService.java 2009-07-22 18:55:20 UTC (rev 198) @@ -23,7 +23,7 @@ private List<Student> students = new ArrayList<Student>(); - public Long createStudent(Integer birthYear, String semester,String gender,String major) { + public Student createStudent(Integer birthYear, String semester,String gender,String major) { // System.out.println("Birthyear " + birthYear); // System.out.println("Ethnicity " + semester); // System.out.println("Gender " + gender); @@ -41,9 +41,9 @@ students.add(student); } else - return 0L; + return null; - return student.getId(); + return student; } public boolean checkStudentAlreadyExists(Student student) Modified: mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.cfg.xml =================================================================== --- mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.cfg.xml 2009-07-22 18:43:17 UTC (rev 197) +++ mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.cfg.xml 2009-07-22 18:55:20 UTC (rev 198) @@ -21,9 +21,7 @@ <mapping class='edu.asu.commons.mme.entity.QuestionGroup'/> <mapping class='edu.asu.commons.mme.entity.Question'/> - - - + <mapping class='edu.asu.commons.mme.entity.CategoricalQuestion'/> <mapping class='edu.asu.commons.mme.entity.CategoricalOption'/> <mapping class='edu.asu.commons.mme.entity.ForecastingQuestion'/> @@ -33,7 +31,8 @@ <mapping class='edu.asu.commons.mme.entity.Module'/> <mapping class='edu.asu.commons.mme.entity.Block'/> <mapping class='edu.asu.commons.mme.entity.ModuleRoundConfig'/> - + <mapping class='edu.asu.commons.mme.entity.InformationWindow'/> + </session-factory> </hibernate-configuration> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |