DummyEntity renamed to Message
This commit is contained in:
+4
-5
@@ -3,13 +3,12 @@ package com.baeldung.jpa.stringcast;
|
||||
import javax.persistence.*;
|
||||
|
||||
@SqlResultSetMapping(name = "textQueryMapping", classes = {
|
||||
@ConstructorResult(targetClass = DummyEntity.class, columns = {
|
||||
@ConstructorResult(targetClass = Message.class, columns = {
|
||||
@ColumnResult(name = "text")
|
||||
})
|
||||
})
|
||||
@Entity
|
||||
@Table(name = "dummy")
|
||||
public class DummyEntity {
|
||||
public class Message {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@@ -17,11 +16,11 @@ public class DummyEntity {
|
||||
|
||||
private String text;
|
||||
|
||||
public DummyEntity() {
|
||||
public Message() {
|
||||
|
||||
}
|
||||
|
||||
public DummyEntity(String text) {
|
||||
public Message(String text) {
|
||||
this.text = text;
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
<persistence-unit name="jpa-h2">
|
||||
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
|
||||
<class>com.baeldung.jpa.stringcast.DummyEntity</class>
|
||||
<class>com.baeldung.jpa.stringcast.Message</class>
|
||||
<properties>
|
||||
<property name="javax.persistence.jdbc.driver" value="org.h2.Driver" />
|
||||
<property name="javax.persistence.jdbc.url" value="jdbc:h2:mem:test" />
|
||||
|
||||
Reference in New Issue
Block a user