EO awake ??
EO awake ??
- Subject: EO awake ??
- From: Theodore Petrosky <email@hidden>
- Date: Tue, 06 Sep 2016 12:27:16 -0400
I have a to one relation Person to one Security. I keep all my security booleans in entity Security.
I am overriding awakeFromInsertion so that when I create a new person, it is assigned a security entity.
I have a problem in migrations. I have a postupgrade method that creates a person. in this method I have:
Person.createPerson(editingContext, new NSTimestamp(), "Theodore", true, "Petrosky", “pw", “user", Security.createSecurity(editingContext, true, true, true, true, true));
the security is mandatory as it should be. However on first run (to run the migrations), I end up with two security entities. Obviously, when a person is created and inserted the awake is fired and I get this orphan.
How can I eliminate this extra security entity? I was hoping that I could just not add a security entity in the createPerson line, but then my app complains that security is mandatory.
Person.createPerson(editingContext, new NSTimestamp(), "Theodore", true, "Petrosky", “pw", “user”, null);
In the past I would have just used ERXJDBCUtilities.executeUpdate and added the admin user with manual sql. I thought I would be clever and use the postupgrade method.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden