我想使用静态Marshall方法使用Castor编组跟随实体。但是,由于实体具有对自身的引用,因此它开始循环,并且从44个数据库行,如果不崩溃,它将构建我100MB文件。 @XmlTransient属性没有帮助。 ORM是eclipseLink,EJB 3(ADF 11.1.2.1.0)
@Entity
@NamedQueries( { @NamedQuery(name = "MenuItems.findAll", query = "select o from MenuItems o") })
@Table(name = "MENU_ITEMS")
public class MenuItems implements Serializable {
@Column(nullable = false, length = 4000)
private String definition;
@Column(nullable = false)
private String description;
@Column(name = "DISPLAY_SEQ")
private BigDecimal displaySeq;
@Column(length = 64)
private String key;
@Id
@Column(name = "MIT_ID", nullable = false)
private BigDecimal mitId;
@Column(name = "MULTI_INSTANCEABLE", nullable = false, length = 1)
private String multiInstanceable;
@Column(length = 1)
private String visible;
@ManyToOne
@JoinColumn(name = "MIT_ID_PARENT")
@XmlTransient private MenuItems menuItems;
@OneToMany(mappedBy = "menuItems")
@XmlTransient private List<MenuItems> menuItemsList;
@ManyToOne
@JoinColumn(name = "MTP_CODE")
private MenuItemTypes menuItemTypes;