Ok, got past last problem (thanks dave) and have uncommented the code on
index.cfm. I followed the example on Manju's blog entitled Coldfusion-ORM:
Define One-to-Many and Many to One Relationships. The article was for one
related table, mine is for three. I used the built-in Apache database. The
orm is creating the tables, though it doesn't seem to be reflecting my
latest changes. Anyway, the code is below the error.
Thanks,
Mark
ids for this class must be manually assigned before calling save(): Emails
Root cause :org.hibernate.id.IdentifierGenerationException: ids for this
class must be manually assigned before calling save(): Emails The error
occurred in C:\ColdFusion9\wwwroot\Orm\index.cfm: line 48
46 : */
47 :
48 : EntitySave(newContact);
49 :
50 :
Code for index.cfm (just a test for learning):
/*
Create a Contact with one address, one phone number
and one email address
*/
newContact = new Contacts();
newContact.setFirstName("Mark");
newContact.setLastName("Fuqua");
newAddress = new Addresses();
newAddress.setAddressDescription("2301 Mount Carmel
Road");
newAddress.setCity("Parkton");
newAddress.setState("MD");
newAddress.setZip("21120");
newEmail = new Emails();
newEmail.setEmailDescription("Work Email");
newEmail.setEmail("m...@mdprofinish.com");
newPhoneNumber = new PhoneNumbers();
newPhoneNumber.setPhoneDescription("Cell");
newPhoneNumber.setPhoneNumber("410-215-7356");
/*
Associate the Addresses, Emails and
PhoneNumbers with Contacts
*/
newContact.addaddresses(newAddress);
newContact.addEmails(newEmail);
newContact.addphoneNumbers(newPhoneNumber);
/*
Establish the relationship from the
other side
*/
newPhoneNumber.setContacts(newContact);
newAddress.setContacts(newContact);
newEmail.setContacts(newContact);
/*
Save new Contacts, email, address, phone
info should be saved as well
*/
EntitySave(newContact);
DisplayContacts();
~|
Want to reach the ColdFusion community with something they want? Let them know
on the House of Fusion mailing lists
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:329681
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4