tag:blogger.com,1999:blog-5874979429188093780.post5046797931391306731..comments2024-03-18T06:46:54.352+01:00Comments on Andrej Baranovskij Blog: Displaying all columns in ADF table (TopLink entity)Andrej Baranovskijhttp://www.blogger.com/profile/04468230464412457426noreply@blogger.comBlogger19125tag:blogger.com,1999:blog-5874979429188093780.post-78263809590063682008-07-30T17:56:00.000+02:002008-07-30T17:56:00.000+02:00Hi AndrejusDo you know how to do it on javax.persi...Hi Andrejus<BR/><BR/>Do you know how to do it on javax.persistence Enities. Let say Im trying to do the same but in my data control i got the object regions within countrines by @ManyToOne definition I just drag regionName to the column, If I test with java client everithing is ok, if I do it on table it fails and just show the last record for all the rows.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-86853088218825608222008-07-18T00:40:00.000+02:002008-07-18T00:40:00.000+02:00This is a great example! Exactly what I need. Ho...This is a great example! Exactly what I need. However, I am trying to implement it in EclipseLink JPA and am having trouble finding examples how to do this. When I add a ValueHolderInterface, replacing a desired POJO attribute when I use the class I get the message "... not a valid type for a serialized mapping. The attribute must implement the Serializable inteface". I was hoping not to have to modify the ValueHolderInterface and since I'm new to this I have probably overlooking something... please help!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-5237195323134448122008-04-03T03:28:00.000+02:002008-04-03T03:28:00.000+02:00Hi Andrejus,I tried getting some help from the Ora...Hi Andrejus,<BR/><BR/>I tried getting some help from the Oracle forums with no luck. I think I may just have to find another approach.<BR/><BR/>Here's the thread from the forums; my user name is dmccabe1.<BR/>http://forums.oracle.com/forums/thread.jspa?threadID=445234<BR/><BR/>Thanks, DanielUnknownhttps://www.blogger.com/profile/06686813459469366043noreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-52746263402889823552008-03-27T08:21:00.000+01:002008-03-27T08:21:00.000+01:00Daniel,You have this issue with my sample? What ex...Daniel,<BR/><BR/>You have this issue with my sample? What exactly problem you have?<BR/><BR/>Thanks,<BR/>AndrejusAndrej Baranovskijhttps://www.blogger.com/profile/04468230464412457426noreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-66307913480273387552008-03-27T03:37:00.000+01:002008-03-27T03:37:00.000+01:00vimalan,Could you please explain your fix for the ...vimalan,<BR/><BR/>Could you please explain your fix for the null issue a little more. I am extremely new to toplink and am not sure how to fix the mapping issue.Unknownhttps://www.blogger.com/profile/06686813459469366043noreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-6413926386225437332008-02-24T10:03:00.000+01:002008-02-24T10:03:00.000+01:00Hi Andre,I found out the problem and fixed the err...Hi Andre,<BR/><BR/>I found out the problem and fixed the error. Now its inserting into the payment table.<BR/><BR/>Problem is in mapping. In primary table, we will have collection list for the Payment table. There we need to map the table reference. i.e Source Field and Target Field.<BR/><BR/>Thanks & Regards<BR/>Vimalan BalanVBhttps://www.blogger.com/profile/04705926805281399538noreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-63045378074970105942008-02-24T08:16:00.000+01:002008-02-24T08:16:00.000+01:00Hi Andre,I developed the application. EgovAgencyDe...Hi Andre,<BR/><BR/>I developed the application. EgovAgencyDetails.java and EgvoPaymentorderMaster .java file. I designed the page and create custom method for to insert record in Payment table.<BR/><BR/>public EgvoPaymentorderMaster createServiceRequest( Passing parameters from the screen) <BR/>{<BR/> UnitOfWork uow = getSessionFactory().acquireUnitOfWork();<BR/> final EgovAgencyDetails product = <BR/> (EgovAgencyDetails)uow.executeQuery("findAgencyRegistrationNo", EgovAgencyDetails.class, agencyRegistrationNo);<BR/><BR/> EgvoPaymentorderMaster newInstance = <BR/> (EgvoPaymentorderMaster)uow.newInstance(EgvoPaymentorderMaster.class);<BR/> newInstance.setPoid(poId);<BR/> .....<BR/> .....<BR/><BR/> product.addEgvoPaymentorderMaster(newInstance);<BR/>}<BR/><BR/>Now i am getting error that can't insert Null column in EgovAgencyDetails table. <BR/><BR/>I don't know where is the problem.<BR/>Please can you tell the fix or anything i need to do the mapping in JDeveloper 10.1.3.3<BR/><BR/>Thanks & Regards<BR/>Vimalan BalanVBhttps://www.blogger.com/profile/04705926805281399538noreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-12144277665478076372008-02-21T20:31:00.000+01:002008-02-21T20:31:00.000+01:00Hi Vimalan,I dont have sample for this case.You ne...Hi Vimalan,<BR/><BR/>I dont have sample for this case.<BR/><BR/>You need to do develop it :-)<BR/><BR/>Regards,<BR/>AndrejusAndrej Baranovskijhttps://www.blogger.com/profile/04468230464412457426noreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-64739638444464125502008-02-21T20:02:00.000+01:002008-02-21T20:02:00.000+01:00Hi Andre,Thanks and if you can send or post a samp...Hi Andre,<BR/><BR/>Thanks and if you can send or post a sample for to input new record.<BR/><BR/>Thanks & Regards<BR/>Vimalan BalanVBhttps://www.blogger.com/profile/04705926805281399538noreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-26652581003535158022008-02-21T12:47:00.000+01:002008-02-21T12:47:00.000+01:00Hi Vimalan,You can try to persist First entity and...Hi Vimalan,<BR/><BR/>You can try to persist First entity and after it will be stored, you can persiste Second entity.<BR/><BR/>However, there can be many reasons why it dont work in your case, I'm not sure exactly why.<BR/><BR/>You can check <A HREF="http://forums.oracle.com/forums/forum.jspa?forumID=48" REL="nofollow">TopLink</A> forum on OTN as well.<BR/><BR/>Regards,<BR/>AndrejusAndrej Baranovskijhttps://www.blogger.com/profile/04468230464412457426noreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-20819219947404819462008-02-21T10:46:00.000+01:002008-02-21T10:46:00.000+01:00Hi Andre,This is vimalan again for different probl...Hi Andre,<BR/><BR/>This is vimalan again for different problem.<BR/><BR/>Example UserTable and PaymentTable<BR/><BR/>UserTable - UserID - Primary Key<BR/><BR/>PaymentTable - containg couple of fields and UserId is foreign Key.<BR/><BR/>I designed the page for to insert the new input record using the steps given in the doc "http://download-uk.oracle.com/docs/cd/B32110_01/web.1013/b28967/web_adv007.htm".<BR/><BR/>When i click the persistEntity method its throws TopLink error cannot insert null value into UserId column in PaymentTable.<BR/><BR/>Please tell how to populate the values from the screen to PaymentTable.<BR/><BR/>Thanks & Regards<BR/>Vimalan BalanVBhttps://www.blogger.com/profile/04705926805281399538noreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-83210643216482660602007-10-26T15:14:00.000+02:002007-10-26T15:14:00.000+02:00Hello,Thanks for good feedback! :)Yes, I'm using T...Hello,<BR/><BR/>Thanks for good feedback! :)<BR/><BR/>Yes, I'm using TopLink here - but it's not TopLink Essentials (TopLink Essentials is lighter version). Sample is developed using JDeveloper wizards for TopLink and ADF development.<BR/><BR/>You can find Oracle documentation that is related completely to TopLink track in this step-by-step tutorial: <A HREF="http://www.oracle.com/technology/obe/ADF_tutorial_1013/index.htm" REL="nofollow">Oracle Application Development Framework: Tutorial 10g Release 3 (10.1.3) </A>. Also there exists developer guide for TopLink track: <A HREF="http://www.oracle.com/webapps/online-help/jdeveloper/10.1.3/state/content/navId.4/navSetId._/vtAnchor.BEIHCFFB/vtTopicFile.adfdevguide%7Cadv_toplink_topics%7Ehtm/" REL="nofollow">Advanced TopLink Topics</A>.<BR/><BR/>Inform me, about your success.<BR/><BR/>Regards,<BR/>AndrejusAndrej Baranovskijhttps://www.blogger.com/profile/04468230464412457426noreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-75059069515185547492007-10-26T01:37:00.000+02:002007-10-26T01:37:00.000+02:00Hi Andrejus,First of all my compliments for your g...Hi Andrejus,<BR/><BR/>First of all my compliments for your great Blog! I knew your name, but now I know your contribution to the Java community as well.<BR/><BR/>I’m studying the EJB and I did run into the problem that by default columns involved into primary-foreign key relationships cannot be displayed. To be honest, I have no clue how you did create this example application? I use Toplink Essential and EJB Libraries for my project. I guess you did use Toplink? Please clarify which Wizards/technologies can be used to create your code. I don’t think that you typed all that XML…<BR/><BR/>I can be completely wrong and confused in my ‘misunderstanding’, but I would like to know if my solution to display the Manager’s Last Name on Department records yields a equally result as the example demonstrated here. The relation in my Entity Bean is like:<BR/><BR/>@ManyToOne<BR/>@JoinColumn(name = "MANAGER_ID", referencedColumnName = "EMPLOYEE_ID")<BR/>private Employee employee;<BR/><BR/>I did add a Transient attribute “managerLastName” and method to obtain the Last Name via the relation:<BR/><BR/>@Transient<BR/>private String managerLastName;<BR/><BR/> public String getManagerLastName() {<BR/> String name = "";<BR/> if(!(getEmployee() == null)){<BR/> name = getEmployee().getLastName();<BR/> }<BR/> return name;<BR/> }<BR/><BR/>The check on existing Employee objects (getEmployee() == null) was required to prevent annoying NullPointerExceptions when no manager was assigned to a Department. The transient attribute was correctly displayed in my ADF Faces table.<BR/><BR/>I would appreciate it very much if you can tell me where I can find background information, or even better: a working example, about Query Find Forms in relation to ADF Faces Tables. All documentation supplied by Oracle is based on ADF BC as Business Service.<BR/><BR/>Regards,<BR/><BR/>M. KreuwelsAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-50407896104090999572007-07-19T15:38:00.000+02:002007-07-19T15:38:00.000+02:00helal olsun andrejus kardeşim benim bi tanesin...I...helal olsun andrejus kardeşim benim bi tanesin...<BR/><BR/>I mean...<BR/><BR/>Thank you Andre...I can't believe ADF does not automatically (via valueholder objects) support such a common issue that we programmers often encounter in our designs.<BR/>Thanks again for this simple and very useful solution.<BR/><BR/>M.Ali - TurkeyAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-56045049413909064642007-03-23T20:28:00.000+01:002007-03-23T20:28:00.000+01:00I hope, solution will be available in 11g Release ...I hope, solution will be available in 11g Release :)Andrej Baranovskijhttps://www.blogger.com/profile/04468230464412457426noreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-14753843875659362722007-03-23T11:50:00.000+01:002007-03-23T11:50:00.000+01:00Hm, that's not a solution, that's a workaround. OK...Hm, that's not a solution, that's a workaround. OK, having these classes it works fin. But what if you have more members? or more contained classes? or contained classes in the contained classes (eg the region class may have an object of type "continent"); you should expose continent info to region and then expose again to country.<BR/>The JDev/ADF team should do something more clever here :)Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-8117318796520489922007-03-01T06:16:00.000+01:002007-03-01T06:16:00.000+01:00Hi Andrejus,I found I had to:1. add the setter to ...Hi Andrejus,<BR/><BR/>I found I had to:<BR/><BR/>1. add the setter to the countries.java file<BR/>2. create the data control (this overwrites the existing entity.xml file)<BR/>3. manually edit countries.xml to add<BR/> Attribute Name="regionName" IsUpdateable="0" Type="java.lang.String"<BR/>4. do a refresh of the generated data control, in my case hrMap1TLmapDataControl<BR/> <BR/>Thanks again it all works.<BR/>Joe.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-86189107991549868002007-02-28T14:24:00.000+01:002007-02-28T14:24:00.000+01:00Hi,I have checked sample available in AllColumns.z...Hi,<BR/><BR/>I have checked sample available in AllColumns.zip using JDeveloper 10.1.3.2 - it works ok.<BR/><BR/>If you have added getRegionName() method into Contries.java entity bean, try to check Countries.xml file. This file is generated for Contries.java after making 'Create Data Control'. There you should find attribute declaration for 'regionName' - Attribute Name="regionName" IsUpdateable="0" Type="java.lang.String"<BR/><BR/>Have you tried to open my sample?<BR/><BR/>Regards,<BR/>AndrejusAndrej Baranovskijhttps://www.blogger.com/profile/04468230464412457426noreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-58338284299328644182007-02-28T09:45:00.000+01:002007-02-28T09:45:00.000+01:00Hi,I am trying to get regionName appear in the fin...Hi,<BR/><BR/>I am trying to get regionName appear in the findAllCountries() as shown in this article.<BR/><BR/>However I always get:<BR/><BR/>- findAllCountries<BR/> - Countries<BR/> countryId<BR/> countryName<BR/> + regions<BR/> + getRegionName()<BR/> + operations<BR/><BR/>I have added <BR/> public String getRegionName() {<BR/> return this.getRegions().getRegionName();<BR/> }<BR/>to the countries.java (bean) prior to 'Create Data Control'<BR/><BR/><BR/>Is there something I have missed?<BR/>Using Jdeveloper V10.1.3.2.0<BR/><BR/>with thanks, Joe.Anonymousnoreply@blogger.com