Skip to content

Commit

Permalink
CRANK-30, VMT-150
Browse files Browse the repository at this point in the history
  • Loading branch information
RichardHightower authored and RichardHightower committed Jan 18, 2008
1 parent cabeeed commit c1516b8
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package org.crank.crud.model;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

@Entity
public class Category implements Serializable {

@Id
@GeneratedValue( strategy = GenerationType.AUTO )
private Long id;

private String name;

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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

@Entity
public class Task implements Serializable {
Expand All @@ -18,6 +20,10 @@ public class Task implements Serializable {
private String name;
private String description;
private boolean complete;

@ManyToOne
@JoinColumn(name="CAT_ID")
private Category category;

public boolean isComplete() {
return complete;
Expand Down Expand Up @@ -66,4 +72,12 @@ public Date getStartDate() {
public void setStartDate( Date startDate ) {
this.startDate = startDate;
}

public Category getCategory() {
return category;
}

public void setCategory(Category category) {
this.category = category;
}
}

0 comments on commit c1516b8

Please sign in to comment.