KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > ojb > broker > MultithreadedReadTest


1 package org.apache.ojb.broker;
2
3 import java.util.ArrayList JavaDoc;
4 import java.util.Arrays JavaDoc;
5 import java.util.Collection JavaDoc;
6 import java.util.Iterator JavaDoc;
7 import java.util.List JavaDoc;
8
9 import org.apache.ojb.broker.metadata.ClassDescriptor;
10 import org.apache.ojb.broker.metadata.ObjectReferenceDescriptor;
11 import org.apache.ojb.broker.query.Criteria;
12 import org.apache.ojb.broker.query.QueryByCriteria;
13 import org.apache.ojb.junit.JUnitExtensions;
14
15 /**
16  * Tests multithreaded read of objects using proxy for nested 1:1 references
17  * Account --> Buyer --> Address --> AddressType
18  *
19  * @author <a HREF="mailto:armin@codeAuLait.de">Armin Waibel</a>
20  * @version $Id: MultithreadedReadTest.java,v 1.3.2.2 2004/09/30 13:52:02 arminw Exp $
21  */

22 public class MultithreadedReadTest extends JUnitExtensions.MultiThreadedTestCase
23 {
24     static final int NONE = ObjectReferenceDescriptor.CASCADE_NONE;
25     static final int LINK = ObjectReferenceDescriptor.CASCADE_LINK;
26     static final int OBJECT = ObjectReferenceDescriptor.CASCADE_OBJECT;
27
28     int loops = 2;
29     int concurrentThreads = 19;
30     int numberOfObjects = 30;
31
32     public MultithreadedReadTest(String JavaDoc s)
33     {
34         super(s);
35     }
36
37     public static void main(String JavaDoc[] args)
38     {
39         String JavaDoc[] arr = {MultithreadedReadTest.class.getName()};
40         junit.textui.TestRunner.main(arr);
41     }
42
43     protected void setUp() throws Exception JavaDoc
44     {
45         super.setUp();
46     }
47
48     protected void tearDown() throws Exception JavaDoc
49     {
50         PersistenceBroker broker = PersistenceBrokerFactory.defaultPersistenceBroker();
51         try
52         {
53             changeReferenceSetting(broker, AccountImpl.class, "buyer", true, NONE, NONE, false);
54             changeReferenceSetting(broker, BuyerImpl.class, "address", true, NONE, NONE, false);
55             changeReferenceSetting(broker, BuyerImpl.class, "invoices", true, NONE, NONE, false);
56             changeReferenceSetting(broker, BuyerImpl.class, "articles", true, NONE, NONE, false);
57         }
58         finally
59         {
60             if(broker != null)
61             {
62                 broker.close();
63             }
64         }
65         super.tearDown();
66     }
67
68     public void testClosedPB() throws Throwable JavaDoc
69     {
70         String JavaDoc name = "testClosedPB_"+System.currentTimeMillis();
71         Account account = null;
72         PersistenceBroker broker = null;
73         try
74         {
75             broker = PersistenceBrokerFactory.defaultPersistenceBroker();
76             changeReferenceSetting(broker, AccountImpl.class, "buyer", true, OBJECT, OBJECT, false);
77             changeReferenceSetting(broker, BuyerImpl.class, "address", true, OBJECT, OBJECT, false);
78             changeReferenceSetting(broker, BuyerImpl.class, "invoices", true, OBJECT, OBJECT, false);
79             changeReferenceSetting(broker, BuyerImpl.class, "articles", true, OBJECT, OBJECT, false);
80             broker.beginTransaction();
81             Integer JavaDoc[] ids = prepareTestRead(broker, name, 5);
82             broker.commitTransaction();
83             broker.clearCache();
84
85             Criteria crit = new Criteria();
86             crit.addIn("id", Arrays.asList(ids));
87             QueryByCriteria query = new QueryByCriteria(Account.class, crit);
88             Collection JavaDoc result = broker.getCollectionByQuery(query);
89             Iterator JavaDoc iter = result.iterator();
90             // iter.next();
91
account = (Account) iter.next();
92             while (iter.hasNext())
93             {
94                 iter.next();
95             }
96         }
97         finally
98         {
99             if (broker != null) broker.close();
100         }
101
102         TestCaseRunnable tct [] = new TestCaseRunnable[50];
103         for (int i = 0; i < concurrentThreads; i++)
104         {
105             tct[i] = new TestHandleMaterialize(account, name);
106         }
107         // run test classes
108
runTestCaseRunnables(tct);
109     }
110
111     /**
112      * Read objects using lazy materialization for references from DB. Different threads
113      * call the references on the read objects
114      */

115     public void testObjectMaterializationByDifferentThread() throws Exception JavaDoc
116     {
117         for (int k = 0; k < loops; k++)
118         {
119             String JavaDoc searchCriteria = "testObjectMaterializationByDifferentThread_" + System.currentTimeMillis();
120             PersistenceBroker broker = null;
121             Collection JavaDoc accounts;
122             try
123             {
124                 broker = PersistenceBrokerFactory.defaultPersistenceBroker();
125                 changeReferenceSetting(broker, AccountImpl.class, "buyer", true, OBJECT, OBJECT, false);
126                 changeReferenceSetting(broker, BuyerImpl.class, "address", true, OBJECT, OBJECT, true);
127                 changeReferenceSetting(broker, BuyerImpl.class, "invoices", true, OBJECT, OBJECT, true);
128                 changeReferenceSetting(broker, BuyerImpl.class, "articles", true, OBJECT, OBJECT, false);
129                 broker.beginTransaction();
130                 prepareTestRead(broker, searchCriteria, concurrentThreads);
131                 broker.commitTransaction();
132                 broker.clearCache();
133
134                 Criteria crit = new Criteria();
135                 crit.addEqualTo("name", searchCriteria);
136                 QueryByCriteria query = new QueryByCriteria(Account.class, crit);
137                 accounts = broker.getCollectionByQuery(query);
138                 assertEquals(concurrentThreads, accounts.size());
139             }
140             finally
141             {
142                 if (broker != null) broker.close();
143             }
144             Iterator JavaDoc iter = accounts.iterator();
145             TestCaseRunnable tct [] = new TestCaseRunnable[concurrentThreads];
146             for (int i = 0; i < concurrentThreads; i++)
147             {
148                 tct[i] = new TestHandleMaterialize((Account) iter.next(), searchCriteria);
149             }
150             // run test classes
151
runTestCaseRunnables(tct);
152         }
153     }
154
155     /**
156      * Different threads try to materialize the same bunch of objects.
157      */

158     public void testMultithreadedRead() throws Exception JavaDoc
159     {
160         String JavaDoc searchCriteria = "testMultithreadedRead_" + System.currentTimeMillis();
161         PersistenceBroker broker = null;
162         try
163         {
164             broker = PersistenceBrokerFactory.defaultPersistenceBroker();
165             changeReferenceSetting(broker, AccountImpl.class, "buyer", true, OBJECT, OBJECT, false);
166             changeReferenceSetting(broker, BuyerImpl.class, "address", true, OBJECT, OBJECT, false);
167             changeReferenceSetting(broker, BuyerImpl.class, "invoices", true, OBJECT, OBJECT, false);
168             changeReferenceSetting(broker, BuyerImpl.class, "articles", true, OBJECT, OBJECT, false);
169             broker.beginTransaction();
170             prepareTestRead(broker, searchCriteria, numberOfObjects);
171             broker.commitTransaction();
172             broker.clearCache();
173         }
174         finally
175         {
176             if(broker != null) broker.close();
177         }
178
179         System.out.println();
180         System.out.println("Multithreaded read of objects - start");
181         System.out.println("" + concurrentThreads + " concurrent threads read "
182                 + numberOfObjects + " objects per thread, loop " + loops + " times");
183         for (int k = 0; k < loops; k++)
184         {
185             broker = PersistenceBrokerFactory.defaultPersistenceBroker();
186             broker.clearCache();
187             broker.close();
188
189             TestCaseRunnable tct [] = new TestCaseRunnable[concurrentThreads];
190             for (int i = 0; i < concurrentThreads; i++)
191             {
192                 tct[i] = new TestHandleRead(searchCriteria);
193             }
194             // run test classes
195
runTestCaseRunnables(tct);
196         }
197
198         System.out.println("Multithreaded read of objects - end");
199     }
200
201     /**
202      * Different threads try to materialize the same bunch of objects
203      */

204     public void testMultithreadedLazyRead() throws Exception JavaDoc
205     {
206         String JavaDoc name = "testMultithreadedLazyRead" + System.currentTimeMillis();
207         PersistenceBroker broker = null;
208         List JavaDoc identityList = null;
209         try
210         {
211             broker = PersistenceBrokerFactory.defaultPersistenceBroker();
212             changeReferenceSetting(broker, AccountImpl.class, "buyer", true, OBJECT, OBJECT, false);
213             changeReferenceSetting(broker, BuyerImpl.class, "address", true, OBJECT, OBJECT, true);
214             changeReferenceSetting(broker, BuyerImpl.class, "invoices", true, OBJECT, OBJECT, true);
215             changeReferenceSetting(broker, BuyerImpl.class, "articles", true, OBJECT, OBJECT, true);
216             broker.beginTransaction();
217             identityList = prepareTestLazyRead(broker, name, concurrentThreads);
218             broker.commitTransaction();
219             broker.clearCache();
220         }
221         finally
222         {
223             if(broker != null) broker.close();
224         }
225
226         System.out.println();
227         System.out.println("Multithreaded lazy read of objects - start");
228         System.out.println("" + concurrentThreads + " concurrent threads read different object with lazy" +
229                 " materialization reference, loop " + loops + " times");
230         for (int k = 0; k < loops; k++)
231         {
232             broker = PersistenceBrokerFactory.defaultPersistenceBroker();
233             broker.clearCache();
234             broker.close();
235
236             TestCaseRunnable tct [] = new TestCaseRunnable[concurrentThreads];
237             for (int i = 0; i < concurrentThreads; i++)
238             {
239                 tct[i] = new TestHandleLazyRead(identityList, name);
240             }
241             // run test classes
242
runTestCaseRunnables(tct);
243         }
244         System.out.println("Multithreaded lazy read of objects - end");
245     }
246
247     private Integer JavaDoc[] prepareTestRead(PersistenceBroker broker, String JavaDoc name, int numbers) throws Exception JavaDoc
248     {
249         Integer JavaDoc[] ids = new Integer JavaDoc[numbers];
250         for (int i = 0; i < numbers; i++)
251         {
252             AddressType type = new AddressTypeImpl(name);
253             Address address = new AddressImpl(name, type);
254             Buyer buyer = new BuyerImpl(name, address);
255             buyer.setArticles(buildArticles(name, numbers));
256             buyer.setInvoices(buildInvoices(name, numbers));
257             Account account = new AccountImpl(name, buyer);
258             broker.store(account);
259             ids[i] = account.getId();
260         }
261         return ids;
262     }
263
264     private List JavaDoc prepareTestLazyRead(PersistenceBroker broker, String JavaDoc searchCriteria, int numbers) throws Exception JavaDoc
265     {
266         List JavaDoc result = new ArrayList JavaDoc();
267         for (int i = 0; i < numbers; i++)
268         {
269             AddressType type = new AddressTypeImpl(searchCriteria);
270             Address address = new AddressImpl(searchCriteria, type);
271             Buyer buyer = new BuyerImpl(searchCriteria, address);
272             buyer.setArticles(buildArticles(searchCriteria, numbers));
273             buyer.setInvoices(buildInvoices(searchCriteria, numbers));
274             Account account = new AccountImpl(searchCriteria, buyer);
275             broker.store(account);
276             Identity oid = broker.serviceIdentity().buildIdentity(account);
277             result.add(oid);
278         }
279         return result;
280     }
281
282     private List JavaDoc buildInvoices(String JavaDoc name, int numbers)
283     {
284         List JavaDoc result = new ArrayList JavaDoc();
285         for(int i = 0; i < numbers; i++)
286         {
287             String JavaDoc invoiceNumber = "I_" + (long)(Math.random() * Long.MAX_VALUE);
288             Invoice invoice = new InvoiceImpl(name, invoiceNumber);
289             result.add(invoice);
290         }
291         return result;
292     }
293
294     private List JavaDoc buildArticles(String JavaDoc name, int numbers)
295     {
296         List JavaDoc result = new ArrayList JavaDoc();
297         for(int i = 0; i < numbers; i++)
298         {
299             Article a = new ArticleImpl(name, "a article description");
300             result.add(a);
301         }
302         return result;
303     }
304
305     void changeReferenceSetting(PersistenceBroker broker, Class JavaDoc clazz, String JavaDoc fieldName, boolean autoRetrieve, int autoUpdate, int autoDelete, boolean proxy)
306     {
307         ClassDescriptor cld = broker.getClassDescriptor(clazz);
308         ObjectReferenceDescriptor descriptor = cld.getCollectionDescriptorByName(fieldName);
309         if(descriptor == null)
310         {
311             descriptor = cld.getObjectReferenceDescriptorByName(fieldName);
312         }
313         if(descriptor == null)
314         {
315             throw new RuntimeException JavaDoc("Field name " + fieldName + " does not represent a reference in class '" + clazz.getName() + "'");
316         }
317         descriptor.setLazy(proxy);
318         descriptor.setCascadeRetrieve(autoRetrieve);
319         descriptor.setCascadingStore(autoUpdate);
320         descriptor.setCascadingDelete(autoDelete);
321     }
322
323
324     //***********************************************
325
// test handle of multithreaded test
326
//***********************************************
327
class TestHandleRead extends JUnitExtensions.MultiThreadedTestCase.TestCaseRunnable
328     {
329         String JavaDoc searchCriteria;
330
331         public TestHandleRead(String JavaDoc searchCriteria)
332         {
333             this.searchCriteria = searchCriteria;
334         }
335
336         public void runTestCase() throws Throwable JavaDoc
337         {
338             readByCollection();
339             readByIterator();
340         }
341
342         private void readByCollection() throws Exception JavaDoc
343         {
344             PersistenceBroker broker = null;
345             try
346             {
347                 broker = PersistenceBrokerFactory.defaultPersistenceBroker();
348                 broker.clearCache();
349                 Criteria crit = new Criteria();
350                 crit.addEqualTo("name", searchCriteria);
351                 QueryByCriteria query = new QueryByCriteria(Account.class, crit);
352                 Collection JavaDoc accounts = broker.getCollectionByQuery(query);
353                 assertEquals("Wrong number of expected objects", numberOfObjects, accounts.size());
354                 for (Iterator JavaDoc iter = accounts.iterator(); iter.hasNext();)
355                 {
356                     Account account = (Account) iter.next();
357                     assertEquals(searchCriteria, account.getName());
358                     assertNotNull("All accounts have a reference to an Buyer", account.getBuyer());
359                     assertNotNull("All buyers have a reference to an Address", account.getBuyer().getAddress());
360                     assertNotNull("All addresses have a reference to an AdressType", account.getBuyer().getAddress().getType());
361                     assertNotNull("All AddressType have a name", account.getBuyer().getAddress().getType().getName());
362                     assertNotNull("All buyers have populated 1:n reference to Invoice", account.getBuyer().getInvoices());
363                     assertNotNull("All buyers have populated 1:n reference to Article", account.getBuyer().getArticles());
364                     // System.out.println(""+Thread.currentThread().toString()+": passed");
365
}
366             }
367             finally
368             {
369                 if (broker != null) broker.close();
370             }
371         }
372
373         private void readByIterator() throws Exception JavaDoc
374         {
375             PersistenceBroker broker = null;
376             try
377             {
378                 broker = PersistenceBrokerFactory.defaultPersistenceBroker();
379                 broker.clearCache();
380                 Criteria crit = new Criteria();
381                 crit.addEqualTo("name", searchCriteria);
382                 QueryByCriteria query = new QueryByCriteria(Account.class, crit);
383                 Iterator JavaDoc iter = broker.getIteratorByQuery(query);
384                 for (; iter.hasNext();)
385                 {
386                     Account account = (Account) iter.next();
387                     assertEquals(searchCriteria, account.getName());
388                     assertNotNull("All accounts have a reference to an Buyer", account.getBuyer());
389                     assertNotNull("All buyers have a reference to an Address", account.getBuyer().getAddress());
390                     assertNotNull("All addresses have a reference to an AdressType", account.getBuyer().getAddress().getType());
391                     assertNotNull("All AddressType have a name", account.getBuyer().getAddress().getType().getName());
392                     assertNotNull("All buyers have populated 1:n reference to Invoice", account.getBuyer().getInvoices());
393                     assertNotNull("All buyers have populated 1:n reference to Article", account.getBuyer().getArticles());
394                     // System.out.println(""+Thread.currentThread().toString()+": passed");
395
}
396             }
397             finally
398             {
399                 if (broker != null) broker.close();
400             }
401         }
402     }
403
404     class TestHandleLazyRead extends JUnitExtensions.MultiThreadedTestCase.TestCaseRunnable
405     {
406         List JavaDoc identityList;
407         String JavaDoc name;
408
409         public TestHandleLazyRead(List JavaDoc identityList, String JavaDoc name)
410         {
411             this.identityList = identityList;
412             this.name = name;
413         }
414
415         public void runTestCase() throws Throwable JavaDoc
416         {
417             PersistenceBroker broker = null;
418             Account account = null;
419             try
420             {
421                 broker = PersistenceBrokerFactory.defaultPersistenceBroker();
422                 Iterator JavaDoc it = identityList.iterator();
423                 while (it.hasNext())
424                 {
425                     Identity oid = (Identity) it.next();
426                     account = (Account) broker.getObjectByIdentity(oid);
427                 }
428             }
429             finally
430             {
431                 if (broker != null) broker.close();
432             }
433             assertEquals(name, account.getName());
434             assertNotNull("All accounts have a reference to an Buyer", account.getBuyer());
435             assertNotNull("All buyers have a reference to an Address", account.getBuyer().getAddress());
436             assertNotNull("All addresses have a reference to an AdressType", account.getBuyer().getAddress().getType());
437             assertNotNull("All AddressType have a name", account.getBuyer().getAddress().getType().getName());
438             assertNotNull("All buyers have populated 1:n reference to Invoice", account.getBuyer().getInvoices());
439                     assertNotNull("All buyers have populated 1:n reference to Article", account.getBuyer().getArticles());
440         }
441     }
442
443
444     class TestHandleMaterialize extends JUnitExtensions.MultiThreadedTestCase.TestCaseRunnable
445     {
446         Account account;
447         String JavaDoc name;
448
449         public TestHandleMaterialize(Account account, String JavaDoc name)
450         {
451             this.account = account;
452             this.name = name;
453         }
454
455         public void runTestCase() throws Throwable JavaDoc
456         {
457             assertEquals(name, account.getName());
458             assertNotNull("All accounts have a reference to an Buyer", account.getBuyer());
459             assertEquals(name, account.getBuyer().getName());
460             assertNotNull("All buyers have a reference to an Address", account.getBuyer().getAddress());
461             assertEquals(name, account.getBuyer().getAddress().getName());
462             assertNotNull("All addresses have a reference to an AdressType", account.getBuyer().getAddress().getType());
463             assertNotNull("All AddressType have a name", account.getBuyer().getAddress().getType().getName());
464             assertNotNull("All buyers have populated 1:n reference to Invoice", account.getBuyer().getInvoices());
465             assertNotNull("All buyers have populated 1:n reference to Article", account.getBuyer().getArticles());
466         }
467     }
468
469
470     //***********************************************
471
// test classes/interfaces starts here
472
//***********************************************
473
public interface Account extends Base
474     {
475         Buyer getBuyer();
476
477         void setBuyer(Buyer buyer);
478     }
479
480     public static class AccountImpl extends BaseImpl implements Account
481     {
482         Buyer buyer;
483
484         public AccountImpl(String JavaDoc name, Buyer buyer)
485         {
486             super(name);
487             this.buyer = buyer;
488         }
489
490         public AccountImpl(Buyer buyer)
491         {
492             this.buyer = buyer;
493         }
494
495         public AccountImpl()
496         {
497
498         }
499
500         public Buyer getBuyer()
501         {
502             return buyer;
503         }
504
505         public void setBuyer(Buyer buyer)
506         {
507             this.buyer = buyer;
508         }
509     }
510
511     public interface Buyer extends Base
512     {
513         Address getAddress();
514         void setAddress(Address address);
515         public List JavaDoc getInvoices();
516         public void setInvoices(List JavaDoc invoices);
517         public List JavaDoc getArticles();
518         public void setArticles(List JavaDoc articles);
519     }
520
521     public static class BuyerImpl extends BaseImpl implements Buyer
522     {
523         private Address address;
524         private List JavaDoc invoices;
525         private List JavaDoc articles;
526
527         public BuyerImpl(String JavaDoc name, Address address)
528         {
529             super(name);
530             this.address = address;
531         }
532
533         public BuyerImpl(String JavaDoc name, Address address, List JavaDoc invoices, List JavaDoc articles)
534         {
535             super(name);
536             this.address = address;
537             this.invoices = invoices;
538             this.articles = articles;
539         }
540
541         public BuyerImpl(Address address)
542         {
543             this.address = address;
544         }
545
546         public BuyerImpl()
547         {
548
549         }
550
551         public List JavaDoc getInvoices()
552         {
553             return invoices;
554         }
555
556         public void setInvoices(List JavaDoc invoices)
557         {
558             this.invoices = invoices;
559         }
560
561         public List JavaDoc getArticles()
562         {
563             return articles;
564         }
565
566         public void setArticles(List JavaDoc articles)
567         {
568             this.articles = articles;
569         }
570
571         public Address getAddress()
572         {
573             return address;
574         }
575
576         public void setAddress(Address address)
577         {
578             this.address = address;
579         }
580     }
581
582     public interface Address extends Base
583     {
584         AddressType getType();
585
586         void setType(AddressType type);
587     }
588
589     public static class AddressImpl extends BaseImpl implements Address
590     {
591         AddressType type;
592
593         public AddressImpl(String JavaDoc name, AddressType type)
594         {
595             super(name);
596             this.type = type;
597         }
598
599         public AddressImpl(AddressType type)
600         {
601             this.type = type;
602         }
603
604         public AddressImpl()
605         {
606
607         }
608
609         public AddressType getType()
610         {
611             return type;
612         }
613
614         public void setType(AddressType type)
615         {
616             this.type = type;
617         }
618     }
619
620     public interface AddressType extends Base
621     {
622     }
623
624     public static class AddressTypeImpl extends BaseImpl implements AddressType
625     {
626         public AddressTypeImpl(String JavaDoc name)
627         {
628             super(name);
629         }
630
631         public AddressTypeImpl()
632         {
633         }
634     }
635
636     public interface Base
637     {
638         Integer JavaDoc getId();
639
640         void setId(Integer JavaDoc id);
641
642         String JavaDoc getName();
643
644         void setName(String JavaDoc name);
645     }
646
647     public static class BaseImpl
648     {
649         Integer JavaDoc id;
650         String JavaDoc name;
651
652         public BaseImpl(String JavaDoc name)
653         {
654             this.name = name;
655         }
656
657         public BaseImpl()
658         {
659         }
660
661         public Integer JavaDoc getId()
662         {
663             return id;
664         }
665
666         public void setId(Integer JavaDoc id)
667         {
668             this.id = id;
669         }
670
671         public String JavaDoc getName()
672         {
673             return name;
674         }
675
676         public void setName(String JavaDoc name)
677         {
678             this.name = name;
679         }
680     }
681
682     public static interface Invoice extends Base
683     {
684         public String JavaDoc getInvoiceNumber();
685         public void setInvoiceNumber(String JavaDoc invoiceNumber);
686     }
687
688     public static class InvoiceImpl extends BaseImpl implements Invoice
689     {
690         private String JavaDoc invoiceNumber;
691         private Integer JavaDoc buyerId;
692
693         public InvoiceImpl()
694         {
695         }
696
697         public InvoiceImpl(String JavaDoc name, String JavaDoc invoiceNumber)
698         {
699             super(name);
700             this.invoiceNumber = invoiceNumber;
701         }
702
703
704         public Integer JavaDoc getBuyerId()
705         {
706             return buyerId;
707         }
708
709         public void setBuyerId(Integer JavaDoc buyerId)
710         {
711             this.buyerId = buyerId;
712         }
713
714         public String JavaDoc getInvoiceNumber()
715         {
716             return invoiceNumber;
717         }
718
719         public void setInvoiceNumber(String JavaDoc invoiceNumber)
720         {
721             this.invoiceNumber = invoiceNumber;
722         }
723     }
724
725     public static interface Article extends Base
726     {
727         public String JavaDoc getDescription();
728         public void setDescription(String JavaDoc description);
729     }
730
731     public static class ArticleImpl extends BaseImpl implements Article
732     {
733         private String JavaDoc description;
734         private Integer JavaDoc buyerId;
735
736         public ArticleImpl()
737         {
738         }
739
740         public ArticleImpl(String JavaDoc name, String JavaDoc description)
741         {
742             super(name);
743             this.description = description;
744         }
745
746         public Integer JavaDoc getBuyerId()
747         {
748             return buyerId;
749         }
750
751         public void setBuyerId(Integer JavaDoc buyerId)
752         {
753             this.buyerId = buyerId;
754         }
755
756         public String JavaDoc getDescription()
757         {
758             return description;
759         }
760
761         public void setDescription(String JavaDoc description)
762         {
763             this.description = description;
764         }
765     }
766 }
767
Popular Tags