Created
September 12, 2013 18:04
-
-
Save InfoSec812/6541526 to your computer and use it in GitHub Desktop.
Mapping a stored procedure in JPA 2.0
This file contains hidden or 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
| @Entity(name="com.hps.mdm.legacy.domain.person") | |
| @Table(name = "PERSON") | |
| @SqlResultSetMapping(name="myMapping", entities={Person.class, Agent.class, Contact.class}) | |
| @NamedNativeQuery(name="PersonPLSQL", query="CALL STORED PROCEDURE", resultSetMapping="myMapping") | |
| public @Data class Person implements Serializable { | |
| private static final long serialVersionUID = 1L; | |
| // @Max(value=?) @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation | |
| @Id | |
| @Basic(optional = false) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment