Skip to content
This repository was archived by the owner on May 3, 2022. It is now read-only.

annotations_example

Otávio Santana edited this page Aug 7, 2013 · 9 revisions

Below the simple example using annotations in a class with the Easy-Cassandra. See the annotations speak for themselves and what they do.

Person class

@Entity(nome = "person")
public class Person implements Serializable {

private static final long serialVersionUID = 3L;

@Id
private Long id;

@Column(nome = "name")
private String name;

@Column(nome = "born")
private Integer year;
//getter and setter
}

Embedded class

public class Address implements Serializable {
private static final long serialVersionUID = 1L;

@Column(nome="state")
private String state;

@Column(nome="cyte")
private String city;

@Column(nome="street")
private String street;

@Column(nome="cep")
private String cep;

//getter and setter

}

Clone this wiki locally