在遗留代码中,有一个Hibernate @Entity类Foo。它的一个特点是:OldBar是一个@Embeddable类,它使用单个列foobarpublic class我认为由于NewBar也是Embeddable,并且具有相同的@Column名称,所以我可以在类Foo中交换字段。private NewBar bar = new NewBar();
我之所以想这样做,是因为我在foobar列中有现有的数据
我需要在hibernate entity中添加索引。据我所知,可以使用@Index注释为单独的列指定索引,但我需要为实体的几个字段指定索引。可能是jboss版本比必要的版本低,或者我不理解如何使用这个注释,但是...未创建复杂索引。实体示例:import org.hibernate.annotations.Index;
public void set