1

我想使用静态 Marshall 方法用 Castor 编组以下实体。然而,由于实体对自身有引用,所以它开始循环,如果不崩溃,它会从 44 个 DB 行构建我 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;
4

0 回答 0