John.. I've got things close to working but ran into an issue related to the address_id that resides in the Organization table (aka Person table in your example).. It turns out to be null and it causes the problem below.. I guess I was thinking that the address-id autogenerated field created by the first insert would be available for use in the 2nd insert.. For now I've disabled transactions but saw this with transactions enabled as well.. I'm guessing I might be going about something wrong perhaps.... I'll look at it some more tomorrow...
FINE: Adding record, and returning autogenerated id : ADD_ADDRESS {
fSqlText = INSERT INTO Address (Street_Address1, Street_Address2, City, State, Zipcode) values (?,?,?,?,?)
Params = [1234 First St, null, Los Angeles, CA, 90067]
}
Mar 3, 2013 10:53:08 PM hirondelle.web4j.database.SqlEditor addRecord
FINE: Adding record, and returning autogenerated id : ADD_ORGANIZATION {
fSqlText = INSERT INTO Organization (address_id, name, phone, admin_name, admin_phone, admin_email) VALUES (?,?,?,?,?,?)
Params = [null, MyOrganization, 310-123-9409, Joe Blow, 310-123-0239, foo@bar.com]
}
Mar 3, 2013 10:53:08 PM hirondelle.web4j.Controller logAndEmailSeriousProblem
SEVERE: TOP LEVEL CATCHING Throwable
Mar 3, 2013 10:53:08 PM hirondelle.web4j.Controller logAndEmailSeriousProblem
SEVERE:
Error for web application Electricity Tracker/
4.8.0.0.
*** Messages : + [Cannot execute edit. Error Id code : 0 org.postgresql.util.PSQLException: ERROR: column "address_id" is of type bigint but expression is of type character varying
Hint: You will need to rewrite or cast the expression.
Position: 98 ADD_ORGANIZATION {
fSqlText = INSERT INTO Organization (address_id, name, phone, admin_name, admin_phone, admin_email) VALUES (?,?,?,?,?,?)
Params = [null, MyOrganization, 310-123-9409, Joe Blow, 310-123-0239, foo@bar.com]
}
] Has Been Displayed : false ***
--------------------------------------------------------