'instance of' or subclass Expression

Login is a subclass of Entity. I need to include things in my expression that are in Login but I only have a reference to Entity.
builder.get("entity").get("username") does not work because only the login subclass has username.
builder.get("login").get("username") odes not work because login is not a valid attribute name.
Mapping from my object to entity.
oneToOneMapping = new OneToOneMapping();
oneToOneMapping.setAttributeName("entity");
oneToOneMapping.setForeignKeyFieldName("TABLEA.ENTITYID");
oneToOneMapping.setReferenceClass(Entity.class);
oneToOneMapping.setGetMethodName("getEntityHolder");
oneToOneMapping.setSetMethodName("setEntityHolder");
oneToOneMapping.setUsesIndirection(true);
descriptor.addMapping(oneToOneMapping);
I really don't want to do a subquery across the whole login table...

There is currently no casting support in TopLink Expressions, please enter this enhancement request on EclipseLink.
A workaround is to define a OneToOneQueryKey to the subclass in your descriptor. This will let you do,
builder.get("login").get("username")
i.e.
queryKey = new OneToOneQueryKey();
queryKey.setName("login");
ExpressionBuilder builder = new ExpressionBuilder();
queryKey.setSelectionCriteria(builder.getField("ENTITY.ENTITYID").equal(builder.getParameter("TABLEA.ENTITYID")));
queryKey.setReferenceClass(Login.class);
descriptor.addQueryKey(queryKey);
James : http://www.eclipselink.org

Similar Messages

  • How can i create a new database instance in oracle 10g express edition?

    hello everybody
    i'm a student
    i am developing a database application
    i'm using oracle 10g express edition
    to run my application i need to create another database instance
    but i didn't find any option for doing so in that product
    if there is pls tell me where it is?
    if not pls tell me how to manually create it?
    regards,
    Chaitanya

    Chaitanya Babu M wrote:
    yaa i'm sure about that .
    i want one more instance of database.Can you perhaps explain why? I have a fair share of production and development servers - and not a single one of them needs to run more than one database instance.
    So I'm interested in what requirement you are trying to satisfy by using two database instances on a single platform.
    Oh yeah - if you want to create a custom XE instance (different SID, different tablespace sizes, more/less PL/SQL stuff installed, hack standard), make a copy of your XE db creation script (in your XE's +$ORACLE_HOME/bin+ and called createdb.sh ) and modify that for your needs.
    PS. even with a different SID, only a single XE instance can be run at a time - you can however have 2 different ones defined and then use one at a time (e.g. testing international settings, init param differences, etc.)

  • How do we retrieve the category instances matching a search expression?

    Consider the following (simplified) example:
    We archive consolidated reports. Reports come from different branches each containing the data for multiple departments. We create a category containing attributes for the branch, department, and report date. We apply multiple instances of the category to each report, one for each department contained in the report.
    We can specify the department for our search and get back the reports with matching category instances; however, since the report dates are not necessarily predictable we can't qualify the search by date. What we'd like to do is retrieve the matching category instances and display them; the user would then select the desired instance to specify the report for retrieval.
    We tried requesting the categories and custom attributes with the search, but it appears ContentDB first finds the qualifying reports then returns all the category instances on those reports--not just the ones that matched the search expression.
    I see the SEARCH_FOR_DOCUMENTS, SEARCH_FOR_FOLDERS, etc. search options, but not one for SEARCH_FOR_CATEGORIES (or equivalent). Is there a way to retrieve just the category instances that matched the search expression?

    Unfortunately no.
    As you have found out, requesting Attributes.CATEGORIES on the document will return all category instances. You would currently need to do client-side processing to locate the specific matching category instance by recursing through the category item[] and checking first that the CATEGORY_CLASS matches, and second, the value of the particular category attribute matches.
    If you are building a custom application front-end, maybe you could consider applying a single instance of some master category to the report that has a String array attribute containing all of the associated unique department ids to which the report applies.
    Then having applied the 10.1.2.3.1 patchset (and in particular Enh 5171342 NEED SEARCH EXPRESSION SUPPORT FOR ARRAY TYPE CATEGORY ATTRIBUTES), you could quickly locate the reports of interest for a specific department.
    The master category instance could also potentially contain an array of DeptID:CategoryInstanceId pairs that allow you to quickly retrieve a specific category instance given a department id.
    Matt.

  • BRFplus: How to create an instance of User-Defined Expression Type?

    Hi,
      I've created an expression type in a System Application and marked its Access Level as Global. I've created a Class & Interface and assigned it to my Expression Type, and activated it successfully.
    Now how do use this Expression Type to create expression in my Customizing Applications?
    Do I have to make any more code changes like extending any more classes or implementing additional interfaces? (I've already created a dummy Query Class and UI class)
    Any documentation or example of how to create a user-defined Expression Type and how to use them will be very helpful for me.
    Thank you & Best Regards

    Well I was going through the PDF documents available on SDN. I came across a document which referred to a document on creating user-defined expression.
    Document Name: [BRFplus XML Export and Import|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/20462066-a086-2d10-a999-c9075767ce48?quicklink=index&overridelayout=true].
    The code sample for creating user-defined expression types is available in the How to Create Custom Expression Types document
    Pg. 24
    I had a hard time looking for that document. Couldn't find it though.
    Thank you Mr. Ziegler, now I know that currently there isn't any documentation on User-Defined Expression Types. I'll be awaiting for your  document on this
    Any overview about the steps to be followed in creating a custom expression type, with a few simple steps on how to do it over here would be greatly appreciated. Especially on how to get it seen in the Create Expression Sub-Menu. Also do I have to code a web dynpro for the UI?
    Thank you & Best Regards.

  • Creating instances of Document subclass

    I have two new classed, one extends Document (call it CustomDoc) and the other extends Folder (call it CustomFolder).
    Is there any way to use the iFS webui to create these instead of the standard Document and Folder objects?

    Do you want all iFS Files to be stored as an instance of Custom-Doc, or only certain kinds of file. In order to redirect a particular kind of file (identified by it's file extension) to a custom content type you can use the ClassSelectionParser.
    See attached an example that maps BMP, JPG and TIF to the SimpleImage type.
    <?xml version="1.0" standalone="yes"?>
    <OBJECTLIST>
    <PROPERTYBUNDLE>
    <UPDATE RefType="valuedefault">ParserLookupByFileExtension</UPDATE>
    <PROPERTIES>
    <PROPERTY ACTION="add">
    <NAME>tif</NAME>
    <VALUE DataType="String">oracle.ifs.beans.parsers.ClassSelectionParser</VALUE>
    </PROPERTY>
    <PROPERTY ACTION="add">
    <NAME>bmp</NAME>
    <VALUE DataType="String">oracle.ifs.beans.parsers.ClassSelectionParser</VALUE>
    </PROPERTY>
    <PROPERTY ACTION="add">
    <NAME>jpg</NAME>
    <VALUE DataType="String">oracle.ifs.beans.parsers.ClassSelectionParser</VALUE>
    </PROPERTY>
    </PROPERTIES>
    </PROPERTYBUNDLE>
    <PROPERTYBUNDLE>
    <UPDATE RefType="valuedefault">IFS.PARSER.ObjectTypeLookupByFileExtension</UPDATE>
    <PROPERTIES>
    <PROPERTY ACTION="add">
    <NAME>tif</NAME>
    <VALUE DataType="String">SimpleImage</VALUE>
    </PROPERTY>
    <PROPERTY ACTION="add">
    <NAME>jpg</NAME>
    <VALUE DataType="String">SimpleImage</VALUE>
    </PROPERTY>
    <PROPERTY ACTION="add">
    <NAME>bmp</NAME>
    <VALUE DataType="String">SimpleImage</VALUE>
    </PROPERTY>
    </PROPERTIES>
    </PROPERTYBUNDLE>
    </OBJECTLIST>
    I do not know of any way to create instances of custom folders except via XML, or the API,
    Here is an example of how to create an an instance of a custom folder using an XML file
    <PressReleaseFolder>
    <NAME>Oracle8i Press Release</NAME>
    <FOLDERPATH>/PublishedPressReleases</FOLDERPATH>
    <ACL reftype="name" classname="SystemAccessControlList">LockedContent</ACL>
    </PressReleaseFolder>
    null

  • Returning an instance of a subclass

    I like to think of myself as a purist when designing OO relationships. Specifically, I don't agree with having classes in one package (com.foo) reference classes in a 'sub' package (com.foo.bar). I also don't agree with a class instantiating subclasses of itself. The way I see it is that the 'super' packages and super classes exist prior to their dependent clients.
    That being said, I look in java.lang.Object and see it returning Objects of type Class and String - both subclasses of Object. This relationships forces me to create a String class before creating an Object class, but at the same time I can't create a String class until an Object class is defined. It's Java's own version of the chicken and the egg.
    Any thoughts on this from the community? Does anyone else dislike this? Alternatively, does anyone have any reasons or situations where this is particular handy, besides the Object/Class/String example given. (And please DON'T anyone start explaining how it is possible to compile such a circular dependency. I know that. This question is purely philosophical in nature. I'm looking for a discussion here, not an answer per se.)
    dlgrasse

    Hi,
    I believe that the purpose of our object oriented concepts, i.e. our meta-model, is to enable us to build models of things and think about them in a practical way.
    You mention the example with the chicken and the egg which is just one example of circularity among definitions of concepts in the real world.
    I think it is a strength when a programming language is capable of expressing such definitions because it reflects how we think about things. When I think about the "chicken and egg"-problem I can come to terms with it quite easily. Instead of denying the existence of either of them because of the infinite regress that seems to arise when I think about the problem, I think about the two as having evolved in parallel. Likewise, I see no problem in Objects evolving in parallel with String or vice versa. The fact that the one is a generalisation of the other does not necessarily mean that it was created before and independently of the other. In fact, that pattern is a really useful one in many situations.
    I will try to follow your mode of thought. I understand that according to you, no definition of a class should refer to a class that its own definition depends on. Let's make a small language in which only objects exist (so-called primitive types included). The language supports inheritance. At the base of our class hierarchy we must have some class resembling Object. According to you this class can only operate on Objects (is this an impure reference? can an object refer to its own definition?). So tell me: how can this class be extended in a way that adds functionality? Do we need a set of primitive types to make purism work? If so, is it pure?
    I think that all formal systems need at least two interacting and cross-defining concepts to be interesting, such as the theory of natural numbers, that of grammars, that of automata, etc. And it just doesn't make much sense to ask which one came first. Perhaps the design of a programming language is also bound to include such circular definitions to be interesting.
    Regards,
    S&oslash;ren Bak

  • Why assigning a subclass instance to a variable of type of superclass ?

    Hi all,
    What is the significance of assigning an instance of a subclass to a variable whose type is a superclass's type.
    For eg. List list=new ArrayList();
    If I do so is it possible to execute the methods of the subclass ?
    regards
    Anto Paul.

    In addition, this is what polymorphism is all about:
    abstract class Animal {
      String name;
      Animal(String name) {
        this.name = name;
      public abstract void voice();
    class Dog extends Animal {
      Dog(String name) { super(name); }
      public void voice() {
        System.out.println(name+" barks");
    class Cat extends Animal {
      Cat(String name) { super(name); }
      public void voice() {
        System.out.println(name+" miaows");
    public class Polymorphism {
      public static void main(String args[]) {
        Animal[] animals = {
          new Dog("Fido"),
          new Cat("Felix")
        for (int i = 0; i < animals.length; i++) {
          animals.voice();
    Here, we are looping through an array of Animals. In fact, these are concrete subclasses of the abstract Animal class. In this simple example, you can see from the code that the animals array contains a dog and a cat. But we could even extend this to read in an arbitrary Animal object that had been serialized into a file. At compile time, the exact class of the serialized animal would not be known. But polymorphism occurs at runtime to ensure the correct voice() method is called.
    For the List, or Map example, conisder this:
    public SomeClass {
      public HashMap map1 = new HashMap();  // this ties you to hashmap
      public Map map2 = new HashMap();      // this allows you to change Map implementation
      public void process(HashMap map) {}   // this ties you to hashmap
      public void process(Map map) {}       // this allows you to change Map implementation
    }Suppose you use a HashMap for map2 to start with. But at some point in the future you would like to ensure your map is sorted. By specifying map2 to be a Map, you can change the implementation without having to modify each method call by simplying changing the initiliastion to be:
    Map map2 = new TreeMap();Hope some of this helps :) Cheers, Neil

  • SQL Server 2012 Express Instance is Not Discovered

    I have a single SQL Server 2012 Express instance that is the backend database for a small door security application.  I just noticed after having deployed the OpsMgr agent months ago that it never discovered the SQL instance.  The SQL instance
    is, as stated, Express, and it's the only Express instance I have.  Is that why it is not discovered?  All the documentation I found seems to indicate the opposite -- that Express is discovered and there are steps you can take to exclude Express
    instances.  I have no overrides set to exclude any instance or any database.
    - System Center Operations Manager 2012 RTM (no SP1, no R2)
    - SQL Server 2012 MP version 6.3.173.1
    - SQL Server is Windows Server 2012
    - SQL Server 2012 Express running on a Hyper-V VM.  Instance is named DOORSERVER\Eclipse
    - Agent is installed and other discoveries seem to be working fine
    - No discovery errors in the event log related to SQL, although there is one about the Windows Server 2008 discovery not being able to start, but I'm on Windows Server 2012, so I am guessing that's okay?
    - No overrides are set on the discovery
    - Discovery has found every other SQL Server 2012 instance (standard and enterprise editions)

    Well, just realized I didn't have the latest MP.  Upgrading to 6.4.1.0 version of the SQL MP fixed the discovery issue.

  • Method.invoke causes IllegalArgumentException with subclass instance

    Is there a way to use an instance of a subclass when using reflection to invoke a method?
    Given the following code, I want to be able to use reflection to invoke the "doSomething" method within the Foo class. However, I want to use an instance of Bar as the parameter value when using reflection (since an instance of Bar is implicitly an instance of Foo; I have also tried casting the Bar instance, b, to Foo but this does not work). Doing this yields an IllegalArgumentException.
    What am I missing? What am I doing wrong? What do I have to do in order to use an instance of Bar with "invoke"?
    // Foo.java
    package junk;
    public class Foo
        private void doSomething(Foo f)
            System.out.println("Doing something with a " + f.getClass().getName());
        public static void main(String[] args)
            Foo f = new Foo();
            Bar b = new Bar();
            f.doSomething(f);   // Outputs "Doing something with a junk.Foo"
            f.doSomething(b);   // Outputs "Doing something with a junk.Bar"
            Class[] paramTypes = new Class[] { f.getClass() };
            Object[] paramValues = new Object[] { b };
            b.invokePrivateFooMethod("doSomething", paramTypes, paramValues); // Doesn't work
    // Bar.java
    package junk;
    import java.lang.reflect.Method;
    import java.lang.reflect.InvocationTargetException;
    public class Bar extends Foo
        public void invokePrivateFooMethod(String methodName,
                                           Class[] paramTypes,
                                           Object[] paramValues)
            try
                Foo localF = new Foo();
                Class classToUse  = localF.getClass();
                Method methodToUse = classToUse.getDeclaredMethod(methodName, paramTypes);
                methodToUse.setAccessible(true);    // override of private modifier
                methodToUse.invoke(classToUse, paramValues);
            catch (IllegalAccessException e)
                e.printStackTrace();
            catch (NoSuchMethodException e)
                e.printStackTrace();
            catch (InvocationTargetException e)
                e.printStackTrace();
    }

    Sorrry for the confusion. It's always the little things...
    I neglected to use an instance of Foo to invoke the method.
    See corrected code below:
    // Bar.java
    package junk;
    import java.lang.reflect.Method;
    import java.lang.reflect.InvocationTargetException;
    public class Bar extends Foo
        public void invokePrivateFooMethod(String methodName,
                                           Class[] paramTypes,
                                           Object[] paramValues)
            try
                Foo localF = new Foo();
                Class classToUse  = localF.getClass();
                Method methodToUse = classToUse.getDeclaredMethod(methodName, paramTypes);
                methodToUse.setAccessible(true);    // override of private modifier
                // NOTE:  Use localF, NOT classToUse!
                methodToUse.invoke(localF, paramValues);
            catch (IllegalAccessException e)
                e.printStackTrace();
            catch (NoSuchMethodException e)
                e.printStackTrace();
            catch (InvocationTargetException e)
                e.printStackTrace();
    }

  • How many sql server express instances i can install maximum in single system

    Hello Team,
    I want to install multiple sql express instances in single machine. My question is that how many instances of sql server express editions i can install in single machine ? 
    Thanks,
    Udaya Kumar
    udaya kumar

    For practical reasons as much as you like you probably would not exceed in any case 10 instances because after that resource crunch would start but any how you can read Max specification for SQL Server
    More accurate answer is "50 instances on a stand-alone server for all SQL Server editions."
    https://msdn.microsoft.com/en-us/library/ms143432.aspx
    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it
    My Technet Wiki Article
    MVP

  • Expression problem for ABAP program

    Hi everyone,
    Once i have saw a expression in ABAP program. as follows.
    DATA:drag_object TYPE REF TO lcl_dragdrop_dataobject.
    CATCH SYSTEM-EXCEPRIONS move_cast_error = 1.
    drag_object ?= dragdrop_object->object.
    ENDCATCH.
    IF sy-subrc = 1.
    CALL METHOD dragdrop_object->abort.
    EXIT.
    ENDIF.
    I don't know what is "?=" .
    Please help me.
    Thanks Advanced !

    DATA: airplane TYPE REF TO lcl_airplane,
                cargo_airplane TYPE REF TO lcl_cargo_airplane,
                cargo_airplane2 TYPE REF TO lcl_cargo_airplane.
          CREATE OBJECT cargo_airplane.
          airplane = cargo_airplane.
          cargo_airplane2 ?= airplane.
                 The type of case described above is known as a widening cast because it changes the
                 view to one with more details. The instance assigned (a cargo plane in the above
                 example) must correspond to the object reference (cargo_airplane in the above example),
                 that is, the instance must have the details implied by the reference. This is also known as
                 a u201Cdown castu201D. The widening cast in this case does not cause an error because the
                 reference airplane actually points to an instance in the subclass lcl_cargo_airplane. The
                 dynamic type is therefore u2018REF TO lcl_cargo_airplaneu2019.
    The widening cast logically represents the opposite of the narrowing cast. The widening cast cannot be checked statically, only at runtime. The Cast Operator u201C?=u201D (or the equivalent u201CMOVE ... ?TO u2026u201D) must be used to make this visible.

  • How to get the subclass from a super class( or interface)

    hi,
    I want to get subclass from a super class (or a interface), how to do that? the subclass of a interface means the class implementing the interface.
    for example;
    List ls;
    I want to get the subclass of ls, i.e., LinkedList, Stack, Vector......
    AbstractList al;
    the subclass of al, i.e., ArrayList, Vector.......
    thanks
    Aiwu

    List ls = new ArrayList();Since ls has been declared as a List we can only use List methods
    with it. This is a good thing because we might later want to change
    it to some other sort of List.
    I want to get subclass from a super class (or a interface), how to do
    that?The instance of the subclass declared above did not really come
    from the super class. A class "knows nothing" about its
    subclasses: many sub classes would not even exist at the time
    the class was written.

  • Re: [iPlanet-JATO] Re: Use Of models in utility classes - Pease don't forget about the regular expression potential

    Namburi,
    When you said you used the Reg Exp tool, did you use it only as
    preconfigured by the iMT migrate application wizard?
    Because the default configuration of the regular expression tool will only
    target the files in your ND project directories. If you wish to target
    classes outside of the normal directory scope, you have to either modify the
    "Source Directory" property OR create another instance of the regular
    expression tool. See the "Tool" menu in the iMT to create additional tool
    instances which can each be configured to target different sets of files
    using different sets of rules.
    Usually, I utilize 3 different sets of rules files on a given migration:
    spider2jato.xml
    these are the generic conversion rules (but includes the optimized rules for
    ViewBean and Model based code, i.e. these rules do not utilize the
    RequestManager since it is not needed for code running inside the ViewBean
    or Model classes)
    I run these rules against all files.
    See the file download section of this forum for periodic updates to these
    rules.
    nonProjectFileRules.xml
    these include rules that add the necessary
    RequestManager.getRequestContext(). etc prefixes to many of the common
    calls.
    I run these rules against user module and any other classes that do not are
    not ModuleServlet, ContainerView, or Model classes.
    appXRules.xml
    these rules include application specific changes that I discover while
    working on the project. A common thing here is changing import statements
    (since the migration tool moves ND project code into different jato
    packaging structure, you sometime need to adjust imports in non-project
    classes that previously imported ND project specific packages)
    So you see, you are not limited to one set of rules at all. Just be careful
    to keep track of your backups (the regexp tool provides several options in
    its Expert Properties related to back up strategies).
    ----- Original Message -----
    From: <vnamboori@y...>
    Sent: Wednesday, August 08, 2001 6:08 AM
    Subject: [iPlanet-JATO] Re: Use Of models in utility classes - Pease don't
    forget about the regular expression potential
    Thanks Matt, Mike, Todd
    This is a great input for our migration. Though we used the existing
    Regular Expression Mapping tool, we did not change this to meet our
    own needs as mentioned by Mike.
    We would certainly incorporate this to ease our migration.
    Namburi
    --- In iPlanet-JATO@y..., "Todd Fast" <toddwork@c...> wrote:
    All--
    Great response. By the way, the Regular Expression Tool uses thePerl5 RE
    syntax as implemented by Apache OROMatcher. If you're doing lotsof these
    sorts of migration changes manually, you should definitely buy theO'Reilly
    book "Mastering Regular Expressions" and generate some rules toautomate the
    conversion. Although they are definitely confusing at first,regular
    expressions are fairly easy to understand with some documentation,and are
    superbly effective at tackling this kind of migration task.
    Todd
    ----- Original Message -----
    From: "Mike Frisino" <Michael.Frisino@S...>
    Sent: Tuesday, August 07, 2001 5:20 PM
    Subject: Re: [iPlanet-JATO] Use Of models in utility classes -Pease don't
    forget about the regular expression potential
    Also, (and Matt's document may mention this)
    Please bear in mind that this statement is not totally correct:
    Since the migration tool does not do much of conversion for
    these
    utilities we have to do manually.Remember, the iMT is a SUITE of tools. There is the extractiontool, and
    the translation tool, and the regular expression tool, and severalother
    smaller tools (like the jar and compilation tools). It is correctto state
    that the extraction and translation tools only significantlyconvert the
    primary ND project objects (the pages, the data objects, and theproject
    classes). The extraction and translation tools do minimumtranslation of the
    User Module objects (i.e. they repackage the user module classes inthe new
    jato module packages). It is correct that for all other utilityclasses
    which are not formally part of the ND project, the extraction and
    translation tools do not perform any migration.
    However, the regular expression tool can "migrate" any arbitrary
    file
    (utility classes etc) to the degree that the regular expressionrules
    correlate to the code present in the arbitrary file. So first andforemost,
    if you have alot of spider code in your non-project classes youshould
    consider using the regular expression tool and if warranted adding
    additional rules to reduce the amount of manual adjustments thatneed to be
    made. I can stress this enough. We can even help you write theregular
    expression rules if you simply identify the code pattern you wish to
    convert. Just because there is not already a regular expressionrule to
    match your need does not mean it can't be written. We have notnearly
    exhausted the possibilities.
    For example if you say, we need to convert
    CSpider.getDataObject("X");
    To
    RequestManager.getRequestContext().getModelManager().getModel(XModel.class);
    Maybe we or somebody else in the list can help write that regularexpression if it has not already been written. For instance in thelast
    updated spider2jato.xml file there is already aCSpider.getCommonPage("X")
    rule:
    <!--getPage to getViewBean-->
    <mapping-rule>
    <mapping-rule-primarymatch>
    <![CDATA[CSpider[.\s]*getPage[\s]*\(\"([^"]*)\"]]>
    </mapping-rule-primarymatch>
    <mapping-rule-replacement>
    <mapping-rule-match>
    <![CDATA[CSpider[.\s]*getPage[\s]*\(\"([^"]*)\"]]>
    </mapping-rule-match>
    <mapping-rule-substitute>
    <![CDATA[getViewBean($1ViewBean.class]]>
    </mapping-rule-substitute>
    </mapping-rule-replacement>
    </mapping-rule>
    Following this example a getDataObject to getModel would look
    like this:
    <mapping-rule>
    <mapping-rule-primarymatch>
    <![CDATA[CSpider[.\s]*getDataObject[\s]*\(\"([^"]*)\"]]>
    </mapping-rule-primarymatch>
    <mapping-rule-replacement>
    <mapping-rule-match>
    <![CDATA[CSpider[.\s]*getDataObject[\s]*\(\"([^"]*)\"]]>
    </mapping-rule-match>
    <mapping-rule-substitute>
    <![CDATA[getModel($1Model.class]]>
    </mapping-rule-substitute>
    </mapping-rule-replacement>
    </mapping-rule>
    In fact, one migration developer already wrote that rule andsubmitted it
    for inclusion in the basic set. I will post another upgrade to thebasic
    regular expression rule set, look for a "file uploaded" posting.Also,
    please consider contributing any additional generic rules that youhave
    written for inclusion in the basic set.
    Please not, that in some cases (Utility classes in particular)
    the rule
    application may be more effective as TWO sequention rules ratherthan one
    monolithic rule. Again using the example above, it will convert
    CSpider.getDataObject("Foo");
    To
    getModel(FooModel.class);
    Now that is the most effective conversion for that code if that
    code is in
    a page or data object class file. But if that code is in a Utilityclass you
    really want:
    >
    RequestManager.getRequestContext().getModelManager().getModel(FooModel.class
    So to go from
    getModel(FooModel.class);
    To
    RequestManager.getRequestContext().getModelManager().getModel(FooModel.class
    You would apply a second rule AND you would ONLY run this rule
    against
    your utility classes so that you would not otherwise affect yourViewBean
    and Model classes which are completely fine with the simplegetModel call.
    <mapping-rule>
    <mapping-rule-primarymatch>
    <![CDATA[getModel\(]]>
    </mapping-rule-primarymatch>
    <mapping-rule-replacement>
    <mapping-rule-match>
    <![CDATA[getModel\(]]>
    </mapping-rule-match>
    <mapping-rule-substitute>
    <![CDATA[RequestManager.getRequestContext().getModelManager().getModel(]]>
    </mapping-rule-substitute>
    </mapping-rule-replacement>
    </mapping-rule>
    A similer rule can be applied to getSession and other CSpider APIcalls.
    For instance here is the rule for converting getSession calls toleverage
    the RequestManager.
    <mapping-rule>
    <mapping-rule-primarymatch>
    <![CDATA[getSession\(\)\.]]>
    </mapping-rule-primarymatch>
    <mapping-rule-replacement>
    <mapping-rule-match>
    <![CDATA[getSession\(\)\.]]>
    </mapping-rule-match>
    <mapping-rule-substitute>
    <![CDATA[RequestManager.getSession().]]>
    </mapping-rule-substitute>
    </mapping-rule-replacement>
    </mapping-rule>
    ----- Original Message -----
    From: "Matthew Stevens" <matthew.stevens@e...>
    Sent: Tuesday, August 07, 2001 12:56 PM
    Subject: RE: [iPlanet-JATO] Use Of models in utility classes
    Namburi,
    I will post a document to the group site this evening which has
    the
    details
    on various tactics of migrating these type of utilities.
    Essentially,
    you
    either need to convert these utilities to Models themselves or
    keep the
    utilities as is and simply use the
    RequestManager.getRequestContext.getModelManager().getModel()
    to statically access Models.
    For CSpSelect.executeImmediate() I have an example of customhelper
    method
    as a replacement whicch uses JDBC results instead of
    CSpDBResult.
    matt
    -----Original Message-----
    From: vnamboori@y... [mailto:<a href="/group/SunONE-JATO/post?protectID=081071113213093190112061186248100208071048">vnamboori@y...</a>]
    Sent: Tuesday, August 07, 2001 3:24 PM
    Subject: [iPlanet-JATO] Use Of models in utility classes
    Hi All,
    In the present ND project we have lots of utility classes.
    These
    classes in diffrent directory. Not part of nd pages.
    In these classes we access the dataobjects and do themanipulations.
    So we access dataobjects directly like
    CSpider.getDataObject("do....");
    and then execute it.
    Since the migration tool does not do much of conversion forthese
    utilities we have to do manually.
    My question is Can we access the the models in the postmigration
    sameway or do we need requestContext?
    We have lots of utility classes which are DataObjectintensive. Can
    someone suggest a better way to migrate this kind of code.
    Thanks
    Namburi
    [email protected]
    [email protected]
    [Non-text portions of this message have been removed]
    [email protected]
    [email protected]

    Namburi,
    When you said you used the Reg Exp tool, did you use it only as
    preconfigured by the iMT migrate application wizard?
    Because the default configuration of the regular expression tool will only
    target the files in your ND project directories. If you wish to target
    classes outside of the normal directory scope, you have to either modify the
    "Source Directory" property OR create another instance of the regular
    expression tool. See the "Tool" menu in the iMT to create additional tool
    instances which can each be configured to target different sets of files
    using different sets of rules.
    Usually, I utilize 3 different sets of rules files on a given migration:
    spider2jato.xml
    these are the generic conversion rules (but includes the optimized rules for
    ViewBean and Model based code, i.e. these rules do not utilize the
    RequestManager since it is not needed for code running inside the ViewBean
    or Model classes)
    I run these rules against all files.
    See the file download section of this forum for periodic updates to these
    rules.
    nonProjectFileRules.xml
    these include rules that add the necessary
    RequestManager.getRequestContext(). etc prefixes to many of the common
    calls.
    I run these rules against user module and any other classes that do not are
    not ModuleServlet, ContainerView, or Model classes.
    appXRules.xml
    these rules include application specific changes that I discover while
    working on the project. A common thing here is changing import statements
    (since the migration tool moves ND project code into different jato
    packaging structure, you sometime need to adjust imports in non-project
    classes that previously imported ND project specific packages)
    So you see, you are not limited to one set of rules at all. Just be careful
    to keep track of your backups (the regexp tool provides several options in
    its Expert Properties related to back up strategies).
    ----- Original Message -----
    From: <vnamboori@y...>
    Sent: Wednesday, August 08, 2001 6:08 AM
    Subject: [iPlanet-JATO] Re: Use Of models in utility classes - Pease don't
    forget about the regular expression potential
    Thanks Matt, Mike, Todd
    This is a great input for our migration. Though we used the existing
    Regular Expression Mapping tool, we did not change this to meet our
    own needs as mentioned by Mike.
    We would certainly incorporate this to ease our migration.
    Namburi
    --- In iPlanet-JATO@y..., "Todd Fast" <toddwork@c...> wrote:
    All--
    Great response. By the way, the Regular Expression Tool uses thePerl5 RE
    syntax as implemented by Apache OROMatcher. If you're doing lotsof these
    sorts of migration changes manually, you should definitely buy theO'Reilly
    book "Mastering Regular Expressions" and generate some rules toautomate the
    conversion. Although they are definitely confusing at first,regular
    expressions are fairly easy to understand with some documentation,and are
    superbly effective at tackling this kind of migration task.
    Todd
    ----- Original Message -----
    From: "Mike Frisino" <Michael.Frisino@S...>
    Sent: Tuesday, August 07, 2001 5:20 PM
    Subject: Re: [iPlanet-JATO] Use Of models in utility classes -Pease don't
    forget about the regular expression potential
    Also, (and Matt's document may mention this)
    Please bear in mind that this statement is not totally correct:
    Since the migration tool does not do much of conversion for
    these
    utilities we have to do manually.Remember, the iMT is a SUITE of tools. There is the extractiontool, and
    the translation tool, and the regular expression tool, and severalother
    smaller tools (like the jar and compilation tools). It is correctto state
    that the extraction and translation tools only significantlyconvert the
    primary ND project objects (the pages, the data objects, and theproject
    classes). The extraction and translation tools do minimumtranslation of the
    User Module objects (i.e. they repackage the user module classes inthe new
    jato module packages). It is correct that for all other utilityclasses
    which are not formally part of the ND project, the extraction and
    translation tools do not perform any migration.
    However, the regular expression tool can "migrate" any arbitrary
    file
    (utility classes etc) to the degree that the regular expressionrules
    correlate to the code present in the arbitrary file. So first andforemost,
    if you have alot of spider code in your non-project classes youshould
    consider using the regular expression tool and if warranted adding
    additional rules to reduce the amount of manual adjustments thatneed to be
    made. I can stress this enough. We can even help you write theregular
    expression rules if you simply identify the code pattern you wish to
    convert. Just because there is not already a regular expressionrule to
    match your need does not mean it can't be written. We have notnearly
    exhausted the possibilities.
    For example if you say, we need to convert
    CSpider.getDataObject("X");
    To
    RequestManager.getRequestContext().getModelManager().getModel(XModel.class);
    Maybe we or somebody else in the list can help write that regularexpression if it has not already been written. For instance in thelast
    updated spider2jato.xml file there is already aCSpider.getCommonPage("X")
    rule:
    <!--getPage to getViewBean-->
    <mapping-rule>
    <mapping-rule-primarymatch>
    <![CDATA[CSpider[.\s]*getPage[\s]*\(\"([^"]*)\"]]>
    </mapping-rule-primarymatch>
    <mapping-rule-replacement>
    <mapping-rule-match>
    <![CDATA[CSpider[.\s]*getPage[\s]*\(\"([^"]*)\"]]>
    </mapping-rule-match>
    <mapping-rule-substitute>
    <![CDATA[getViewBean($1ViewBean.class]]>
    </mapping-rule-substitute>
    </mapping-rule-replacement>
    </mapping-rule>
    Following this example a getDataObject to getModel would look
    like this:
    <mapping-rule>
    <mapping-rule-primarymatch>
    <![CDATA[CSpider[.\s]*getDataObject[\s]*\(\"([^"]*)\"]]>
    </mapping-rule-primarymatch>
    <mapping-rule-replacement>
    <mapping-rule-match>
    <![CDATA[CSpider[.\s]*getDataObject[\s]*\(\"([^"]*)\"]]>
    </mapping-rule-match>
    <mapping-rule-substitute>
    <![CDATA[getModel($1Model.class]]>
    </mapping-rule-substitute>
    </mapping-rule-replacement>
    </mapping-rule>
    In fact, one migration developer already wrote that rule andsubmitted it
    for inclusion in the basic set. I will post another upgrade to thebasic
    regular expression rule set, look for a "file uploaded" posting.Also,
    please consider contributing any additional generic rules that youhave
    written for inclusion in the basic set.
    Please not, that in some cases (Utility classes in particular)
    the rule
    application may be more effective as TWO sequention rules ratherthan one
    monolithic rule. Again using the example above, it will convert
    CSpider.getDataObject("Foo");
    To
    getModel(FooModel.class);
    Now that is the most effective conversion for that code if that
    code is in
    a page or data object class file. But if that code is in a Utilityclass you
    really want:
    >
    RequestManager.getRequestContext().getModelManager().getModel(FooModel.class
    So to go from
    getModel(FooModel.class);
    To
    RequestManager.getRequestContext().getModelManager().getModel(FooModel.class
    You would apply a second rule AND you would ONLY run this rule
    against
    your utility classes so that you would not otherwise affect yourViewBean
    and Model classes which are completely fine with the simplegetModel call.
    <mapping-rule>
    <mapping-rule-primarymatch>
    <![CDATA[getModel\(]]>
    </mapping-rule-primarymatch>
    <mapping-rule-replacement>
    <mapping-rule-match>
    <![CDATA[getModel\(]]>
    </mapping-rule-match>
    <mapping-rule-substitute>
    <![CDATA[RequestManager.getRequestContext().getModelManager().getModel(]]>
    </mapping-rule-substitute>
    </mapping-rule-replacement>
    </mapping-rule>
    A similer rule can be applied to getSession and other CSpider APIcalls.
    For instance here is the rule for converting getSession calls toleverage
    the RequestManager.
    <mapping-rule>
    <mapping-rule-primarymatch>
    <![CDATA[getSession\(\)\.]]>
    </mapping-rule-primarymatch>
    <mapping-rule-replacement>
    <mapping-rule-match>
    <![CDATA[getSession\(\)\.]]>
    </mapping-rule-match>
    <mapping-rule-substitute>
    <![CDATA[RequestManager.getSession().]]>
    </mapping-rule-substitute>
    </mapping-rule-replacement>
    </mapping-rule>
    ----- Original Message -----
    From: "Matthew Stevens" <matthew.stevens@e...>
    Sent: Tuesday, August 07, 2001 12:56 PM
    Subject: RE: [iPlanet-JATO] Use Of models in utility classes
    Namburi,
    I will post a document to the group site this evening which has
    the
    details
    on various tactics of migrating these type of utilities.
    Essentially,
    you
    either need to convert these utilities to Models themselves or
    keep the
    utilities as is and simply use the
    RequestManager.getRequestContext.getModelManager().getModel()
    to statically access Models.
    For CSpSelect.executeImmediate() I have an example of customhelper
    method
    as a replacement whicch uses JDBC results instead of
    CSpDBResult.
    matt
    -----Original Message-----
    From: vnamboori@y... [mailto:<a href="/group/SunONE-JATO/post?protectID=081071113213093190112061186248100208071048">vnamboori@y...</a>]
    Sent: Tuesday, August 07, 2001 3:24 PM
    Subject: [iPlanet-JATO] Use Of models in utility classes
    Hi All,
    In the present ND project we have lots of utility classes.
    These
    classes in diffrent directory. Not part of nd pages.
    In these classes we access the dataobjects and do themanipulations.
    So we access dataobjects directly like
    CSpider.getDataObject("do....");
    and then execute it.
    Since the migration tool does not do much of conversion forthese
    utilities we have to do manually.
    My question is Can we access the the models in the postmigration
    sameway or do we need requestContext?
    We have lots of utility classes which are DataObjectintensive. Can
    someone suggest a better way to migrate this kind of code.
    Thanks
    Namburi
    [email protected]
    [email protected]
    [Non-text portions of this message have been removed]
    [email protected]
    [email protected]

  • Calling a particular Method of all subclass from a super class

    hi
    I have a class 'A' which is a super class for 'B' ,'C' , 'D'
    my main method is in the class Main and while on the run i am calling methods of B,C,D form this main class.
    but as the first step of execution i need to call a init method which has been defined in all the sub-classes. and there can be any no of sub-classes and all will have the init method and i have to call the init method for all classes. is this possible to do that in runtime. ie i wil not be knowing the names of sub-classes.
    thanks
    zeta

    Sorry if i had mislead you all.
    I am not instantiating from my super class.
    as mjparme i wanted one controller class to do the
    init method calls
    so i got it working from the link you gave.
    URL url = Launcher.class.getResource(name);
    File directory = new File(url.getFile());
    This way i can get all the classes in that
    in that package
    and from reflection i can get whether it is
    her it is a sub class of the particular super class
    and i can call the init methods by making the init
    methods static
    thanks for the help
    zetaThis is a rather fragile solution.
    If the problem is one of knowing which subclasses exist, I would suggest specifying them explicitly via configuration (system property or properties file or whatever).
    One thing that's not entirely clear to me: Is the init going to be called once for each subclass, or once for each instance of each subclass? It sounds to me like it's once per class, but I want to make sure.

  • I can't see sql server express 2012 from ssms 2008 R2 -- what do I need to download?

    I'm running sql server 2008 R2 Developer on a win7 (pro) workstation.   I would like to keep this installation because it has SSRS and Analysis Server. But I was not able to attach a sql 2012 DB so I downloaded Sql Server Express 2012 (per the
    picture below - 1st option selected) and installed it.   Sql Server Express 2012 appears to be running -- per my services list, but I cannot see the instance in ssms 2008 R2. Do I need to uninstall Sql Server Express 2012 and then download another
    option (from the picture below)? How should I proceed so that I can have a working/workable instance of Sql Server Express 2012 that I can see in ssms (whatever required version) and also keep sql server 2008 R2?  which download should I select (from
    the picture below?
    Rich P

    Should I uninstall Sql server 2012 first?
    Rich P
    No you do not need to uninstall any thing
    >> Sql Server Express 2012 appears to be running -- per my services list, but I cannot see the instance in ssms 2008 R2.
    You need to just download SQL Server 2012 express management studio and use that to connect to SQL Server 2012. And use SSMS 2008 r2 to connect to SQL Server 2008 r2.
    This File :ENU\x64\SQLManagementStudio_x64_ENU.exe
    Although I guess SSMS 2012 express with SP2 would work just fine and you would connect to 2008 R2 database using that.
    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it
    My Technet Wiki Article
    MVP

Maybe you are looking for

  • Error in creation of Object Type

    Hi, I am facing a problem creating a appropriate a object type for a XML. Below are the details: XML Passed <mer_offer_action_data>      <form_id>           134039588      </form_id>      <action_cd>           OA      </action_cd>      <offer_decline

  • Word report

    Hi All, Currently working on a program where I use the Office Report Generation (Word) With LV 8.5 I used a VI of my own to set a table in autofit. This can not be done with the VI in the toolkit (I think  ) With LV 8.6 the report reference is change

  • Downloading the Queries(SAP QUERY) via Background to Excel sheet

    Hi Abapers,        Is it possible to download the Queries into an Excel Format via Background onto the Application Server / Presentation Server in the Excel format.    If Possible, Please provide me the solution. Thanks in Advance.

  • How to catch PL/SQL: ORA-04052 error?

    I need to execute a procedure that select remote objects but the remote db is a RAC DB and I only have access to one of the nodes, the remote RAC have load balancing enabled and the remote DBA can't create a DB Service for my connection, so, I have t

  • Filtering Hotmail email coming to Blackberry

    I have setup my hotmail account to come to my blackberry 8100.  It works fine, with minimal issues.  Today, I added some new folders in hotmail, and moved some old emails to them.  All of a sudden I started receiving a bunch of emails on the blackber