Commit 4a260a30 authored by Mahdi Sellami's avatar Mahdi Sellami
Browse files

Adapt to new Idea Schema (with conversation trace)

parent 99c60199
......@@ -92,24 +92,9 @@ public class Idea implements Serializable {
private String q4_contact_person;
/**
* The number of messages that the participant sent.
* The conversation trace.
*/
private int num_messages_participant;
/**
* The number of messages that the facilitator sent.
*/
private int num_messages_facilitator;
/**
* The duration of the conversation (in min).
*/
private float session_duration;
/**
* The number of silent moments.
*/
private int num_silent_moments;
private String conversation_trace;
/**
* A no-argument constructor.
......@@ -121,17 +106,14 @@ public class Idea implements Serializable {
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((conversation_trace == null) ? 0 : conversation_trace.hashCode());
result = prime * result + ((description == null) ? 0 : description.hashCode());
result = prime * result + (int) (ideaId ^ (ideaId >>> 32));
result = prime * result + ((keywords == null) ? 0 : keywords.hashCode());
result = prime * result + num_messages_facilitator;
result = prime * result + num_messages_participant;
result = prime * result + num_silent_moments;
result = prime * result + ((q1_problem == null) ? 0 : q1_problem.hashCode());
result = prime * result + ((q2_novelty == null) ? 0 : q2_novelty.hashCode());
result = prime * result + ((q3_target_group == null) ? 0 : q3_target_group.hashCode());
result = prime * result + ((q4_contact_person == null) ? 0 : q4_contact_person.hashCode());
result = prime * result + Float.floatToIntBits(session_duration);
result = prime * result + ((theInterface == null) ? 0 : theInterface.hashCode());
result = prime * result + ((title == null) ? 0 : title.hashCode());
return result;
......@@ -146,6 +128,11 @@ public class Idea implements Serializable {
if (getClass() != obj.getClass())
return false;
Idea other = (Idea) obj;
if (conversation_trace == null) {
if (other.conversation_trace != null)
return false;
} else if (!conversation_trace.equals(other.conversation_trace))
return false;
if (description == null) {
if (other.description != null)
return false;
......@@ -158,12 +145,6 @@ public class Idea implements Serializable {
return false;
} else if (!keywords.equals(other.keywords))
return false;
if (num_messages_facilitator != other.num_messages_facilitator)
return false;
if (num_messages_participant != other.num_messages_participant)
return false;
if (num_silent_moments != other.num_silent_moments)
return false;
if (q1_problem == null) {
if (other.q1_problem != null)
return false;
......@@ -184,8 +165,6 @@ public class Idea implements Serializable {
return false;
} else if (!q4_contact_person.equals(other.q4_contact_person))
return false;
if (Float.floatToIntBits(session_duration) != Float.floatToIntBits(other.session_duration))
return false;
if (theInterface == null) {
if (other.theInterface != null)
return false;
......@@ -271,36 +250,12 @@ public class Idea implements Serializable {
this.q4_contact_person = q4_contact_person;
}
public int getNum_messages_participant() {
return num_messages_participant;
}
public void setNum_messages_participant(int num_messages_participant) {
this.num_messages_participant = num_messages_participant;
}
public int getNum_messages_facilitator() {
return num_messages_facilitator;
}
public void setNum_messages_facilitator(int num_messages_facilitator) {
this.num_messages_facilitator = num_messages_facilitator;
}
public float getSession_duration() {
return session_duration;
}
public void setSession_duration(float session_duration) {
this.session_duration = session_duration;
}
public int getNum_silent_moments() {
return num_silent_moments;
public String getConversation_trace() {
return conversation_trace;
}
public void setNum_silent_moments(int num_silent_moments) {
this.num_silent_moments = num_silent_moments;
public void setConversation_trace(String conversation_trace) {
this.conversation_trace = conversation_trace;
}
}
......@@ -63,46 +63,25 @@ public class InputIdea {
* The contact person considered with the idea.
*/
@JsonProperty
String q4_contact_preson;
String q4_contact_person;
/**
* The number of messages that the participant sent.
* The conversation trace.
*/
@JsonProperty
private int num_messages_participant;
/**
* The number of messages that the facilitator sent.
*/
@JsonProperty
private int num_messages_facilitator;
/**
* The duration of the conversation (in min).
*/
@JsonProperty
private float session_duration;
/**
* The number of silent moments.
*/
@JsonProperty
private int num_silent_moments;
private String conversation_trace;
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((conversation_trace == null) ? 0 : conversation_trace.hashCode());
result = prime * result + ((description == null) ? 0 : description.hashCode());
result = prime * result + ((keywords == null) ? 0 : keywords.hashCode());
result = prime * result + num_messages_facilitator;
result = prime * result + num_messages_participant;
result = prime * result + num_silent_moments;
result = prime * result + ((q1_problem == null) ? 0 : q1_problem.hashCode());
result = prime * result + ((q2_novelty == null) ? 0 : q2_novelty.hashCode());
result = prime * result + ((q3_target_group == null) ? 0 : q3_target_group.hashCode());
result = prime * result + ((q4_contact_preson == null) ? 0 : q4_contact_preson.hashCode());
result = prime * result + Float.floatToIntBits(session_duration);
result = prime * result + ((q4_contact_person == null) ? 0 : q4_contact_person.hashCode());
result = prime * result + ((theInterface == null) ? 0 : theInterface.hashCode());
result = prime * result + ((title == null) ? 0 : title.hashCode());
return result;
......@@ -117,6 +96,11 @@ public class InputIdea {
if (getClass() != obj.getClass())
return false;
InputIdea other = (InputIdea) obj;
if (conversation_trace == null) {
if (other.conversation_trace != null)
return false;
} else if (!conversation_trace.equals(other.conversation_trace))
return false;
if (description == null) {
if (other.description != null)
return false;
......@@ -127,12 +111,6 @@ public class InputIdea {
return false;
} else if (!keywords.equals(other.keywords))
return false;
if (num_messages_facilitator != other.num_messages_facilitator)
return false;
if (num_messages_participant != other.num_messages_participant)
return false;
if (num_silent_moments != other.num_silent_moments)
return false;
if (q1_problem == null) {
if (other.q1_problem != null)
return false;
......@@ -148,12 +126,10 @@ public class InputIdea {
return false;
} else if (!q3_target_group.equals(other.q3_target_group))
return false;
if (q4_contact_preson == null) {
if (other.q4_contact_preson != null)
if (q4_contact_person == null) {
if (other.q4_contact_person != null)
return false;
} else if (!q4_contact_preson.equals(other.q4_contact_preson))
return false;
if (Float.floatToIntBits(session_duration) != Float.floatToIntBits(other.session_duration))
} else if (!q4_contact_person.equals(other.q4_contact_person))
return false;
if (theInterface == null) {
if (other.theInterface != null)
......@@ -224,44 +200,20 @@ public class InputIdea {
this.q3_target_group = q3_target_group;
}
public String getQ4_contact_preson() {
return q4_contact_preson;
}
public void setQ4_contact_preson(String q4_contact_preson) {
this.q4_contact_preson = q4_contact_preson;
}
public int getNum_messages_participant() {
return num_messages_participant;
}
public void setNum_messages_participant(int num_messages_participant) {
this.num_messages_participant = num_messages_participant;
}
public int getNum_messages_facilitator() {
return num_messages_facilitator;
}
public void setNum_messages_facilitator(int num_messages_facilitator) {
this.num_messages_facilitator = num_messages_facilitator;
}
public float getSession_duration() {
return session_duration;
public String getQ4_contact_person() {
return q4_contact_person;
}
public void setSession_duration(float session_duration) {
this.session_duration = session_duration;
public void setQ4_contact_person(String q4_contact_person) {
this.q4_contact_person = q4_contact_person;
}
public int getNum_silent_moments() {
return num_silent_moments;
public String getConversation_trace() {
return conversation_trace;
}
public void setNum_silent_moments(int num_silent_moments) {
this.num_silent_moments = num_silent_moments;
public void setConversation_trace(String conversation_trace) {
this.conversation_trace = conversation_trace;
}
}
......@@ -70,47 +70,26 @@ public class InputIdeaWithID {
* The contact person considered with the idea.
*/
@JsonProperty
String q4_contact_preson;
String q4_contact_person;
/**
* The number of messages that the participant sent.
* The Conversation trace.
*/
@JsonProperty
private int num_messages_participant;
/**
* The number of messages that the facilitator sent.
*/
@JsonProperty
private int num_messages_facilitator;
/**
* The duration of the conversation (in min).
*/
@JsonProperty
private float session_duration;
/**
* The number of silent moments.
*/
@JsonProperty
private int num_silent_moments;
private String conversation_trace;
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((conversation_trace == null) ? 0 : conversation_trace.hashCode());
result = prime * result + ((description == null) ? 0 : description.hashCode());
result = prime * result + (int) (ideaId ^ (ideaId >>> 32));
result = prime * result + ((keywords == null) ? 0 : keywords.hashCode());
result = prime * result + num_messages_facilitator;
result = prime * result + num_messages_participant;
result = prime * result + num_silent_moments;
result = prime * result + ((q1_problem == null) ? 0 : q1_problem.hashCode());
result = prime * result + ((q2_novelty == null) ? 0 : q2_novelty.hashCode());
result = prime * result + ((q3_target_group == null) ? 0 : q3_target_group.hashCode());
result = prime * result + ((q4_contact_preson == null) ? 0 : q4_contact_preson.hashCode());
result = prime * result + Float.floatToIntBits(session_duration);
result = prime * result + ((q4_contact_person == null) ? 0 : q4_contact_person.hashCode());
result = prime * result + ((theInterface == null) ? 0 : theInterface.hashCode());
result = prime * result + ((title == null) ? 0 : title.hashCode());
return result;
......@@ -125,6 +104,11 @@ public class InputIdeaWithID {
if (getClass() != obj.getClass())
return false;
InputIdeaWithID other = (InputIdeaWithID) obj;
if (conversation_trace == null) {
if (other.conversation_trace != null)
return false;
} else if (!conversation_trace.equals(other.conversation_trace))
return false;
if (description == null) {
if (other.description != null)
return false;
......@@ -137,12 +121,6 @@ public class InputIdeaWithID {
return false;
} else if (!keywords.equals(other.keywords))
return false;
if (num_messages_facilitator != other.num_messages_facilitator)
return false;
if (num_messages_participant != other.num_messages_participant)
return false;
if (num_silent_moments != other.num_silent_moments)
return false;
if (q1_problem == null) {
if (other.q1_problem != null)
return false;
......@@ -158,12 +136,10 @@ public class InputIdeaWithID {
return false;
} else if (!q3_target_group.equals(other.q3_target_group))
return false;
if (q4_contact_preson == null) {
if (other.q4_contact_preson != null)
if (q4_contact_person == null) {
if (other.q4_contact_person != null)
return false;
} else if (!q4_contact_preson.equals(other.q4_contact_preson))
return false;
if (Float.floatToIntBits(session_duration) != Float.floatToIntBits(other.session_duration))
} else if (!q4_contact_person.equals(other.q4_contact_person))
return false;
if (theInterface == null) {
if (other.theInterface != null)
......@@ -242,44 +218,20 @@ public class InputIdeaWithID {
this.q3_target_group = q3_target_group;
}
public String getQ4_contact_preson() {
return q4_contact_preson;
}
public void setQ4_contact_preson(String q4_contact_preson) {
this.q4_contact_preson = q4_contact_preson;
}
public int getNum_messages_participant() {
return num_messages_participant;
public String getQ4_contact_person() {
return q4_contact_person;
}
public void setNum_messages_participant(int num_messages_participant) {
this.num_messages_participant = num_messages_participant;
public void setQ4_contact_person(String q4_contact_person) {
this.q4_contact_person = q4_contact_person;
}
public int getNum_messages_facilitator() {
return num_messages_facilitator;
public String getConversation_trace() {
return conversation_trace;
}
public void setNum_messages_facilitator(int num_messages_facilitator) {
this.num_messages_facilitator = num_messages_facilitator;
public void setConversation_trace(String conversation_trace) {
this.conversation_trace = conversation_trace;
}
public float getSession_duration() {
return session_duration;
}
public void setSession_duration(float session_duration) {
this.session_duration = session_duration;
}
public int getNum_silent_moments() {
return num_silent_moments;
}
public void setNum_silent_moments(int num_silent_moments) {
this.num_silent_moments = num_silent_moments;
}
}
......@@ -117,11 +117,8 @@ public class IdeaResource {
idea.setQ1_problem(input.getQ1_problem());
idea.setQ2_novelty(input.getQ2_novelty());
idea.setQ3_target_group(input.getQ3_target_group());
idea.setQ4_contact_person(input.getQ4_contact_preson());
idea.setNum_messages_participant(input.getNum_messages_participant());
idea.setNum_messages_facilitator(input.getNum_messages_facilitator());
idea.setSession_duration(input.getSession_duration());
idea.setNum_silent_moments(input.getNum_silent_moments());
idea.setQ4_contact_person(input.getQ4_contact_person());
idea.setConversation_trace(input.getConversation_trace());
return ideaDAO.insert(idea);
}
......@@ -190,11 +187,8 @@ public class IdeaResource {
idea.setQ1_problem(input.getQ1_problem());
idea.setQ2_novelty(input.getQ2_novelty());
idea.setQ3_target_group(input.getQ3_target_group());
idea.setQ4_contact_person(input.getQ4_contact_preson());
idea.setNum_messages_participant(input.getNum_messages_participant());
idea.setNum_messages_facilitator(input.getNum_messages_facilitator());
idea.setSession_duration(input.getSession_duration());
idea.setNum_silent_moments(input.getNum_silent_moments());
idea.setQ4_contact_person(input.getQ4_contact_person());
idea.setConversation_trace(input.getConversation_trace());
return ideaDAO.update(idea);
}
......
......@@ -25,13 +25,7 @@
</column>
<column name="q4_contact_person" type="varchar(200)">
</column>
<column name="num_messages_participant" type="int">
</column>
<column name="num_messages_facilitator" type="int">
</column>
<column name="session_duration" type="float">
</column>
<column name="num_silent_moments" type="int">
<column name="conversation_trace" type="varchar(8000)">
</column>
</createTable>
<createTable tableName="keywords">
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment