-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[jpa] Add support for superclasses and interfaces of entities
- Loading branch information
1 parent
c7e79a9
commit 39f3922
Showing
5 changed files
with
93 additions
and
12 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
examples/strict/src/main/java/org/jboss/shamrock/example/jpa/Animal.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package org.jboss.shamrock.example.jpa; | ||
|
||
/** | ||
* @author Emmanuel Bernard [email protected] | ||
*/ | ||
public class Animal { | ||
private double weight; | ||
|
||
public double getWeight() { | ||
return weight; | ||
} | ||
|
||
public void setWeight(double weight) { | ||
this.weight = weight; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ | |
* @author Emmanuel Bernard [email protected] | ||
*/ | ||
@Entity | ||
public class Customer { | ||
public class Customer extends Human { | ||
@Id | ||
// no getter explicitly to test field only reflective access | ||
private Long id; | ||
|
21 changes: 21 additions & 0 deletions
21
examples/strict/src/main/java/org/jboss/shamrock/example/jpa/Human.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package org.jboss.shamrock.example.jpa; | ||
|
||
import javax.persistence.MappedSuperclass; | ||
|
||
/** | ||
* Mapped superclass test | ||
* | ||
* @author Emmanuel Bernard [email protected] | ||
*/ | ||
@MappedSuperclass | ||
public class Human extends Animal { | ||
private String name; | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters