Skip to content

Instantly share code, notes, and snippets.

@szmeku
Created June 21, 2014 22:28
Show Gist options
  • Save szmeku/e75e710efccd01ea9692 to your computer and use it in GitHub Desktop.
Save szmeku/e75e710efccd01ea9692 to your computer and use it in GitHub Desktop.
@Entity
@Table(name = "TestAspect")
@JsonIgnoreProperties(ignoreUnknown = true)
public class TestAspectEntity {
@Id
@Column(name = "id")
@GeneratedValue
private Long id;
@Column(name = "testAspectName")
private String name;
@Column(name = "timestamp")
private java.sql.Timestamp timestamp;
@OneToOne(mappedBy="testAspect", cascade = CascadeType.ALL)
private TestKnowledgeEntity knowledge = new TestKnowledgeEntity();
public TestKnowledgeEntity getKnowledge() {
return knowledge;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public java.sql.Timestamp getTimestamp() {
return timestamp;
}
public void setTimestamp(java.sql.Timestamp timestamp) {
this.timestamp = timestamp;
}
}
package com.csl.entity;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import javax.persistence.*;
import java.util.HashSet;
import java.util.Set;
@Entity
@Table(name = "TestKnowledge")
@JsonIgnoreProperties(ignoreUnknown = true)
public class TestKnowledgeEntity {
@Id
@Column(name = "id")
@GeneratedValue
private Long id;
@Column(name = "knowledge")
private String body;
@OneToOne
@JoinColumn(name="testAspectId")
private TestAspectEntity testAspect;
public String getBody() {
return body;
}
public void setBody(String body) {
this.body = body;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment