Cuba跨库视图
Order视图中展示不了Customer的相关属性,
以下是Order实体和Customer实体的定义:
@Table(name = "CUBAONE_ORDER")
@Entity(name = "cubaone_Order")
public class Order extends StandardEntity {
@Temporal(TemporalType.DATE)
@NotNull
@Column(name = "DATE_", nullable = false)
protected Date date;
@NotNull
@Column(name = "AMOUNT", nullable = false)
protected BigDecimal amount;
@SystemLevel
@Column(name = "CUSTOMER_ID")
protected UUID customerId;
@Transient
@MetaProperty(related = "customerId")
protected Customer customer;
public Customer getCustomer() {
return customer;
}
public void setCustomer(Customer customer) {
this.customer = customer;
}
public UUID getCustomerId() {
return customerId;
}
public void setCustomerId(UUID customerId) {
this.customerId = customerId;
}
public BigDecimal getAmount() {
return amount;
}
public void setAmount(BigDecimal amount) {
this.amount = amount;
}
public Date getDate() {
return date;
}
public void setDate(Date date) {
this.date = date;
}
}
@Table(name = "CUBAONE_CUSTOMER")
@Entity(name = "cubaone_Customer")
public class Customer extends StandardEntity {
@Column(name = "NAME")
protected String name;
@Email(message = "Email is Vaild", regexp = ".*")
@NotNull
@Column(name = "EMAIL", nullable = false)
protected String email;
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
视图定义:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<views xmlns="http://schemas.haulmont.com/cuba/view.xsd">
<view entity="cubaone_Order" name="order-view" extends="_local">
<property name="customer" view="_minimal">
<property name="name"/>
</property>
</view>
</views>
customer数据:
order数据: