mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
initial add of EbeanORM server based on v2.8.1
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
package com.avaje.tests.model.basic;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.OneToOne;
|
||||
|
||||
import com.avaje.ebean.annotation.Sql;
|
||||
|
||||
/**
|
||||
* An example of an Aggregate object.
|
||||
* <p>
|
||||
* Note the @Sql indicates to Ebean that this bean is not based on a table but
|
||||
* instead uses RawSql.
|
||||
* </p>
|
||||
*/
|
||||
@Entity
|
||||
@Sql
|
||||
public class CustomerAggregate {
|
||||
|
||||
@OneToOne
|
||||
Customer customer;
|
||||
|
||||
int totalContacts;
|
||||
|
||||
|
||||
public String toString() {
|
||||
return customer.getId() + " totalContacts:" + totalContacts;
|
||||
}
|
||||
|
||||
|
||||
public Customer getCustomer() {
|
||||
return customer;
|
||||
}
|
||||
|
||||
|
||||
public void setCustomer(Customer customer) {
|
||||
this.customer = customer;
|
||||
}
|
||||
|
||||
|
||||
public int getTotalContacts() {
|
||||
return totalContacts;
|
||||
}
|
||||
|
||||
|
||||
public void setTotalContacts(int totalContacts) {
|
||||
this.totalContacts = totalContacts;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user