我必须通过休眠为模型类绘制关系

时间:2018-08-07 15:35:38

标签: database hibernate spring-mvc

我必须为我的Tourism_answers_table绘制关系,其中每个问题都要回答n次,但用户只能回答一次

首先这是我的Real_user表

@Entity(name =“ Real_User”) 公共类RealUser {

$o_1$ is the output of neuron 1.  
$o_2$ is the output of neuron 2.  
$w_1$ is the weight of connection between 1 and 3.   
$w_2$ is the weight of connection between 2 and 3.  
So the input to neuron 3 is $i =o_1w_1 +o_2w_2$   
Let the activation function of neuron 3 be sigmoid function.  
$f(x) = \dfrac{1}{1+e^{-x}}$ and the threshold value of neuron 3 be $\theta$.  
Therefore, output of neuron 3 will be $f(i)$ if $i\geq\theta$ and $0$ if $i\lt\theta$.  

}

第二个是Tourism_question表

@Entity(name =“ Tourism_Question_Table”) 公共类TourismQuestions {

@Id 
@Column(name="Email", unique=true, nullable=false)
private String email;

@Column(name="FirstName", nullable=false)
private String firstName;

@Column(name="LastName", nullable=false)
private String lastName;

@Column(name="Password", nullable=false)
private String password;

@Column(name="Role", nullable=false)
private String role;

@Column(name="Enabled", nullable=false)
private boolean enabled;

@Column(name="Username", nullable=false)
private String userName;

@Column(name="Status", nullable=false)
private String status;

@Column(name="Profile", nullable=false)
private String profile;

@Column(name="Description", nullable=false)
private String description;

@Column(name="MySite", nullable=false)
private String mySite;

}

以上两种模式都可以正常工作,其中将real_user的电子邮件作为FIK放在tourims_question_table中

现在的问题是如何在我想要的地方放置Tourism_answers_table 4个领域: 1:answer_id(PK) 2:回答 3. question_Id(标识问题,并从Tourism_question_table中获取为FK) 4.timeAnswered(回答的时间) 5.email_Id(谁回答了这个问题) 我希望用户对每个问题回答一次,但可以针对不同的问题回答 根据question_id的问题

怎么做的家伙。帮助

0 个答案:

没有答案
相关问题