[1.2.4] CascadeType.ALL generates "NO ACTION" DDL instead of "CASCADE"

35 views
Skip to first unread message

qertoip

unread,
Jan 7, 2012, 7:38:00 PM1/7/12
to play-framework
Despite using "CascadeType.ALL" the following code creates foreign key
"ON UPDATE NO ACTION ON DELETE NO ACTION" instead of expected "ON
UPDATE CASCADE ON DELETE CASCADE":

@Entity
public class User extends Model {

@OneToMany(cascade = CascadeType.ALL, mappedBy = "author")
public List<Post> posts;

// ...
}

@Entity
public class Post extends Model {

@ManyToOne
public User author;

// ...
}

play test # -> http://localhost:9000/@tests

This happens both for the default db=mem and PostgreSQL 9.1.
Reply all
Reply to author
Forward
0 new messages