Skip to content

Commit

Permalink
Added dummy column for entity for EclipseLink.
Browse files Browse the repository at this point in the history
  • Loading branch information
arjantijms committed May 5, 2017
1 parent 93f4711 commit 7fae17e
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 4 deletions.
Expand Up @@ -8,12 +8,15 @@
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

@Entity
@Entity(name="Child1")
public class Child {

@Id
@GeneratedValue(strategy = IDENTITY)
private Long id;

@SuppressWarnings("unused")
private int dummy = 1;

@ManyToOne
@JoinColumn(name = "parent_id", insertable = false, updatable = false)
Expand Down
Expand Up @@ -14,12 +14,15 @@
import javax.persistence.OneToMany;
import javax.persistence.OrderColumn;

@Entity
@Entity(name="Parent1")
public class Parent {

@Id
@GeneratedValue(strategy = IDENTITY)
private Long id;

@SuppressWarnings("unused")
private int dummy = 1;

@OneToMany(cascade = ALL, fetch = EAGER)
@OrderColumn
Expand Down
Expand Up @@ -7,7 +7,7 @@
import javax.persistence.Id;
import javax.persistence.ManyToOne;

@Entity
@Entity(name="Child2")
public class Child {

@Id
Expand Down
Expand Up @@ -13,12 +13,15 @@
import javax.persistence.OneToMany;
import javax.persistence.OrderColumn;

@Entity
@Entity(name="Parent2")
public class Parent {

@Id
@GeneratedValue(strategy = IDENTITY)
private Long id;

@SuppressWarnings("unused")
private int dummy = 1;

@OneToMany(cascade = ALL, fetch = EAGER, mappedBy = "parent")
@OrderColumn
Expand Down
Expand Up @@ -12,6 +12,9 @@ public class Child {
@Id
@GeneratedValue(strategy = IDENTITY)
private Long id;

@SuppressWarnings("unused")
private int dummy = 1;

public Long getId() {
return id;
Expand Down
Expand Up @@ -20,6 +20,9 @@ public class Parent {
@Id
@GeneratedValue(strategy = IDENTITY)
private Long id;

@SuppressWarnings("unused")
private int dummy = 1;

@OneToMany(cascade = ALL, fetch = EAGER)
@OrderColumn
Expand Down

0 comments on commit 7fae17e

Please sign in to comment.