看起來像袋鼠有一個問題,「分組import語句」,如:
import javax.persistence.*
爲了解決這個問題,只是擴大你的實體內的星號。示例如下。
「越野車」 實體:
...
import javax.persistence.*;
...
@RooJavaBean
@RooToString
@RooJpaActiveRecord
@RooEquals
@ValidAdvocateCount
public class Formation {
@NotNull
@ManyToOne
private Acol registrationAcol;
/**
*/
@NotNull
@OneToOne
private Contacts contacts;
/**
*/
@OneToMany(cascade = CascadeType.ALL, mappedBy = "formation")
private Set<Advocate> advocates = new HashSet<Advocate>();
}
該實體
無效自動生成的方面(不相關的細節移除):
privileged aspect FormationDataOnDemand_Roo_DataOnDemand {
declare @type: FormationDataOnDemand: @Component;
private List<Formation> FormationDataOnDemand.data;
public Formation FormationDataOnDemand.getNewTransientFormation(int index) {
Formation obj = new Formation();
setContacts(obj, index);
setForm(obj, index);
setName(obj, index);
setRate(obj, index);
setRegistrationAcol(obj, index);
setResume(obj, index);
setReviewDate(obj, index);
setViews(obj, index);
return obj;
}
public void FormationDataOnDemand.setContacts(Formation obj, int index) {
Contacts contacts = null;
obj.setContacts(contacts);
}
public void FormationDataOnDemand.setRegistrationAcol(Formation obj, int index) {
Acol registrationAcol = null;
obj.setRegistrationAcol(registrationAcol);
}
}
固定實體進口例如:
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.OneToOne;
import javax.persistence.OneToMany;
import javax.persistence.ManyToOne;
import javax.persistence.CascadeType;
import javax.validation.constraints.NotNull;
而這裏是一個有效的自動生成方面,修復後:
privileged aspect FormationDataOnDemand_Roo_DataOnDemand {
declare @type: FormationDataOnDemand: @Component;
private List<Formation> FormationDataOnDemand.data;
@Autowired
ContactsDataOnDemand FormationDataOnDemand.contactsDataOnDemand;
@Autowired
AcolDataOnDemand FormationDataOnDemand.acolDataOnDemand;
public Formation FormationDataOnDemand.getNewTransientFormation(int index) {
Formation obj = new Formation();
setContacts(obj, index);
setForm(obj, index);
setName(obj, index);
setRate(obj, index);
setRegistrationAcol(obj, index);
setResume(obj, index);
setReviewDate(obj, index);
setViews(obj, index);
return obj;
}
public void FormationDataOnDemand.setContacts(Formation obj, int index) {
Contacts contacts = contactsDataOnDemand.getSpecificContacts(index);
obj.setContacts(contacts);
}
public void FormationDataOnDemand.setRegistrationAcol(Formation obj, int index) {
Acol registrationAcol = acolDataOnDemand.getRandomAcol();
obj.setRegistrationAcol(registrationAcol);
}
}