2017-06-23 6 views
2

私は2つのカスタムクラス、OzBakimGunlukEtkinlikを持っています。これらのクラスはエンティティではありません。私はエンティティでこれらのクラスを使用する必要があります。Springブート - エンティティのカスタムクラスフィールド

しかし、私はエラーを取得する:

​​

どのように私はこの問題を解決することができますか?私は間違いを発見した

2017-06-23 13:53:19.791 WARN 12832 --- [ main] o.s.w.c.s.GenericWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory

2017-06-23 13:53:19.799 WARN 12832 --- [ main] o.s.boot.SpringApplication : Error handling failed (Error creating bean with name 'delegatingApplicationListener' defined in class path resource [org/springframework/security/config/annotation/web/configuration/WebSecurityConfiguration.class]: BeanPostProcessor before instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration': Initialization of bean failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'org.springframework.context.annotation.ConfigurationClassPostProcessor.importRegistry' available)

+0

とその例外はあなたの本当の理由を告げる入れ子の例外を持つことになります。 –

+1

完全なスタックトレースを書き留めてください。 – ozgur

+0

@ozgurYazıyorumşimdigüncellemeyle。 – forguta

答えて

0

@Entity 
@Table 
@EntityListeners(AuditingEntityListener.class) 
public class Rapor implements Serializable { 

    @Id 
    @SequenceGenerator(name = "RAPOR_SEQUENCE", sequenceName = "RAPOR_SEQUENCE", allocationSize = 1) 
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "RAPOR_SEQUENCE") 
    private Long id; 

    @Embedded 
    private OzBakim ozBakim; 

    @Embedded 
    private GunlukEtkinlik gunlukEtkinlik; 

    private Date tarih; 

//Set Get 
} 

UPDATE

@Embeddable 
public class GunlukEtkinlik { 
    private boolean anaDil; 
    private boolean bahce; 
    private boolean bilimDeney; 
    private boolean drama; 
    private boolean dans; 
    private boolean fenDoga; 
    private boolean gezi; 
    private boolean gorselSanatlar; 
    private boolean masaBasiEtkinlik; 
    private boolean masal; 
    private boolean matematik; 
    private boolean mutfakEtkinlik; 
    private boolean muzik; 
    private boolean oyun; 
    private boolean satranc; 
    private boolean spor; 
    private boolean ingilizce; 
    private boolean digerDiller; 
    private boolean yaraticiEtkinlik; 
    private boolean ogretmenNotu; 
//Set Get 
} 

@Embeddable 
public class OzBakim { 
    private int kahvalti; 
    private int ogleYemegi; 
    private int ikindiKahvaltisi; 
    private int elYuzTuvaletTemizligi; 
    private int okulFaaliyetleri; 
    private int arkadasIletisim; 
    private int ogleUykusu; 
    private int ogretmenNotu; 
    private int topluOgretmenNotu; 
//Set Get 
} 

エラー:私はこれまで得たもの

。 :それは@Entityクラスの同じテーブルに埋め込まれたエンティティのために列を追加することができ@Entityクラス、中)

Repeated column in mapping for entity: com.exam.model.Rapor column: ogretmen_notu (should be mapped with insert="false" update="false") 

@Embeddableエンティティ。

繰り返し列名は使用できません。

@Embeddable 
public class GunlukEtkinlik { 
    . 
    . 
    . 
    private boolean ogretmenNotu; 
} 

@Embeddable 
public class OzBakim { 
    . 
    . 
    . 
    private int ogretmenNotu(You must change name); 
} 
+0

このファイルは、OZBAKIM_OGRETMENNOTUのオララクVeritabanınakaydoluyorのOzBakimのモデルに含まれています。ブーイング・アラン・アドラーン・デイヴシシュタム。 Sonradan farkedipdüzelttim。 – forguta

+1

@Column(name = "NAME")。 bu anotasyonukullanmanınıöneririmフィールドlarınüzerine。 İstediğinコロンismini verebilirsin。 – ozgur

関連する問題