POJO ideaology question

I'm trying to setup a new web application and I'm using Spring for the first time so I'm following a tutorial at [springframework.org|http://static.springframework.org/docs/Spring-MVC-step-by-step/part4.html]. While I'm trying to keep my application fairly close in functionality until I'm done with the tutorial it's not quite the same thing. Something that I've noticed is that this project has (at least up until this point) no logic in the Product class; it's all in the SimpleProductManager class (if you didn't read the tutorial: it's merely a collection of Product objects and methods to modify Product attributes), but the methods functionality applies to all Product objects at once whereas I want my methods to modify just a single Product object. To do this with the functionality in the SimpleProductManager class I would have to do something like: ProductManager productManager = new SimpleProductManager();
productManager.makeFree(product);Where in makeFree() I find which Product matches the passed in product and then call setPrice(0) on the Product. This seems like a lot of work where I should be able to do product.makeFree(); and be done with it.
My question is "does this kind of thing make POJOs less plain?" While I can navigate my way around source code fairly well I've never had any training on design or architecture and the program I work on at my day job is notorious for being an example of what NOT to do. How much logic can go into a class like Product that kind of represents a row on a database?
Thanks in advance.

You might want to research 'java MVC'' to see how separating the presentation, control, business logic, and database logic into either own layers is recommended. It should apply to Spring framework. I suggest refactoring your project over and over to make it a cleaner design in terms of MVC. As I understand it, POJO refers to not putting anything in your java classes that ties it to a particular framework or technology. Example: Business logic that uses EJB cant be re-used in a project that doesnt use EJB.
In terms of simpleProjectManager, you can create additional functions to only work with one product.

