Alter order in which JPA adds rows

I have a class which has a reference to itself. This causes a problem because JPA tries to add the fields before the actual class itself which causes a "Cannot add or update a child row: a foreign key constraint fails" error.

See the code snippet below:

@Entity
public class Profile {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;
private String bio;
private String location;
private String website;
private String name;
private String photo;
@JsonSerialize(using = ProfileSerializer.class)
@JsonDeserialize(using = ProfileDeserializer.class)
@ManyToMany(cascade = {CascadeType.PERSIST, CascadeType.MERGE})
private List<Profile> followers;
@JsonManagedReference
@OneToMany(cascade = CascadeType.ALL, orphanRemoval = true)
private List<Kwetter> kwetters;
@JsonDeserialize(using = ProfileDeserializer.class)
@JsonSerialize(using = ProfileSerializer.class)
@ManyToMany(cascade = {CascadeType.PERSIST, CascadeType.MERGE})
private List<Profile> following;

public Profile() {
}

I am talking about the 'following' field. The profile is always following itself. Hence the problem described above.

I have tried searching for a way to alter the order in which JPA adds the rows to the table. But no luck so far.

Does anyone know how, or does anyone know a workaround?

Thanks!