2017-02-20 4 views
0

私はliferay 7 ga3でカスタムポートレットを開発しています。Liferay 7:カスタムポートレットで多数のユーザークラスを参照する方法

私は5月のデータレイヤーで春のデータを使用しています。自分のデータベースと自分の接続があります。自分のエンティティに注釈が付けられています。

は私のエンティティクラスの一つで、私は

@ManyToMany 
@JoinTable(name = "authuserservice", joinColumns = @JoinColumn(name = "servicename"), inverseJoinColumns = @JoinColumn(name = "screenName")) 
List<User> users; 

、LiferayのUserクラス(com.liferay.portal.kernel.model.User)との多くの関係に多くを必要とするが、私はエラーがのgettinよ

Caused by: org.hibernate.AnnotationException: Use of @OneToMany or @ManyToMany targeting an unmapped class: it.realt.trasparenza.services.services.Service.users[com.liferay.portal.kernel.model.User] 
    at org.hibernate.cfg.annotations.CollectionBinder.bindManyToManySecondPass(CollectionBinder.java:1223) 
    at org.hibernate.cfg.annotations.CollectionBinder.bindStarToManySecondPass(CollectionBinder.java:800) 
    at org.hibernate.cfg.annotations.CollectionBinder$1.secondPass(CollectionBinder.java:725) 
    at org.hibernate.cfg.CollectionSecondPass.doSecondPass(CollectionSecondPass.java:54) 
    at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.processSecondPasses(InFlightMetadataCollectorImpl.java:1621) 
    at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.processSecondPasses(InFlightMetadataCollectorImpl.java:1589) 

どのように私はこれを解決することができます知っていますか?

ありがとうございました

答えて

2

例外はありません。 liferay service builderを使用する代わりに、独自の休止状態構成を使用しています。これは、HibernateのエンティティにUser.classマッピングが含まれていないために発生します。

つまり、サービスビルダーモデルのエンティティを使用して、希望通りの生活を営むことができます。そうしないと、カスタムのハイバネートエンティティのみで作業することができます。

また、ユーザーテーブルを指す休止状態の構成にマップされたビューSQLを実装し、リストオブジェクトをビューエンティティに定義すると、この問題を「ハック」することもできます。しかし、私はそれをお勧めしません。

+0

ok、説明をいただきありがとうございます – Andrea

関連する問題