Similar Messages

  • EJB Vs JSP/POJO/Servlets, etc

    I'm familiar with several J2EE technologies and decided to start learning some design patterns. EJB comes up a lot in the business tier, so I've been looking at more info about them.
    What I can't find a clear answer on at the moment is why exactly you would choose to use them over existing features. The ads/disads seem to be about half and half, and the ads are mainly from a development perspective (although they make apps more complicated).
    So, does EJB do anything to improve scalability and performance in a considerable way as compared to JSP, POJO, etc, or is it mainly for increased decoupling of tiers and subsequent better maintenance and reusibility?

    Technically, the answer is that EJB does not add anything that cannot be done with regular business objects...
    The difference is how easy it is to do the things you need.
    With EJB before EJB3 there is a lot more effort that goes into using the technology, this is why people often will use regular business objects... they may only need one or two of the things EJBs bring to the table, so the pain of EJBs is not worth the gain.
    EJB3 is a lot easier to implement (than previous EJB specifications) so we should start to see people using this technology more.
    When you are asking about EJB vs POJO the question you need to ask yourself first is: have we decided how the application will be deployed?
    If that decision has been made, then you will be able to know what flavour of EJB is available (if at all) on your application server.
    e.g. if it will be deployed on Tomcat => no EJBs at all
    if it will be deployed on Websphere => (at the moment) EJBs but not EJB3 are available
    if it will be deployed on Glassfish or JBoss5 (or possibly some versions of JBoss4) => EJB3 is available.
    Where I see EJBs fitting into the MVC application is in the Model layer, i.e. they provide a means of abstracting your model so that it can be expressed in terms of business methods, etc. This can simplify the controller. But again, it is nothing that cannot be done with regular POJOs.

  • Remote pojo question.

    I have delegates which are calling remote session beans that return ValueObjects. The remote client then may modify these value objects and return them later to the application via the an appropriate session bean. I would then like to save any changes that have been made.
    I expect the Value objects to be POJOs, and not have ties to Toplink. However, when return these VOs, i get a class not found exception:
    Caused by: java.lang.ClassNotFoundException: oracle.toplink.indirection.IndirectList (no security manager: RMI class loader disabled)
    I don't understand why the client has to know that I am using toplink to handle persistence for these POJOs.
    Am I using an incorrect session or something?
    Here is my code to get the session:
    Project proj = new TLCeleres();
    sServer = proj.createServerSession();
    sServer.login("pago_temp", "pago_temp");
    Session session = sServer.acquireClientSession();
    Here is my code to populate the vector of VOs which are returned by the session bean:
    ReadAllQuery query= new ReadAllQuery();
                   query.setReferenceClass(QueryBarFacilityValue.class);
                   query.setSelectionCriteria(new ExpressionBuilder().get("id").equal(queryBarId));
                   query.addJoinedAttribute("Facility");
                   Vector results= (Vector)getSession().executeQuery(query);
                   facilities= new Vector(results.size());
                   Iterator iter= results.iterator();
                   while (iter.hasNext())
                        facilities.add(((QueryBarFacilityValue)iter.next()).getFacility());
    Thanks in advance,
    craig

    Craig,
    The client does not need to know anything about TopLink. The issue is that you have transparent indirection enabled on your collection relationship mapping(s).
    Indirection is an excellent performance enhancement on the server side but it is stateful and does not serialize to the client easily.
    Check you mappings and ensure that indirection is disabled for the relationship(s) in question.
    Doug

  • Accessing application module in a POJO for SOA architecural question

    Hi,
    I have an architectural question. We have an app in jdev 11.1.1.1.0 that has app modules and jsf pages. It works great. I am of the thought that biz logic should not be contained in managed beans but in a POJO which is more tied to the model part. For example, if i have a method to calculate salaray, i would rather put that in a POJO that accesses appmodule to get the vo and related query instead of doing all this in a backing bean method.
    I understand from Steve's tips that accessing app module directly is not a good idea (see "When should I use Configuration.createRootApplicationModule(), and when not?" at http://radio-weblogs.com/0118231/2003/08/01.html) .
    ApplicationModule am = Configuration.createRootApplicationModule(
    "com.oracle.apps.hr.personnel.HiringModule",
    "HiringModuleLocal");
    But then how do you go about making your app more modularized and decoupled that can expose a particular SOA service such as POJO.calcSalary() if you are not supposed to access app module in a pojo. Any other way to do it?
    Another customer is asking pretty much along the same lines at Re: ADF BC 11 - best practice question

    Have you looked at AM level service methods?
    See 9.7 Customizing an Application Module with Service Methods
    http://download.oracle.com/docs/cd/E14571_01/web.1111/b31974/bcservices.htm#sm0206
    These service methods can be accessed from your JSF page with simple binding (see http://www.screentoaster.com/watch/stWUtcRkVLQ1FcRVxZXVhZ/service_method_on_am )
    And they can also be exposed through a web service interface to the AM, see: http://download.oracle.com/otn_hosted_doc/jdeveloper/11gdemos/CreatingSDO-Demo/CreatingSDO.html

  • Quick questions on the topic of Web Services and EJB POJOs

    I have been reading about Web Services and the data types that are aloud as operation parameters and return types. I was wondering what the standard practice for return types; is it to use the Entity classes straight and customize the WSDL instead of letting the EE container do it (avoid cyclic problems in the schema that can occur when using entity 1-to-many and many-to-1 mappings) or; is it to off load the data into a DTO/VO/Bean and let the EE container take care of all the schema mapping for the WSDL? I look at the EE tutorial and bought a EE book both use very basic examples that do not include connecting to a database or using EJB3 for the data store.
    Thanks for any information

    bump

  • Crystal Report For Eclipse: POJO problem

    Hi all,
    I am using crystal report for eclipse basic version and used POJO-method to implement for users to viewing my report.
    I did the following:
    I created a sql page (create a target table) and import into crystal report (through  crystal report designer under eclipse environment) E.g. let's say I created a table with 10 fields and imported into the crystal report.
    Then I drag and drop through crystal report for my report design.
    Later if I need to add one more field .....
    I need to modified my SQL page and re-import the sql page into my crystal report. HOWEVER, through this re-import process, I lost all the detail/information on the existing report (that mean I need to re-design my report through the designer under eclipse environmet).
    My question is: Is there any better way for me to implement my report ???
    THANKS .. THANKS a lot as this problem make me use a lot of my time ... THANKS

    In the sceario you have described (using a SQLPage as the datasource for the report), unfortunately, this is a limitation of the workflow. If you need to change the SQL, then you essentially need to remove and re-add it to the report which means replacing all the fields on the report.
    Instead, I would recommend using a class as the report's datasource.  The class would represent the fields that would be used in your POJO object.  This way if you need to modify the fields in the POJO, you can simply update the class and use the Verify Database to update the report.
    -MJ

  • EE 5 newb question

    My question revolves around remote interfaces and using the persistence API. An example might give more insight into my question�
    I have 3 tables Customer, Order, LineItem with the corresponding object associations:
    class Customer {
    long id;
    List<Order> orders;
    public long getId() {};
    public List<Order> getOrders(){};
    class Order {
    long id;
    List<LineItem> lineItems;
    public long getId() {};
    public List<LineItem> getLineItems() {};
    public Customer getCustomer() {};
    Class LineItem {
    long id;
    public long getId() {};
    public Order getOrder() {};
    When using a session bean that implements a remote interface I make a call similar to the following�
    @Stateless
    class OrderBean implements RemoteOrder {
    public List<Order> getOrders(long custId) {
    return em.createNamedQuery(�order.findByCustomerId�).setParmater(�custId�, custId);
    Now this would work great in a Servlet/JSP that was running in the same JVM, but I am accessing this from a web service. I am wondering what is the �standard� way to return the persistent data to the web service client?
    Is it off load every thing into a value object? Something has to be done otherwise I will always get exceptions when trying to access the lazy children of Customer. Even if I do a FETCH JOIN for Customer.lineItems then the problem nest down
    to Order.lineItems, should I FETCH JOIN this to? What about the cyclic call during marhsalling from Customer.getOrders() -> Orders.getCustomers()? I have yet to find documentation �anywhere� ;) that defines a standard way
    to handle this or should we still develop the J2EE way and use Transfer Objects, but I thought the persistence layer and POJOs was supposed to remove this extra layer from the enterprise application.
    Thanks for any help
    J

    The tape device /dev/rmt/0 can be accessed through a number of "names". The exact name used indicates a exactly how the hardware should access the device.
    /dev/rmt/0n is the no rewind version. If you don't add the n then the tape will be automatically rewound on close.
    You have to use that version if you want to dump multiple things onto the tape one after the other.

  • How to create a af:selectManyCheckBox from Pojo Class DataControls?

    Hi All,
    I haven't worked on POJO based datacontrols till now. Can anyone give me a pointer where it is explained to create a <af:selectManyCheckBox> component using these datacontrols?

    Hi User404/Suipto,
    Thanks for that pointer. I created the select many check-box and did various things on it using Binding contexts in managed beans. But i have a question: -
    For now i am creating my List Values based on a POJO that has only 2 data members. It means from the class of which i have created data controls i am returning my L.O.V as a List Of object of a different class that has only 2 data members, but i am getting absurd behavior when i add some more data members. In that case my pageDef file contains Items in AttrNames tag only to be the that i have chosen to be displayed. So when i add odr fields also in AttRNames than my select many check Box displays combination of all the Items in AttrNames.
    But i dont want this. So i added odr fields in ListDisplayAttrNames. But this is not working as ListDisplayAttrNames api is not in use. So i cannot figure out when i have my LOV objects' data members number more than 2 then in what way should the binding be performed?
    Any HELP*
    Edited by: Avi on Nov 27, 2012 9:40 AM

  • Question about main difference between Java bean and Java class in JSP

    Hi All,
    I am new to Java Bean and wonder what is the main difference to use a Bean or an Object in the jsp. I have search on the forum and find some post also asking the question but still answer my doubt. Indeed, what is the real advantage of using bean in jsp.
    Let me give an example to illustrate my question:
    <code>
    <%@ page errorPage="errorpage.jsp" %>
    <%@ page import="ShoppingCart" %>
    <!-- Instantiate the Counter bean with an id of "counter" -->
    <jsp:useBean id="cart" scope="session" class="ShoppingCart" />
    <html>
    <head><title>Shopping Cart</title></head>
    <body bgcolor="#FFFFFF">
    Your cart's ID is: <%=cart.getId()%>.
    </body>
    <html>
    </code>
    In the above code, I can also create a object of ShoppingCart by new operator then get the id at the following way.
    <code>
    <%
    ShoppingCart cart = new ShoppingCart();
    out.println(cart.getId());
    %>
    </code>
    Now my question is what is the difference between the two method? As in my mind, a normal class can also have it setter and getter methods for its properties. But someone may say that, there is a scope="session", which can be declared in an normal object. It may be a point but it can be easily solved but putting the object in session by "session.setAttribute("cart", cart)".
    I have been searching on this issue on the internet for a long time and most of them just say someting like "persistance of state", "bean follow some conventions of naming", "bean must implement ser" and so on. All of above can be solved by other means, for example, a normal class can also follow the convention. I am really get confused with it, and really want to know what is the main point(s) of using the java bean.
    Any help will be highly apprecaited. Thanks!!!
    Best Regards,
    Alex

    Hi All,
    I am new to Java Bean and wonder what is the main
    difference to use a Bean or an Object in the jsp. The first thing to realize is that JavaBeans are just Plain Old Java Objects (POJOs) that follow a specific set of semantics (get/set methods, etc...). So what is the difference between a Bean and an Object? Nothing.
    <jsp:useBean id="cart" scope="session" class="ShoppingCart" />
    In the above code, I can also create a object of
    ShoppingCart by new operator then get the id at the
    following way.
    ShoppingCart cart = new ShoppingCart();
    out.println(cart.getId());
    ...Sure you could. And if the Cart was in a package (it has to be) you also need to put an import statement in. Oh, and to make sure the object is accessable in the same scope, you have to put it into the PageContext scope. And to totally equal, you first check to see if that object already exists in scope. So to get the equivalant of this:
    <jsp:useBean id="cart" class="my.pack.ShoppingCart"/>Then your scriptlet looks like this:
    <%@ page import="my.pack.ShoppingCart %>
    <%
      ShoppingCart cart = pageContext.getAttribute("cart");
      if (cart == null) {
        cart = new ShoppingCart();
        pageContext.setAttribute("cart", cart);
    %>So it is a lot more work.
    As in my mind, a normal class can also
    have it setter and getter methods for its properties.True ... See below.
    But someone may say that, there is a scope="session",
    which can be declared in an normal object.As long as the object is serializeable, yes.
    It may be
    a point but it can be easily solved but putting the
    object in session by "session.setAttribute("cart",
    cart)".Possible, but if the object isn't serializable it can be unsafe. As the point I mentioned above, the useBean tag allows you to check if the bean exists already, and use that, or make a new one if it does not yet exist in one line. A lot easier than the code you need to use otherwise.
    I have been searching on this issue on the internet
    for a long time and most of them just say someting
    like "persistance of state", "bean follow some
    conventions of naming", "bean must implement ser" and
    so on. Right, that would go along the lines of the definition of what a JavaBean is.
    All of above can be solved by other means, for
    example, a normal class can also follow the
    convention. And if it does - then it is a JavaBean! A JavaBean is any Object whose class definition would include all of the following:
    1) A public, no-argument constructor
    2) Implements Serializeable
    3) Properties are revealed through public mutator methods (void return type, start with 'set' have a single Object parameter list) and public accessor methods (Object return type, void parameter list, begin with 'get').
    4) Contain any necessary event handling methods. Depending on the purpose of the bean, you may include event handlers for when the properties change.
    I am really get confused with it, and
    really want to know what is the main point(s) of
    using the java bean.JavaBeans are normal objects that follow these conventions. Because they do, then you can access them through simplified means. For example, One way of having an object in session that contains data I want to print our might be:
    <%@ page import="my.pack.ShoppingCart %>
    <%
      ShoppingCart cart = session.getAttribute("cart");
      if (cart == null) {
        cart = new ShoppingCart();
        session.setAttribute("cart", cart);
    %>Then later where I want to print a total:
    <% out.print(cart.getTotal() %>Or, if the cart is a JavaBean I could do this:
    <jsp:useBean id="cart" class="my.pack.ShoppingCart" scope="session"/>
    Then later on:
    <jsp:getProperty name="cart" property="total"/>
    Or perhaps I want to set some properties on the object that I get off of the URL's parameter group. I could do this:
    <%
      ShoppingCart cart = session.getAttribute("cart");
      if (cart == null) {
        cart = new ShoppingCart();
        cart.setCreditCard(request.getParameter("creditCard"));
        cart.setFirstName(request.getParameter("firstName"));
        cart.setLastName(request.getParameter("lastName"));
        cart.setBillingAddress1(request.getParameter("billingAddress1"));
        cart.setBillingAddress2(request.getParameter("billingAddress2"));
        cart.setZipCode(request.getParameter("zipCode"));
        cart.setRegion(request.getParameter("region"));
        cart.setCountry(request.getParameter("country"));
        pageContext.setAttribute("cart", cart);
        session.setAttribute("cart", cart);
      }Or you could use:
    <jsp:useBean id="cart" class="my.pack.ShoppingCart" scope="session">
      <jsp:setProperty name="cart" property="*"/>
    </jsp:useBean>The second seems easier to me.
    It also allows you to use your objects in more varied cases - for example, JSTL (the standard tag libraries) and EL (expression language) only work with JavaBeans (objects that follow the JavaBeans conventions) because they expect objects to have the no-arg constuctor, and properties accessed/changed via getXXX and setXXX methods.
    >
    Any help will be highly apprecaited. Thanks!!!
    Best Regards,
    Alex

  • Interview Questions :: Correct questions to ask ?

    Hi,
    I just got off another Interview that I took & was disappointed once again.
    We are looking for mid-level Programmers who can write good code ( which would initiate good debates ) as well as "think" on thier own ( not just patch freely avaliable code from Google & dish out average solutions ).
    I was initailly impressed with a Candidate's Profile, but when I interviewed the Candidate on the "nuts & bolts" of the stuff in the Profile, I came to understand that the person could code, but not analyze :( ( a subjective viewpoint ).
    Here are a few questions that I posed :-
    1. Can you run two JVMs off the same JDK ?
    2. If yes ( to Question #1 ), how would you call a class in JVM1 in JVM2.
    3. Why does the JDBC Specification have so many Interfaces & just a couple of Concrete classes ?
    4. Can you develop an RDBMS using only Java / J2EE ?
    5. Can you access www.Google.com in a simple POJO running in a standalone JVM ?
    Well, the answers to all these Questions are usually a blunt "No" or "I don't know".
    I find it amazing that many programmers, who spend 2-3 yrs coding in Java do not reflect on some of the bare fundamentals.
    I request the opinion of the people who participate in this Forum - am I aksing the wrong questions or am I talking to the wrong people in the Interviews?
    I apologize if this is not the best place to ask the question, but I am trying to reach out to a large number of Java Enthusiasts like myself.
    Thanks,
    Sandeep

    Hi,
    Thanks for your replies - yes, I do agree from your views that I need to rephrase ( Prehaps, "rehash" ;) ) Questions #1 & #2.
    >> I took this to mean "Can you start two different JVM's using the same JRE (or the JRE contained in the same JDK)?"
    Yes, that would be the best way to re-phrase my question
    >> Mind you; I don't like question 2. You don't call classes.
    I think I would rephrase it in this manner :- " If yes to Question #1, How do you invoke a class in JVM2 from JVM 1".
    A couple of my colleagues read my Post & opined that it all depended on "Exposure" vs. "Experience" - i.e:-
    Exposure :- How many different "things" have you done in the past xx years ?
    Experience :- How many times have you done the same "thing" in the past xx years ?
    I defenitely don't subscribe to this view ( or the definitions) - I strongly believe that after some exposure to J2EE, your inner curiosity is awakened & you start asking questions to yourself - the "why" questions rather than the "how" questions. I do have my own arguments with the Architects, QAs, etc. & these talks do light many bulbs.
    We are still arguing here while reading the intersting viewpoints......
    Regards,
    Sandeep

  • Migrate from Crystal Report Server XI R2 to new Eclipse RAS SDK Question

    Hi,
    I am migrating Crystal Report Server XI R2 RAS SDK to Eclipse RAS SDK which seems to be quite easy.
    I have the following old code which basicly programmaticly creates a Report from scratch adds a Table and then
    populates the Report with a Pojo Collection.
    <br> <br>
    Now before I would have : <br>
    <br>
    Table oTable = new Table(); <br>
    oTable.setName("reportTable"); <br>
    pbConnAttributes.putStringValue("QE_DatabaseType", "Java Beans Connectivity"); <br>
    pbConnAttributes.putStringValue(PropertyBagHelper.CONNINFO_DATABASE_DLL, "crdb_javabeans.dll"); <br>
    PropertyBag pbLogonProperties = new PropertyBag(); <br>
    pbLogonProperties.putStringValue("Java Bean Classes", className); <br>
    pbLogonProperties.putStringValue("SSOKEY", ""); <br>
    pbConnAttributes.put("QE_LogonProperties", pbLogonProperties); <br>
      pbConnAttributes.putBooleanValue(PropertyBagHelper.CONNINFO_SSO_ENABLED, false); <br>
    oTable.getConnectionInfo().setKind(ConnectionInfoKind.CRQE); <br>
    oTable.getConnectionInfo().setUserName(""); <br>
      oTable.getConnectionInfo().setPassword(null); <br>
      oTable.getConnectionInfo().setAttributes(pbConnAttributes); <br>
    //following statement throws Exception <br>
    doc.getDatabaseController().addTable(oTable, null); <br>
    <br>
    getDatabaseController().setDataSource(pojoCollection, pojoClass.class,"reportTable", "reportTable");
    <br>
    <br>
    Now wenn using the c <br>lient eclipse RAS SDK which pbConnAttributes should I use? <br>
    No matter which ones I choose I get a Bad Driver Exception or Named Exception. <br>
    Can anybody help?
    Edited by: snake-john99 on Aug 11, 2010 10:35 AM
    Edited by: snake-john99 on Aug 11, 2010 10:39 AM

    Hi Mikael,
    Since you're already on CR Server XI R2, you can use the Upgrade Management Tool to migrate all the content to CR Server 2013.
    Anwers to your questions:
    1) Yes, the Upgrade Management Tool does support this kind of migration
    2) It does seem that the UMT allows you to move all report instances as well as the scheduled jobs over to the new server
    3) I've always had issues with Business Views when using Import Wizard however I'm not sure whether they work well with the new UMT. In any case, I always prefer to export the LOVs and BVs from within the Business View Manager to a .xml file and then import them in the higher version of the Server, again, from within the Business View Manager.
    -Abhilash

  • Three tier architecture questions

    Hello,
    My question is in regards to using Toplink in a three tier architecture situation. If I wish to send an object A which has a collection of Bs and B has a collection of C ( A nested object structure with two or more levels of indirection). Is the best solution to have the named query be part of a unit of work so that even if on the client side somebody unknowingly were to make the modification to one of the entity objects ( a POJO) the shared session cache would not be affected ?
    This is assuming the client side HTTP layer and the RMI/EJB layer are on different JVMs.
    Some of the other suggestions I have heard is to retrieve it from the shared session cache directly and if in case I need to modify one or more of the objects do a named query lookup on that object alone and then proceed to register that object in a unit of work and then commit the changes.
    Also the indirection would have to be utilised before the data objects are sent to the Servlet layer I presume ?(That is if I do a a.getAllOfBObjects() on the servlet side I would get a nullpointer exception unless all of B were already instatiated on the server side). Also when the objects are sent back to the server do I do a registerObject on all the ones that have changed and then do a deepMergeClone() before the uow.commit() ?
    Thanks,
    Aswin.

    Aswin,
    If your client is remote to the EJB tier then all persistent entities are detached through serialization. In this architecture you do not need to worry about reading and modifying the shared instance as it never the one being changed on the client (due to serialization).
    Yes, you do need to ensure that all required indirect relationships are instantiated on the server prior to returning them from the EJB call.
    Yes, you do need to merge the changes of the detached instance when returned to the server. I would also recommend first doing a read for the entity being merged (by primary key) on the new UnitOfWork prior to the merge. This will handle the case where you are merging into a different node of the cluster then where you read as well as allowing you to check for the case where the entity no longer exists in the database (if the read returns null then the merge will result in an INSERT and this may not be desired).
    Here is an example test case that does this:
        public void test() throws Exception {
            Employee detachedEmp = getDeatchedEmployee("Jill", "May");
            assertNotNull(detachedEmp);
            // Remove the first phone number
            PhoneNumber phone = detachedEmp.getPhoneNumber("Work");
            assertNotNull("Employee does not have a Work Phone Number",
                          detachedEmp.getPhoneNumber("Work"));
            detachedEmp.removePhoneNumber(phone);
            UnitOfWork uow = session.acquireUnitOfWork();
            Employee empWC = (Employee) uow.readObject(detachedEmp);
            if (empWC == null) { // Deleted
                throw new RuntimeException("Could not update deleted employee: " + detachedEmp);
            uow.deepMergeClone(detachedEmp);
            uow.commit();
         * Return a detached Employee found by provided first name and last name.
         * Its phone number relationship is instantiated.
        public Employee getDeatchedEmployee(String firstName, String lastName) {
            ReadObjectQuery roq = new ReadObjectQuery(Employee.class);
            ExpressionBuilder builder = roq.getExpressionBuilder();
            roq.setSelectionCriteria((builder.get("firstName").equal(firstName)).and(builder.get("lastName").equal(lastName)));
            Employee employee = (Employee)session.executeQuery(roq);
            employee.getPhoneNumbers().size();
            return (Employee)SerializationHelper.serialize(employee);
        }One other note: In these types of application optimistic locking is very important. You should also make sure that the locking field(s) are mapped into the object and not stored only in the TopLink cache. This will ensure the locking semantics are maintained across the detachment to the client and the merge back.
    Doug

  • POJO data source refresh

    Hi
    I am using POJO as the data source and dynamically loading data (datbase controller) from a CSV file to the POJO to report and then exporting the reports to the different formats (pdf, rtf, etc.,) using Java code.
    My question is if a report is designed already using a POJO given to me and later the POJO is changed (let us a field name is added or deleted) then how that is going to effect the report. How will we refresh that fields in a report again and add/delete the fields compatible to the updated POJO. When I try to do this, the only way I saw was to add the updated POJO again and remeove the old one. But it actually deletes the entire info of the old POJO. Is there a way that I add updated info with the old data (or info) being there in my report. Not having two POJO on my report. Instead updating the POJO in my report.
    Thanks
    Lal

    Please re-post if this is still an issue to the Java Development - Crystal Reports Forum or purchase a case and have a dedicated support engineer work with you directly

  • A Web Service Question

    Hi everyone. I'm creating a WS using ADF, but I'm wondering if, despite what the documentation says about parameters, if is possible create a custom method in the AppModule that expect as parameter a custom class and return also a custom class???. It's there any simple or not way for do that or just can't be done?
    Using POJO can be solved the issue, but wont have all the facilities that offer ADF to make a WS.
    for example:
    public MyCustomClass methodName(){
    // Code
    Or
    public void methodName(MyCustomClass){
    //Code
    Regards and please advice me
    Dariel

    Hi,
    I had the exact same issue.
    What you have to do is the following:
    In the Input Value section you have to select your Prompt from your query as a web service, then click the + sign - this will add multiple rows for your prompt - each of these row can then be pointed to each of your 5 colums/filter values individually. This will work.
    I asked almost the same question her:
    Query as a Web Service and In List
    Hth.,
    Jacob

  • Best approach to serve same data among many users from POJO DC

    Hi,
    This is a question related to what is the best possible approach for the following scenario.
    A POJO DC that retrieves a collection (of approximately 200 records). The application shows the same records to all application users. The collection needs to be updated from time to time when there are new objects and this needs to be visible to all users in DB.
    Currently, for each user that connects to the application the POJO DC executes the query and deliver results. This works fine when just little amount of users but when several users wants to access the app this become very expensive.
    I am thinking to build a programatically EO - VO and then expose it in a SharedApplicationModule where thanks to the BC Cache I will save and share data among users. I will need to poll make some poll and refresh the collection when new results comes thru.
    Is this a good approach? What are your thoughts or how would be this better implemented?
    Many thanks.
    JDeveloper 12.c

    Hi,
    why do you use a POJO DC at all when the solution is to use a shared ADF BC Application Module?  Sample 156 would become your friend:
    https://blogs.oracle.com/smuenchadf/resource/examples#156
    Frank

Maybe you are looking for

  • Viewing PDF in Browser.

    Hi, I'm in a bit of a hurdle here. I have a PDF file on the server which I want to display in the browser immediately after the user enters the page. When the I go to the page I get the following error: "Acrobat could not open '_home_appsamba_kkristo

  • 6500 slide freezes when receiving SMS

    hi, I own a brand new 6500 slider, its only a few weeks old and it has a very upsetting bug. when the music player is on and the keys lock automatically (set for 1 minute), and i receive an SMS, the phone simply freezes. The keys are useless, the lig

  • Having some troubles while playing Counter Strike: Source

    Hi guys, Currently I'm using the Macbook Pro 13.3" 2nd version ( 2.9GHz, etc.). It's from Mid 2012 I believe. Anyway, I got it for passing my finals, so I've got it for less than a month now. And the thing is, I'm not really satisfied with the way it

  • Get ORA-00600 when using ExecuteXmlQuery and NCLOB column

    I am using ODP.NET, I got the following exception: at Oracle.DataAccess.Client.OracleCommand.XmlHandleException(OracleException e) at Oracle.DataAccess.Client.OracleCommand.XmlHandleException(OracleException e) at Oracle.DataAccess.Client.OracleComma

  • Deleted emails

    How can I make sure deleted emails onmy blackberry are also deleted from my laptop before receiving ? After I delete on blackberry i must once again delete same message on my laptop. Thanks