Hi all,
I've got 2 models.
public class Ship extends Model {
@Id
public Long id;
public User user;
}
public class User extends Model {
@Id
public Long id;
public String email;
public String name;
}
On my Ship class, i've got this method :
public static List<Ship> getAlls() {
return Ship.all().fetch();
}
First, I created a Ship like this :
Ship s = new Ship();
s.name = "BB";
User u = User.findById(1L);
s.user = u;
s.save();
When I looked in BD, the raw was correct, user id is ok
When I try to read all ships with this method :
return Model.all(Ship.class).fetch();
ship.user is null
Where's the pb ?
Thxs