Skip to content

Commit

Permalink
Hibernate ORM also can use public fields
Browse files Browse the repository at this point in the history
  • Loading branch information
loicmathieu committed Nov 9, 2022
1 parent 5e84a21 commit f86e5bb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* public void doSomething() {
* MyEntity entity1 = new MyEntity();
* entity1.setField("field-1");
* entity1.field = "field-1";
* em.persist(entity1);
*
* List<MyEntity> entities = em.createQuery("from MyEntity", MyEntity.class).getResultList();
Expand All @@ -25,26 +25,11 @@
*/
@Entity
public class MyEntity {
private Long id;
private String field;

@Id
@GeneratedValue
public Long getId() {
return id;
}

public void setId(Long id) {
this.id = id;
}
public Long id;

public String getField() {
return field;
}

public void setField(String field) {
this.field = field;
}
public String field;
}
{/if}
{#if input.selected-extensions-ga.contains('io.quarkus:quarkus-hibernate-orm-panache')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
* public void doSomething() {
* MyEntity entity1 = new MyEntity();
* entity1.setField("field-1");
* entity1.field = "field-1";
* em.persist(entity1);
*
* List<MyEntity> entities = em.createQuery("from MyEntity", MyEntity.class).getResultList();
Expand All @@ -24,24 +24,9 @@
*/
@Entity
public class MyEntity {
private Long id;
private String field;

@Id
@GeneratedValue
public Long getId() {
return id;
}

public void setId(Long id) {
this.id = id;
}

public String getField() {
return field;
}
public Long id;

public void setField(String field) {
this.field = field;
}
public String field;
}

0 comments on commit f86e5bb

Please sign in to comment.