0

I have an entity and i am creating object for it. object is created and i can set the values. But reference shows null. I am not getting why. Please check my code:

@Entity
@Table(name = "a_table")
public class A {

private static final long serialVersionUID = -8674959693713707364L;

/** The id. */
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY, generator = "IdOrGenerated")
@GenericGenerator(name = "IdOrGenerated", strategy = "foo.IdOrGenerated")
@Column(name = "id")
private Long id;

private Creator creator;

public A() {
}

public A(Creator pCreator) {
    this.creator = pCreator;
}

//setters and getters for id and creator

}

In class B i am creating object A a = new A(); when i debug and see 'a' value is null.

user1770589
  • 375
  • 1
  • 6
  • 19

0 Answers0