mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#897 - Remove @EmbeddedColumns ... replace with @Embedded(prefix="...")
This commit is contained in:
@@ -29,6 +29,8 @@ public class TestDPersonEl {
|
||||
p.setSalary(new Money("12200"));
|
||||
p.setCmoney(new CMoney(new Money("12"), NZD));
|
||||
|
||||
Ebean.save(p);
|
||||
|
||||
SpiServer server = Ebean.getDefaultServer().getPluginApi();
|
||||
|
||||
BeanType<DPerson> descriptor = server.getBeanType(DPerson.class);
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.avaje.tests.model.ddd;
|
||||
|
||||
import com.avaje.ebean.annotation.EmbeddedColumns;
|
||||
import com.avaje.tests.model.ivo.CMoney;
|
||||
import com.avaje.tests.model.ivo.Money;
|
||||
import com.avaje.tests.model.ivo.Oid;
|
||||
@@ -21,10 +20,8 @@ public class DPerson {
|
||||
|
||||
Money salary;
|
||||
|
||||
@EmbeddedColumns(columns = "amount=a_amt, currency=a_curr")
|
||||
CMoney cmoney;
|
||||
|
||||
@EmbeddedColumns(columns = "startMillis=i_start, endMillis=i_end")
|
||||
Interval interval;
|
||||
|
||||
public String toString() {
|
||||
|
||||
@@ -2,9 +2,6 @@ package com.avaje.tests.model.embedded;
|
||||
|
||||
import com.avaje.ebean.annotation.Cache;
|
||||
|
||||
import javax.persistence.AttributeOverride;
|
||||
import javax.persistence.AttributeOverrides;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Embedded;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
@@ -33,16 +30,10 @@ public class EInvoice {
|
||||
@ManyToOne
|
||||
EPerson person;
|
||||
|
||||
@Embedded
|
||||
@AttributeOverrides({
|
||||
@AttributeOverride(name = "street", column = @Column(name = "ship_street")),
|
||||
@AttributeOverride(name = "suburb", column = @Column(name = "ship_suburb")),
|
||||
@AttributeOverride(name = "city", column = @Column(name = "ship_city")),
|
||||
@AttributeOverride(name = "status", column = @Column(name = "ship_status"))
|
||||
})
|
||||
@Embedded(prefix = "ship_")
|
||||
EAddress shipAddress;
|
||||
|
||||
@Embedded
|
||||
@Embedded(prefix = "bill_")
|
||||
EAddress billAddress;
|
||||
|
||||
public Long getId() {
|
||||
|
||||
Reference in New Issue
Block a user