Questions tagged [mappedsuperclass]

Annotation for a class that entity classes inherit from

Annotation for a class that entity classes inherit from. The mapped super class is annotated with a specific @annotation and does not exist in the database as a table. Typically, the purpose of such a mapped super class is to define state and mapping information that is common to multiple entity classes.

The concept of mapped super classes is for example used in:

105 questions
1
vote
2 answers

Multiple level Inheritance Mapping with doctrine 2

I have three entities which are "Addressable" (can have an Address): Delivery Points Customers Distribution Centers Every Addressable entity also is Geolocatable (has latitude and longitude), but i have entities that are Geolocatable but not…
1
vote
1 answer

Mapped Super Class Symfony2.2

I have created a Bundle (called MYBUNDLE) with just 2 entities: Menu and Group. Both were declared as mappedSuperclass because I need this bundle could be use for other projects. As a condition, projects will have to extend from these classes to…
user2288043
  • 241
  • 4
  • 15
1
vote
1 answer

Openjpa mappedsuperclass in a separate jar

We are trying to build some services with entities that have common fields between them. To handle this the approach we have taken is to define a base class with all the common fields and extend all the others from this. The base class is defined as…
praveenj
  • 349
  • 1
  • 2
  • 15
1
vote
0 answers

Using Mapped superclasses with Doctrine 2

For school i am making a php project that works with a ORM. Doctrine 2. It has to have a inheritance in it. I made the following setup and i want to print the customers on the screen. because of the required inheritance i would extend the class…
arcooverbeek
  • 185
  • 8
1
vote
2 answers

Why my @MappedSuperClass doesn't work?

I have the following @MappedSuperClass and @Entity : @MappedSuperclass public class SuperClass implements Serializable {....} @Entity @Inheritance(strategy=InheritanceType.TABLE_PER_CLASS) @Table(name = "TABLE1") public class Table1 extends…
Cytemax
  • 61
  • 1
  • 7
0
votes
2 answers

@MappedSuperClass in Hibernate = AnnotationException: Unknown mappedBy

Error: Caused by: org.hibernate.AnnotationException: Unknown mappedBy in: com.xxx.data.dao.classes.Categories.categoriesLang, referenced property unknown: com.xxx.data.dao.classes.superclasses.CategoriesLang.categories My setup: Hibernate…
Dani
  • 4,001
  • 7
  • 36
  • 60
0
votes
1 answer

Cannot access javax.persistence.MappedSuperclass Spring Boot 3

I've migrated my project from Spring Boot 2 to Spring Boot 3 and I've been getting this error: [1;31mERROR[m] COMPILATION ERROR : [1;34mINFO[m] ------------------------------------------------------------- [1;31mERROR[m] cannot access…
0
votes
0 answers

Spring boot JPA MappedSuperClass baseEntity mapping error

I created a mappedSuperClass baseEntity that maps createdDate to every entity in the project which looks like this @Getter @MappedSuperclass @EntityListeners(AuditingEntityListener.class) public abstract class BaseEntity { @JsonProperty …
0
votes
0 answers

Spring boot CriteraQuery attribute not found error

I am trying to write CriteriaQuery in Spring boot application I have Entity class as below @Entity @Data class Student extends BaseEntity implements Serializable{ @EmbeddedId StudentID id; @Column(name = "Student_name") String…
0
votes
1 answer

app is attempting to refresh leading to @MappedSuperClass repository errors - Failed to create query for method public abstract, Not an entity

I have an app that calculates Roto values from given Stats. I refactored it to use @MapperSuperclass instead of saving only 1 Entity (with extra fields set to 0) and now I am getting an error. The weird thing is that my app still runs and does its…
dbrewster
  • 611
  • 7
  • 16
0
votes
1 answer

Fail to map by MappedSuperclass's attribute

Entities: @Entity @Table(name = "ITEM") @Inheritance(strategy = InheritanceType.JOINED) public class Item extends Base { @OneToOne(mappedBy = "item") protected Doc doc; } @MappedSuperclass public abstract class Doc extends BaseDoc…
ghithon
  • 1
  • 1
0
votes
1 answer

Symfony 6: create Repository class for MappedSuperclass

I have a MappedSuperclass entity Person, and a number of child entities: Teacher Student Janitor I want to implement a Repository class for all these entities with a method findByString() like this: public function findByString($searchStr) { …
K. Weber
  • 2,643
  • 5
  • 45
  • 77
0
votes
1 answer

Updating a child entity

This is bit lengthy but a simple conceptual problem. Please take some time to read :) I have 2 tables with exactly same columns except their primary keys are different. So I have created a @MappedSuperclass with common columns and have child classes…
0
votes
0 answers

Hibernate / Referential integrity constraint violation error while trying to persist a map of objects in a MappedSuperclass context

I have a superclass (annotated with the @MappedSuperclass strategy) and 2 persistable subclasses: SubClass1 and SubClass2. This superclass contains a map of objects of type "EmbeddedObject". The problem is that when I instantiate an entity of type…
0
votes
0 answers

How to handle inheritance in Java Spring boot (Gradle)

Well I'm quite new to this area and trying to understand the concepts of inheritance relationship mapping in hibernate . The scenario I'm facing is to build a recruitment web app which have different users , such…