473,386 Members | 1,764 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

adding phone and address records

oll3i
679 512MB
I add contact records
Expand|Select|Wrap|Line Numbers
  1. try {
  2.     InitialContext ic = new InitialContext();
  3.     Object objContactBean = ic.lookup("java:comp/env/ejb/ContactRef");
  4.     LocalContactHome contactHome = (LocalContactHome) objContactBean;
  5.  
  6.     contactHome.create("01", "Andrzej", "Miążek","andrzej_miazek@op.pl");
  7.     contactHome.create("02", "Michał", "Kacper","michal_kacper@op.pl");
  8.     contactHome.create("03", "Aleksandra", "Owczarek","aleksa1981@wp.pl"); 
  9.     contactHome.create("04", "Krzysztof", "Żak","zaczek@poczta.onet.pl");
  10.     contactHome.create("05", "Oskar", "Paprocki","oskarek1984@qmail.com");
  11.  
  12. } catch(Exception e) {
  13.     e.printStackTrace();
  14.     out.println("Create Contacts Failed : " + e.toString()); 
  15.  
then i want to add phones and addresses records
do i use only the "create" method defined in LocalAddressHome and in LocalPhoneHome

the relationship between ContactBean and PhoneBean is one to many the same with addresses the referencing field from ContactBean to PhoneBean is "phones" a collection and from ContactBean to AddressBean is "addresses" a collection
Does the contactID go to the database when i invoke "create" method of LocalAddressHome or LocalPhoneHome


my interfaces
LocalAddressHome:
Expand|Select|Wrap|Line Numbers
  1. public interface LocalAddressHome extends EJBLocalHome {
  2.     public LocalAddress create (
  3.             String contactID,
  4.             String addressID,
  5.             String street, 
  6.             String city, 
  7.             String zip, 
  8.             String country)
  9.         throws CreateException;
  10.  
  11.     public LocalAddress findByPrimaryKey(String addressID)
  12.         throws FinderException;
  13. }
  14.  
LocalPhoneHome:
Expand|Select|Wrap|Line Numbers
  1. public interface LocalPhoneHome  extends EJBLocalHome {
  2.         public LocalPhone create (
  3.                 String contactID,
  4.                 String phoneID,
  5.                 String phone)
  6.             throws CreateException;
  7.         public Collection findAllPhones ()
  8.             throws FinderException;
  9.         public LocalPhone findByPrimaryKey(String phoneID)
  10.             throws FinderException;
  11.         public Collection findByContactID(String contactID) 
  12.         throws FinderException;
  13.  
  14.     }
  15.  
Dec 6 '08 #1
2 1162
oll3i
679 512MB
hihi i'm addicted ... another addiction on my list :) but it's a good addiction
Dec 6 '08 #2
Nepomuk
3,112 Expert 2GB
Sorry if this seems weird, but what is your actual question here?

Greetings,
Nepomuk
Dec 7 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: grlgeek | last post by:
I have a report for creating the switchboard labels for our phone system receptionist switchboard. The template has 12 records per column. I setup a report that will create the labels and put a...
1
by: Andrew | last post by:
Hey all, I am very new to ASP.Net (and .Net in general), but that isn't stopping the boss from wanting to begin new projects in it. This latest project has me kinda stumped and after a couple...
5
by: JJ_377 | last post by:
I want a JavaScript validation function to fire on an ASP.NET textbox's change event. Here's what I've been trying and it is not working. The following added in the webform's page load event: ...
3
by: Ankit Aneja | last post by:
I have a strange situation and I have no idea how to solve this. Its a Recruitment Search Page,in the Admin Page, for every button click event the Admin Person has to create a checkbox on the users...
0
by: ReidarT | last post by:
I use ADODB to add some records from one table to another. It seems that the last record is missing in the updated table. call LeggTilFirma() .... Public Function LeggTilFirma() Dim...
3
by: mcse4u | last post by:
I would like to be able to add a hyperlink to the posted form below that automatically creates a hyperlink of the email address of the person submitting the form. Can someone please help me with...
8
by: Tony A. | last post by:
I'm using VB .Net 2005 with Access 2003 for the database. The database has two tables: tblContact (ContactNum (k), lastname, firstname, phone, email, compNum) and tblCompany (CompNun (k),...
8
by: David | last post by:
I'm trying to add a date and time to an html form, but I'm having a bit of trouble getting it working. Any suggestions? Thanks! ~ David (merlin001_at_gmail_dot_com)
1
by: jhansi | last post by:
hi... I have created a form it's working properly.... but i want to consider phone number and STD code in two different text field for a single lable phone number..... and I have considered...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.