Hibernate problem - “Use of @OneToMany or @ManyToMany targeting an unmapped class”One-to-many relationship Hibernate errorUse of @OneToMany or @ManyToMany targeting an unmapped class:org.hibernate.AnnotationException: Use of @OneToMany or @ManyToMany targeting an unmapped class: core.user.User.userRole[core.user.UserRole]Hibernate: "Use of @OneToMany targeting an unmapped classAnnotation exception HibernateUse of @OneToMany or @ManyToMany targeting an unmapped class: kg.aladin.jdbc.Student.books[kg.aladin.jdbc.Book]Hibernate map an association as a mapUse of @OneToMany or @ManyToMany targeting an unmapped class microservice architectureHibernate ManyToMany with Join table problems on updateWrong ordering in generated table in jpaDeleting from ManyToMany with IndexColumnConstraint violation in Hibernate unidirectional OneToMany mapping with JoinTable and OrderColumn when removing elementswant to add two different tables(classes) in one hibernate criteriaHibernate Exception: Trying to map a Collection OneToMany without JoinTableHibernate: ManyToMany inverse DeleteMappingJackson2HttpMessageConverter Can not find a (Map) Key deserializer for typeHibernate : Why FetchType.LAZY-annotated collection property eagerly loading?Use of @OneToMany or @ManyToMany targeting an unmapped class:
How should I ask for a "pint" in countries that use metric?
Why is a mixture of two normally distributed variables only bimodal if their means differ by at least two times the common standard deviation?
Is it better in terms of durability to remove card+battery or to connect to charger/computer via USB-C?
Generalized Behrend version for Grothendieck-Lefschetz trace formula
What is a writing material that persists forever or for a long time?
This LM317 diagram doesn't make any sense to me
Quoridor rules when faced the opponent
A sequence that changes sign finally at infinity?
What would +1/+2/+3 items be called in game?
What are the effects of abstaining from eating a certain flavor?
QR codes, do people use them?
Four ships at the ocean with the same distance
Distinguish the explanations of Galadriel's test in LotR
Do injective, yet not bijective, functions have an inverse?
Compressed gas thruster for an orbital launch vehicle?
Reference request: quantifier elimination test
Did depressed people far more accurately estimate how many monsters they killed in a video game?
Password Hashing Security Using Scrypt & Argon2
Writing an ace/aro character?
My previous employer committed a severe violation of the law and is also being sued by me. How do I explain the situation to future employers?
Is it possible to complete a PhD in CS in 3 years?
Write a function
US citizen traveling with Peruvian passport
Did the Ottoman empire suppress the printing press?
Hibernate problem - “Use of @OneToMany or @ManyToMany targeting an unmapped class”
One-to-many relationship Hibernate errorUse of @OneToMany or @ManyToMany targeting an unmapped class:org.hibernate.AnnotationException: Use of @OneToMany or @ManyToMany targeting an unmapped class: core.user.User.userRole[core.user.UserRole]Hibernate: "Use of @OneToMany targeting an unmapped classAnnotation exception HibernateUse of @OneToMany or @ManyToMany targeting an unmapped class: kg.aladin.jdbc.Student.books[kg.aladin.jdbc.Book]Hibernate map an association as a mapUse of @OneToMany or @ManyToMany targeting an unmapped class microservice architectureHibernate ManyToMany with Join table problems on updateWrong ordering in generated table in jpaDeleting from ManyToMany with IndexColumnConstraint violation in Hibernate unidirectional OneToMany mapping with JoinTable and OrderColumn when removing elementswant to add two different tables(classes) in one hibernate criteriaHibernate Exception: Trying to map a Collection OneToMany without JoinTableHibernate: ManyToMany inverse DeleteMappingJackson2HttpMessageConverter Can not find a (Map) Key deserializer for typeHibernate : Why FetchType.LAZY-annotated collection property eagerly loading?Use of @OneToMany or @ManyToMany targeting an unmapped class:
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I'm finding my feet with Hibernate Annotations and I've hit a problem I hope some one can help with.
I have 2 entities, Section and ScopeTopic. Section has a List class member, so a One to Many relationship. When I run my unit test I am getting this exception:
Use of @OneToMany or @ManyToMany targeting an unmapped class: com.xxx.domain.Section.scopeTopic[com.xxx.domain.ScopeTopic]
I would assume that the error implies that my ScopeTopic entity isn't mapped to a table? I can't see with I have done wrong. Here are the Entity classes:
@Entity
public class Section
private Long id;
private List<ScopeTopic> scopeTopics;
public Section()
@Id
public Long getId()
return id;
public void setId(Long id)
this.id = id;
@OneToMany
@JoinTable(name = "section_scope", joinColumns = @JoinColumn(name="section_id"),
inverseJoinColumns = @JoinColumn(name="scope_topic_id") )
public List<ScopeTopic> getScopeTopic()
return scopeTopic;
public void setScopeTopic(List<ScopeTopic> scopeTopic)
this.scopeTopic = scopeTopic;
@Entity
@Table(name = "scope_topic")
public class ScopeTopic
private Long id;
private String topic;
public ScopeTopic()
@Id
public Long getId()
return id;
public void setId()
this.id = id;
public String getTopic()
return topic;
public void setTopic(String topic)
this.topic = topic;
I'm pretty sure it's my own lack of understanding that's at fault so some guidance would be great, thanks!
hibernate jpa
add a comment |
I'm finding my feet with Hibernate Annotations and I've hit a problem I hope some one can help with.
I have 2 entities, Section and ScopeTopic. Section has a List class member, so a One to Many relationship. When I run my unit test I am getting this exception:
Use of @OneToMany or @ManyToMany targeting an unmapped class: com.xxx.domain.Section.scopeTopic[com.xxx.domain.ScopeTopic]
I would assume that the error implies that my ScopeTopic entity isn't mapped to a table? I can't see with I have done wrong. Here are the Entity classes:
@Entity
public class Section
private Long id;
private List<ScopeTopic> scopeTopics;
public Section()
@Id
public Long getId()
return id;
public void setId(Long id)
this.id = id;
@OneToMany
@JoinTable(name = "section_scope", joinColumns = @JoinColumn(name="section_id"),
inverseJoinColumns = @JoinColumn(name="scope_topic_id") )
public List<ScopeTopic> getScopeTopic()
return scopeTopic;
public void setScopeTopic(List<ScopeTopic> scopeTopic)
this.scopeTopic = scopeTopic;
@Entity
@Table(name = "scope_topic")
public class ScopeTopic
private Long id;
private String topic;
public ScopeTopic()
@Id
public Long getId()
return id;
public void setId()
this.id = id;
public String getTopic()
return topic;
public void setTopic(String topic)
this.topic = topic;
I'm pretty sure it's my own lack of understanding that's at fault so some guidance would be great, thanks!
hibernate jpa
add a comment |
I'm finding my feet with Hibernate Annotations and I've hit a problem I hope some one can help with.
I have 2 entities, Section and ScopeTopic. Section has a List class member, so a One to Many relationship. When I run my unit test I am getting this exception:
Use of @OneToMany or @ManyToMany targeting an unmapped class: com.xxx.domain.Section.scopeTopic[com.xxx.domain.ScopeTopic]
I would assume that the error implies that my ScopeTopic entity isn't mapped to a table? I can't see with I have done wrong. Here are the Entity classes:
@Entity
public class Section
private Long id;
private List<ScopeTopic> scopeTopics;
public Section()
@Id
public Long getId()
return id;
public void setId(Long id)
this.id = id;
@OneToMany
@JoinTable(name = "section_scope", joinColumns = @JoinColumn(name="section_id"),
inverseJoinColumns = @JoinColumn(name="scope_topic_id") )
public List<ScopeTopic> getScopeTopic()
return scopeTopic;
public void setScopeTopic(List<ScopeTopic> scopeTopic)
this.scopeTopic = scopeTopic;
@Entity
@Table(name = "scope_topic")
public class ScopeTopic
private Long id;
private String topic;
public ScopeTopic()
@Id
public Long getId()
return id;
public void setId()
this.id = id;
public String getTopic()
return topic;
public void setTopic(String topic)
this.topic = topic;
I'm pretty sure it's my own lack of understanding that's at fault so some guidance would be great, thanks!
hibernate jpa
I'm finding my feet with Hibernate Annotations and I've hit a problem I hope some one can help with.
I have 2 entities, Section and ScopeTopic. Section has a List class member, so a One to Many relationship. When I run my unit test I am getting this exception:
Use of @OneToMany or @ManyToMany targeting an unmapped class: com.xxx.domain.Section.scopeTopic[com.xxx.domain.ScopeTopic]
I would assume that the error implies that my ScopeTopic entity isn't mapped to a table? I can't see with I have done wrong. Here are the Entity classes:
@Entity
public class Section
private Long id;
private List<ScopeTopic> scopeTopics;
public Section()
@Id
public Long getId()
return id;
public void setId(Long id)
this.id = id;
@OneToMany
@JoinTable(name = "section_scope", joinColumns = @JoinColumn(name="section_id"),
inverseJoinColumns = @JoinColumn(name="scope_topic_id") )
public List<ScopeTopic> getScopeTopic()
return scopeTopic;
public void setScopeTopic(List<ScopeTopic> scopeTopic)
this.scopeTopic = scopeTopic;
@Entity
@Table(name = "scope_topic")
public class ScopeTopic
private Long id;
private String topic;
public ScopeTopic()
@Id
public Long getId()
return id;
public void setId()
this.id = id;
public String getTopic()
return topic;
public void setTopic(String topic)
this.topic = topic;
I'm pretty sure it's my own lack of understanding that's at fault so some guidance would be great, thanks!
hibernate jpa
hibernate jpa
edited Feb 10 '11 at 12:15
Bozho
499k112 gold badges971 silver badges1083 bronze badges
499k112 gold badges971 silver badges1083 bronze badges
asked Feb 10 '11 at 12:06
C0deAttackC0deAttack
16.4k16 gold badges66 silver badges77 bronze badges
16.4k16 gold badges66 silver badges77 bronze badges
add a comment |
add a comment |
6 Answers
6
active
oldest
votes
Your annotations look fine. Here are the things to check:
make sure the annotation is
javax.persistence.Entity
, and notorg.hibernate.annotations.Entity
. The former makes the entity detectable. The latter is just an addition.if you are manually listing your entities (in persistence.xml, in hibernate.cfg.xml, or when configuring your session factory), then make sure you have also listed the
ScopeTopic
entitymake sure you don't have multiple
ScopeTopic
classes in different packages, and you've imported the wrong one.
15
Ah, thanks! Point 2 was the key, I had forgotten to put ScopeTopic in my annotatedClasses property list when creating the SessionFactory, n00b error!
– C0deAttack
Feb 10 '11 at 12:20
5
Point 1 was the key for me :D thanks
– PHP Avenger
Jul 3 '13 at 12:41
3
For those just hitting this comment. org.hibernate.annotations.Entity is deprecated in Hibernate 4. Point 1 does not apply anymore.
– gspatel
Apr 22 '14 at 3:50
For me it was point 2, because I kept on editing the hibernate.cfg.xml in my build folder.
– Torsten
Oct 20 '15 at 12:14
1
Thanks to remind me about the persistence.xml
– Yusuf1494
Jan 28 '16 at 8:44
|
show 4 more comments
Your entity may not listed in hibernate configuration file.
add a comment |
Mine was not having @Entity
on the many side entity
@Entity // this was commented
@Table(name = "some_table")
public class ChildEntity
@JoinColumn(name = "parent", referencedColumnName = "id")
@ManyToOne
private ParentEntity parentEntity;
add a comment |
Mostly in Hibernate
, need to add the Entity
class in hibernate.cfg.xml
like-
<hibernate-configuration>
<session-factory>
....
<mapping class="xxx.xxx.yourEntityName"/>
</session-factory>
</hibernate-configuration>
The syntax is incorrect! how can it be possible start with</...>
and close in the same way?
– elmigue017
May 13 at 6:32
how did you know that .. see it
– Sai prateek
May 13 at 16:03
add a comment |
I had the same problem and I could solve it by adding the entity into persistence.xml.
The problem was caused due to the fact that the entity was not added to the persistence config. Edit your persistence file:
<persistence-unit name="MY_PU" transaction-type="RESOURCE_LOCAL">
<provider>`enter code here`
org.hibernate.jpa.HibernatePersistenceProvider
</provider>
<class>mypackage.MyEntity</class>
...
add a comment |
In my case a has to add my classes, when building the SessionFactory
, with addAnnotationClass
Configuration configuration.configure();
StandardServiceRegistryBuilder builder = new StandardServiceRegistryBuilder().applySettings(configuration.getProperties());
SessionFactory sessionFactory = configuration
.addAnnotatedClass(MyEntity1.class)
.addAnnotatedClass(MyEntity2.class)
.buildSessionFactory(builder.build());
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f4956855%2fhibernate-problem-use-of-onetomany-or-manytomany-targeting-an-unmapped-clas%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
6 Answers
6
active
oldest
votes
6 Answers
6
active
oldest
votes
active
oldest
votes
active
oldest
votes
Your annotations look fine. Here are the things to check:
make sure the annotation is
javax.persistence.Entity
, and notorg.hibernate.annotations.Entity
. The former makes the entity detectable. The latter is just an addition.if you are manually listing your entities (in persistence.xml, in hibernate.cfg.xml, or when configuring your session factory), then make sure you have also listed the
ScopeTopic
entitymake sure you don't have multiple
ScopeTopic
classes in different packages, and you've imported the wrong one.
15
Ah, thanks! Point 2 was the key, I had forgotten to put ScopeTopic in my annotatedClasses property list when creating the SessionFactory, n00b error!
– C0deAttack
Feb 10 '11 at 12:20
5
Point 1 was the key for me :D thanks
– PHP Avenger
Jul 3 '13 at 12:41
3
For those just hitting this comment. org.hibernate.annotations.Entity is deprecated in Hibernate 4. Point 1 does not apply anymore.
– gspatel
Apr 22 '14 at 3:50
For me it was point 2, because I kept on editing the hibernate.cfg.xml in my build folder.
– Torsten
Oct 20 '15 at 12:14
1
Thanks to remind me about the persistence.xml
– Yusuf1494
Jan 28 '16 at 8:44
|
show 4 more comments
Your annotations look fine. Here are the things to check:
make sure the annotation is
javax.persistence.Entity
, and notorg.hibernate.annotations.Entity
. The former makes the entity detectable. The latter is just an addition.if you are manually listing your entities (in persistence.xml, in hibernate.cfg.xml, or when configuring your session factory), then make sure you have also listed the
ScopeTopic
entitymake sure you don't have multiple
ScopeTopic
classes in different packages, and you've imported the wrong one.
15
Ah, thanks! Point 2 was the key, I had forgotten to put ScopeTopic in my annotatedClasses property list when creating the SessionFactory, n00b error!
– C0deAttack
Feb 10 '11 at 12:20
5
Point 1 was the key for me :D thanks
– PHP Avenger
Jul 3 '13 at 12:41
3
For those just hitting this comment. org.hibernate.annotations.Entity is deprecated in Hibernate 4. Point 1 does not apply anymore.
– gspatel
Apr 22 '14 at 3:50
For me it was point 2, because I kept on editing the hibernate.cfg.xml in my build folder.
– Torsten
Oct 20 '15 at 12:14
1
Thanks to remind me about the persistence.xml
– Yusuf1494
Jan 28 '16 at 8:44
|
show 4 more comments
Your annotations look fine. Here are the things to check:
make sure the annotation is
javax.persistence.Entity
, and notorg.hibernate.annotations.Entity
. The former makes the entity detectable. The latter is just an addition.if you are manually listing your entities (in persistence.xml, in hibernate.cfg.xml, or when configuring your session factory), then make sure you have also listed the
ScopeTopic
entitymake sure you don't have multiple
ScopeTopic
classes in different packages, and you've imported the wrong one.
Your annotations look fine. Here are the things to check:
make sure the annotation is
javax.persistence.Entity
, and notorg.hibernate.annotations.Entity
. The former makes the entity detectable. The latter is just an addition.if you are manually listing your entities (in persistence.xml, in hibernate.cfg.xml, or when configuring your session factory), then make sure you have also listed the
ScopeTopic
entitymake sure you don't have multiple
ScopeTopic
classes in different packages, and you've imported the wrong one.
answered Feb 10 '11 at 12:14
BozhoBozho
499k112 gold badges971 silver badges1083 bronze badges
499k112 gold badges971 silver badges1083 bronze badges
15
Ah, thanks! Point 2 was the key, I had forgotten to put ScopeTopic in my annotatedClasses property list when creating the SessionFactory, n00b error!
– C0deAttack
Feb 10 '11 at 12:20
5
Point 1 was the key for me :D thanks
– PHP Avenger
Jul 3 '13 at 12:41
3
For those just hitting this comment. org.hibernate.annotations.Entity is deprecated in Hibernate 4. Point 1 does not apply anymore.
– gspatel
Apr 22 '14 at 3:50
For me it was point 2, because I kept on editing the hibernate.cfg.xml in my build folder.
– Torsten
Oct 20 '15 at 12:14
1
Thanks to remind me about the persistence.xml
– Yusuf1494
Jan 28 '16 at 8:44
|
show 4 more comments
15
Ah, thanks! Point 2 was the key, I had forgotten to put ScopeTopic in my annotatedClasses property list when creating the SessionFactory, n00b error!
– C0deAttack
Feb 10 '11 at 12:20
5
Point 1 was the key for me :D thanks
– PHP Avenger
Jul 3 '13 at 12:41
3
For those just hitting this comment. org.hibernate.annotations.Entity is deprecated in Hibernate 4. Point 1 does not apply anymore.
– gspatel
Apr 22 '14 at 3:50
For me it was point 2, because I kept on editing the hibernate.cfg.xml in my build folder.
– Torsten
Oct 20 '15 at 12:14
1
Thanks to remind me about the persistence.xml
– Yusuf1494
Jan 28 '16 at 8:44
15
15
Ah, thanks! Point 2 was the key, I had forgotten to put ScopeTopic in my annotatedClasses property list when creating the SessionFactory, n00b error!
– C0deAttack
Feb 10 '11 at 12:20
Ah, thanks! Point 2 was the key, I had forgotten to put ScopeTopic in my annotatedClasses property list when creating the SessionFactory, n00b error!
– C0deAttack
Feb 10 '11 at 12:20
5
5
Point 1 was the key for me :D thanks
– PHP Avenger
Jul 3 '13 at 12:41
Point 1 was the key for me :D thanks
– PHP Avenger
Jul 3 '13 at 12:41
3
3
For those just hitting this comment. org.hibernate.annotations.Entity is deprecated in Hibernate 4. Point 1 does not apply anymore.
– gspatel
Apr 22 '14 at 3:50
For those just hitting this comment. org.hibernate.annotations.Entity is deprecated in Hibernate 4. Point 1 does not apply anymore.
– gspatel
Apr 22 '14 at 3:50
For me it was point 2, because I kept on editing the hibernate.cfg.xml in my build folder.
– Torsten
Oct 20 '15 at 12:14
For me it was point 2, because I kept on editing the hibernate.cfg.xml in my build folder.
– Torsten
Oct 20 '15 at 12:14
1
1
Thanks to remind me about the persistence.xml
– Yusuf1494
Jan 28 '16 at 8:44
Thanks to remind me about the persistence.xml
– Yusuf1494
Jan 28 '16 at 8:44
|
show 4 more comments
Your entity may not listed in hibernate configuration file.
add a comment |
Your entity may not listed in hibernate configuration file.
add a comment |
Your entity may not listed in hibernate configuration file.
Your entity may not listed in hibernate configuration file.
answered Aug 11 '15 at 10:56
chetan.sankhalachetan.sankhala
3462 silver badges13 bronze badges
3462 silver badges13 bronze badges
add a comment |
add a comment |
Mine was not having @Entity
on the many side entity
@Entity // this was commented
@Table(name = "some_table")
public class ChildEntity
@JoinColumn(name = "parent", referencedColumnName = "id")
@ManyToOne
private ParentEntity parentEntity;
add a comment |
Mine was not having @Entity
on the many side entity
@Entity // this was commented
@Table(name = "some_table")
public class ChildEntity
@JoinColumn(name = "parent", referencedColumnName = "id")
@ManyToOne
private ParentEntity parentEntity;
add a comment |
Mine was not having @Entity
on the many side entity
@Entity // this was commented
@Table(name = "some_table")
public class ChildEntity
@JoinColumn(name = "parent", referencedColumnName = "id")
@ManyToOne
private ParentEntity parentEntity;
Mine was not having @Entity
on the many side entity
@Entity // this was commented
@Table(name = "some_table")
public class ChildEntity
@JoinColumn(name = "parent", referencedColumnName = "id")
@ManyToOne
private ParentEntity parentEntity;
edited Mar 25 at 23:21
answered Mar 14 '16 at 17:03
YouYouYouYou
2,7521 gold badge18 silver badges46 bronze badges
2,7521 gold badge18 silver badges46 bronze badges
add a comment |
add a comment |
Mostly in Hibernate
, need to add the Entity
class in hibernate.cfg.xml
like-
<hibernate-configuration>
<session-factory>
....
<mapping class="xxx.xxx.yourEntityName"/>
</session-factory>
</hibernate-configuration>
The syntax is incorrect! how can it be possible start with</...>
and close in the same way?
– elmigue017
May 13 at 6:32
how did you know that .. see it
– Sai prateek
May 13 at 16:03
add a comment |
Mostly in Hibernate
, need to add the Entity
class in hibernate.cfg.xml
like-
<hibernate-configuration>
<session-factory>
....
<mapping class="xxx.xxx.yourEntityName"/>
</session-factory>
</hibernate-configuration>
The syntax is incorrect! how can it be possible start with</...>
and close in the same way?
– elmigue017
May 13 at 6:32
how did you know that .. see it
– Sai prateek
May 13 at 16:03
add a comment |
Mostly in Hibernate
, need to add the Entity
class in hibernate.cfg.xml
like-
<hibernate-configuration>
<session-factory>
....
<mapping class="xxx.xxx.yourEntityName"/>
</session-factory>
</hibernate-configuration>
Mostly in Hibernate
, need to add the Entity
class in hibernate.cfg.xml
like-
<hibernate-configuration>
<session-factory>
....
<mapping class="xxx.xxx.yourEntityName"/>
</session-factory>
</hibernate-configuration>
edited May 13 at 7:41
answered May 5 '16 at 6:37
Sai prateekSai prateek
4,9917 gold badges33 silver badges53 bronze badges
4,9917 gold badges33 silver badges53 bronze badges
The syntax is incorrect! how can it be possible start with</...>
and close in the same way?
– elmigue017
May 13 at 6:32
how did you know that .. see it
– Sai prateek
May 13 at 16:03
add a comment |
The syntax is incorrect! how can it be possible start with</...>
and close in the same way?
– elmigue017
May 13 at 6:32
how did you know that .. see it
– Sai prateek
May 13 at 16:03
The syntax is incorrect! how can it be possible start with
</...>
and close in the same way?– elmigue017
May 13 at 6:32
The syntax is incorrect! how can it be possible start with
</...>
and close in the same way?– elmigue017
May 13 at 6:32
how did you know that .. see it
– Sai prateek
May 13 at 16:03
how did you know that .. see it
– Sai prateek
May 13 at 16:03
add a comment |
I had the same problem and I could solve it by adding the entity into persistence.xml.
The problem was caused due to the fact that the entity was not added to the persistence config. Edit your persistence file:
<persistence-unit name="MY_PU" transaction-type="RESOURCE_LOCAL">
<provider>`enter code here`
org.hibernate.jpa.HibernatePersistenceProvider
</provider>
<class>mypackage.MyEntity</class>
...
add a comment |
I had the same problem and I could solve it by adding the entity into persistence.xml.
The problem was caused due to the fact that the entity was not added to the persistence config. Edit your persistence file:
<persistence-unit name="MY_PU" transaction-type="RESOURCE_LOCAL">
<provider>`enter code here`
org.hibernate.jpa.HibernatePersistenceProvider
</provider>
<class>mypackage.MyEntity</class>
...
add a comment |
I had the same problem and I could solve it by adding the entity into persistence.xml.
The problem was caused due to the fact that the entity was not added to the persistence config. Edit your persistence file:
<persistence-unit name="MY_PU" transaction-type="RESOURCE_LOCAL">
<provider>`enter code here`
org.hibernate.jpa.HibernatePersistenceProvider
</provider>
<class>mypackage.MyEntity</class>
...
I had the same problem and I could solve it by adding the entity into persistence.xml.
The problem was caused due to the fact that the entity was not added to the persistence config. Edit your persistence file:
<persistence-unit name="MY_PU" transaction-type="RESOURCE_LOCAL">
<provider>`enter code here`
org.hibernate.jpa.HibernatePersistenceProvider
</provider>
<class>mypackage.MyEntity</class>
...
edited Sep 3 '18 at 15:11
Daniel Rodríguez
1691 gold badge4 silver badges19 bronze badges
1691 gold badge4 silver badges19 bronze badges
answered Aug 25 '18 at 10:06
enkaenka
11 bronze badge
11 bronze badge
add a comment |
add a comment |
In my case a has to add my classes, when building the SessionFactory
, with addAnnotationClass
Configuration configuration.configure();
StandardServiceRegistryBuilder builder = new StandardServiceRegistryBuilder().applySettings(configuration.getProperties());
SessionFactory sessionFactory = configuration
.addAnnotatedClass(MyEntity1.class)
.addAnnotatedClass(MyEntity2.class)
.buildSessionFactory(builder.build());
add a comment |
In my case a has to add my classes, when building the SessionFactory
, with addAnnotationClass
Configuration configuration.configure();
StandardServiceRegistryBuilder builder = new StandardServiceRegistryBuilder().applySettings(configuration.getProperties());
SessionFactory sessionFactory = configuration
.addAnnotatedClass(MyEntity1.class)
.addAnnotatedClass(MyEntity2.class)
.buildSessionFactory(builder.build());
add a comment |
In my case a has to add my classes, when building the SessionFactory
, with addAnnotationClass
Configuration configuration.configure();
StandardServiceRegistryBuilder builder = new StandardServiceRegistryBuilder().applySettings(configuration.getProperties());
SessionFactory sessionFactory = configuration
.addAnnotatedClass(MyEntity1.class)
.addAnnotatedClass(MyEntity2.class)
.buildSessionFactory(builder.build());
In my case a has to add my classes, when building the SessionFactory
, with addAnnotationClass
Configuration configuration.configure();
StandardServiceRegistryBuilder builder = new StandardServiceRegistryBuilder().applySettings(configuration.getProperties());
SessionFactory sessionFactory = configuration
.addAnnotatedClass(MyEntity1.class)
.addAnnotatedClass(MyEntity2.class)
.buildSessionFactory(builder.build());
answered Sep 4 '18 at 10:02
VLazzarovaVLazzarova
234 bronze badges
234 bronze badges
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f4956855%2fhibernate-problem-use-of-onetomany-or-manytomany-targeting-an-unmapped-clas%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown