Array or Hashmap

I'm planning on loading all of my data from a separate thread into a single variable. This variable needs to hold 18 character models 8 terrains and random objects. I was originally planning on separating these two categories into Hashmaps and then the put the two hashmaps into a single hashmap so that I may call them by name. I then decided to buy them into ArrayLists instead of hashmaps. Similar to all games i'm looking for the best performance I dropped the ArrayLists but wanted to know if I would get better performance from an dimensional Array, An Array of 2 arrays or Hashmap?
Edited by: Bonechilla on Aug 23, 2009 9:54 AM

For such a small number of items, it will be very difficult (and pointless) to measure a difference in performance between different implementations.
But in answer to your question, I would advise building an interface for this collection describing how you want them to be stored and retrieved. i.e.
public interface Models
    public abstract void add(String name, Model model);
    public abstract Model get(String name);
    public abstract int size();
}Why? because then you can produce all these implementations and try them all out.
For example using a HashMap:public class HashMapModels extends HashMap<String, Model>
        implements Models
}or two ArrayLists:public class ArrayModels implements Models
    private ArrayList<String> names;
    private ArrayList<Model> models;
    public ArrayModels()
        names = new ArrayList<String>();
        models = new ArrayList<Model>();
    public void add(String name, Model model)
        names.add( name );
        models.add( model );
    public Model get(String keyName)
        int index = 0;
        for (String name : names) {
            if (name.equals( keyName )) {
                return models.get( index );
            } else {
                index++;
        return null;
    public int size()
        return models.size();
}Out of the two above, the HashMap should be the fastest and be the easiest to maintain. But what will really aid you in performance is if the models are stored in separate collections; one for terrains, one for characters and another for random models.
Perhaps:public class ModelStore
    private Models terrains;
    private Models characters;
    private Models objects;
    public Model getTerrain(String name)
        return terrains.get( name );
    public Model getCharacter(String name)
        return characters.get( name );
    public Model getObject(String name)
        return objects.get( name );
}Now if you want to retrieve a terrain model you should only search through the 8 terrains and so skip the characters and random objects.
You should also be thinking about what type of characteristics your collection needs. Presumably once it's loaded you will not be adding new elements to the collection, you will never insert models randomly into it (only adding to the end) and you will be performing lots of random access. If you can search by the models index (i.e. using an int) rather then it's name, then an array will easily be the fastest and all models could be stored in one big array. If your searching by name (or some other object used to identify the model) then I would recommend a TreeMap. Once all the items are added I'd guess it would give the best performance at searching for Models.
But without profiling different ideas with real data, all of this is purely guesswork.

Similar Messages

  • How to initialize the array of hashmap???

    how to initialize the array of hashmap??

    What do you mean by "the array of hashmap"?

  • Access values stored in 2D Array in HashMap

    Hi everyone i would like to know how to access values stored in a 2D array inside a HashMap
    Here is a drawing representation of the map.
    So to get the KEYS I just have to execute this code:
    this.allPeople = personInterests.keySet();But how can I get acces to the actual values inside the 2D Array?
    My goal is to create a treeSet and store all the elements of the first array in it, then look at the second array if any new elements are detected add them to the treeset, then third array and so on.
    I tried this code:
    Object[] bands = personInterests.values().toArray();
         for( int i=0; i<bands.length; i++)
              this.allBands.add(bands.toString());
    }But this.allBands.add(bands[i].toString())seems to be the problem, Dealing with a 2D array, this code only return a string representation of the Arrays and not a string representation of their elements.
    Using my logic I tried to execute:
       this.allBands.add(bands[0][i].toString());But i get a ARRAY REQUIRED BUT JAVA.LANG.OBJECT FOUND
    I really don't know the way to go.
    Thanks to anyone that will help.
    Regards, Damien.
    Edited by: Fir3blast on Mar 3, 2010 5:27 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    You'll just need to cast the object to the correct type. This is nothing to do with HashMap at all. If you don't know what that means then your google keywords are "java cast tutorial".

  • Arrays vs HashMap

    I have a program that I'm writing that requires a very large array. This presents a problem b/c as my data input grows I will run out of heap space because of the large amount of contiguous memory I'm asking for in my array. I thought, why not use a hashmap mapping from integer to object. The hashmap could function like an array in that it would have nearly constant lookup and it wouldn't have contiguous memory so I could store more data. Is that true or am i crazy?

    Once you define an array of large size it blocks memory for that so may be your application is behaving like that. ArrayLists are growable arrays that grows as the need arise. So better to switch to ArrayList or Map will also resolve the things.

  • Array of hashmaps.....

    Hi everybody,
    I am having a set of unique session ids in a hash map....
    With each session id , i have to associate a set of webpages and the times spent in each of them...I want the storage to be something of this sort
    SessionId1{p1:10sec;p2:30sec;....}
    SessionId2{p1:30sec,p2:22sec;....}
    (The pages viewed by id1 and id2 may be different ..for example p1 for id1 may be page 7 and p1 for id2 may be page 50....)
    The pages pertaining to each session id should also be unique.....(i.e. p1 can appear only once in id1)
    So for each pageset , i think i should have a hash map containing (pageid,timespent) as (key,value)....
    But how do i associate this pages hashmap with the sesssion id hash map....
    i.e. in the sessionid hash map, (key,value)
    key->Sessionid
    value->the pages hash map...
    How do i do this.....
    Or else is there any other simple way to do this....
    Hope i explained my problem clearly.....
    Thanks in advance for any help...

    But how do i associate this pages hashmap with the sesssion id hash map....
    i.e. in the sessionid hash map, (key,value)
    key->Sessionid
    value->the pages hash map...Seems like you've got it.
    There is no problem with putting Maps as values for a Map.

  • Array of treemap, newbie question

    Hi
    I am quite a newbie at programming (in java) so please don't be surprised if the answer to my question is extremely obvious. An answer would still be very appreciated.
    I am trying to create an array of hashmaps, below is the code that i have used:
    import java.util.TreeMap;
    * An attempt at making an array of treemaps
    * @author (your name)
    * @version (a version number or a date)
    public class DefaultCatalogue
    private TreeMap[] defaultthing;
    * Constructor for objects of class DefaultCatalogue
    public DefaultGuitars()
    defaultthing = new TreeMap[4];
    bigInitialiser();
    private void bigInitialiser()
    defaultthing[1].put("Model: ","Les Paul Standard 2004");
    defaultthing[1].put("Brand: ","Gibson");
    defaultthing[1].put("Type: ","Electric");
    defaultthing[1].put("Factoryprice: ","�1200");
    defaultthing[1].put("Retailprice: ","�1900");
    defaultthing[1].put("Stock: ","2");
    I am using bluej, and the code above compiles without giving any errors. When i try to create an object of this class, however, I get a nullpointerexception at the line
    defaultthing[1].put("Model: ","Les Paul Standard 2004");
    I have tried something similar with hashmaps, but i get the same error when i try to create an object. Could someone please tell me what im doing wrong???
    Thanx in advance

    I implemented the solution u posted and figured i
    should have added the line marked *** below in
    defaultSpecsInitialiser()
    public void defaultSpecsInitialiser()
    specs[1] = new defaultspecifications();
    ions(); <-----------***
    specs[1].defaultbridge = "tuneomatic";
    This once again compiled properly but I also got an
    error when i attempted to create an object(this
    attempt, btw, lasted more than 15 seconds...).
    This time it was an error called
    "StackOverflowError".
    The program I used, bluej, was unable to provide me
    with any details about this error.
    Help will once again be very appreciatedPlease post in your own thread to avoid confusion:http://forum.java.sun.com/thread.jspa?threadID=604035&tstart=0Moreover, you should actually read the answers you are given!

  • How to loop through an associative array

    Guys,
    How to loop through an associative array. where the key is string but the value is an object
    -Thanks

    It depends if you are using a Java HashMap or a BPM Associative array. You'd use the "keySet" if for the former and the "keys" if it's the latter.
    I know you want an object for the array, but Any[String] is used here just so you can see something coming back in the display statements shown below. Remove the input and display statements - they're just in there so you can see something working.
    Here's how to go through a Hashmap's array using a loop:
    map as Java.Util.HashMap
    map.put(1, "One")
    map.put(2, "Two")
    map.put(3, "Three")
    map.put(4, "Four")
    map.put(5, "Five")
    display map.keySet
    for each item in keySet(map) do
         display item
         display get(map, arg1 : item)
    endHere's how to go through an associative array using a loop:
    hashMap as Any[String]
    hashMap = ["One": 1,"Two":2]
    for each item in hashMap.keys do
         display item
         display "Item in the array is: " + hashMap[item]
    endDan

  • Choosing the correct structure

    I'm a relative noob to Java, and am trying to store some attributes relating to table(s) i've loaded from the database.
    I need to be able to store data about the table columns. ie. ColumnLabel, columnStyle, displayColumn, columnHref, displayColumn etc...
    Initially I thought about a 2d Array of Hashmaps, where Array index one is the table number, and two is the column number. However I don't want to hardcode the max number of tables and/or columns.
    So I have looked at an ArrayList of Hashmaps, which would work nicely for a single table, and set of columns.
    My question is, because there are multiple tables being returned can I have an ArrayList of an ArrayList of Hashmaps? Anyone got any examples? Alternatively I am quite comfortable with having a max limit for the number of tables, as that will be fairly static in the Java, so would it be easier to have an Array of ArrayList of Hashmaps?
    Or am going off at a tangent completely? Thanks in advance for any answers.

    The tables are static I have a prepared statement for each, and then call a generic routine to turn them into xHTML table statements.
    The reason for this extra structure is to be able to apply further styling ie. Column Headers, URL's to the columns, decide whether to display columns or not.
    So the structure I was thinking of and that is needed would be:
    Table Fred (Table 1) // Array??
    Column 1 // ArrayList??
    Label "Column Name" // hashmap??
    URL "http:// ... " // hashmap
    Display = "true" // hashmap
    Column 2
    Label "Column Name 2"
    URL "http:// ... "
    Display = "true"
    Column 3
    Label "Column Name 3"
    URL "http:// ... "
    Display = "true"
    Table Bill (Table 2)
    Column 1
    Label "Column Name"
    URL "http:// ... "
    Display = "true"
    Column 2
    Label "Column Name 2"
    URL "http:// ... "
    Display = "true"
    Column 3
    Label "Column Name 3"
    URL "http:// ... "
    Display = "true"
    There won't be massive volumes of data, say 5 tables with 8 columns in each, I don't really like the idea of concatenating table name with column number, because I still need a hashmap for each, combination.

  • Enumeration mapping in message mapping

    I have a source structure ABC that contains two fields.  This structure needs to be transformed into two records that will store the field name of the source as well as the value.  It actually creates name/value pair in the target interface.  I wonder if message mapping could possibly handle that. 
    [Source]
    ABC
    ---FIELD_A = 123
    ---FIELD_B = 456
    [Target]
    DEF[0]
    ---NAME = "FIELD_A"
    ---VALUE = "123"
    DEF[1]
    ---NAME = "FIELD_B"
    ---VALUE = "456"
    Regards
    Chong Wah

    Hi Chong Wah,
    You can use the following java code to solve your problem using java mapping.
    * Created on Sep 14, 2005
    * To change the template for this generated file go to
    * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.util.HashMap;
    import java.util.Map;
    import java.util.Set;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.dom.DOMSource;
    import javax.xml.transform.stream.StreamResult;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    import com.sap.aii.mapping.api.StreamTransformation;
    * @author AnanthBabu Chinnaraj
    * To change the template for this generated type comment go to
    * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
    public class JavaMapping implements StreamTransformation {
         private Map map;
         private Document document;
         DOMSource domS = null;
         Document docOut = null;
         HashMap[] xmlData = null;
          * method setParamters is required, but we do not anything with it
         public void setParameter(Map param) {
              map = param;
          * method execute is called by the XI mapping program
         public void execute(InputStream in, OutputStream out) {
              HashMap[] xmlData = null;
              xmlData = parseInputXML(in);
              createOutputXML(xmlData[0], out);
         public static void main(String args[]) throws Exception {
              try {
                   JavaMapping mapObj = new JavaMapping();
                   FileInputStream in = new FileInputStream("D:/zAnanth/SDN/Src.xml");
                   FileOutputStream out =
                        new FileOutputStream("D:/zAnanth/SDN/Trgt.xml");
                   mapObj.execute(in, out);
              } catch (Exception e) {
                   e.printStackTrace();
          * method to process input xml
          * return array of HashMap for every 'ABC' tag
         public HashMap[] parseInputXML(InputStream in) {
              DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
              try {
                   String tagName = null;
                   String tagValue = null;
                   // create DOM structure from input XML
                   DocumentBuilder builder = factory.newDocumentBuilder();
                   document = builder.parse(in);
                   // look for the tag 'ABC'
                   NodeList list = document.getElementsByTagName("ABC");
                   //Initialize array size
                   xmlData = new HashMap[list.getLength()];
                   for (int i = 0; i < list.getLength(); i++) {
                        Node node = list.item(i);
                        //Initialize hashmap
                        xmlData<i> = new HashMap();
                        //Process Child nodes
                        NodeList childList = node.getChildNodes();
                        for (int j = 0; j < childList.getLength(); j++) {
                             Node childNode = childList.item(j);
                             if (childNode != null) {
                                  if (childNode.getNodeType() == Node.ELEMENT_NODE) {
                                       //Store tag name
                                       tagName = childNode.getNodeName();
                                       //System.out.println("Name  *:"+childNode.getNodeName());
                                       //Store tag value
                                       tagValue = processValueNode(childNode);
                                       //Store as name value pair
                                       xmlData<i>.put(tagName.toUpperCase(), tagValue);
              } catch (Exception e) {
                   e.printStackTrace();
              return xmlData;
         private String processValueNode(Node childNode) {
              String tagValue = null;
              NodeList valueNodesList = childNode.getChildNodes();
              Node valueNode = valueNodesList.item(0);
              if (valueNode != null) {
                   if (valueNode.getNodeType() == Node.TEXT_NODE) {
                        tagValue = valueNode.getNodeValue();
                        //System.out.println("Value #:"+valueNode.getNodeValue());
              return tagValue;
          * Method to create xml document from input hashmaps
          * return XML doc in InputStream
         public void createOutputXML(HashMap xmlData, OutputStream out) {
              try {
                   DocumentBuilderFactory factory =
                        DocumentBuilderFactory.newInstance();
                   TransformerFactory tf = TransformerFactory.newInstance();
                   Transformer transform = tf.newTransformer();
                   DocumentBuilder builder = factory.newDocumentBuilder();
                   //Create the output DOM
                   docOut = builder.newDocument();
                   //Create Top most Element
                   Element topRoot = docOut.createElementNS("http://XYZ", "ns:MT_ABC");
                   docOut.appendChild(topRoot);
                   Element defNode = null;
                   Set set = xmlData.keySet();
                   String[] tagNames = new String[set.size()];
                   set.toArray(tagNames);
                   for (int i = 0; i < tagNames.length; i++) {
                        defNode = createElement("DEF", topRoot);
                        createElement("Name", defNode, tagNames<i>);
                        createElement(
                             "Value",
                             defNode,
                             (String) xmlData.get(tagNames<i>));
                   //Process XML
                   domS = new DOMSource(docOut);
                   transform.transform((domS), new StreamResult(out));
              } catch (Exception e) {
                   e.printStackTrace();
         //Create an Element and add it into Parent
         private Element createElement(String elementName, Element parent) {
              Element ele = docOut.createElement(elementName);
              parent.appendChild(ele);
              return ele;
         //Create an Element and Text node and add it into Parent
         private Element createElement(
              String elementName,
              Element parent,
              String value) {
              Element ele = docOut.createElement(elementName);
              ele.appendChild(docOut.createTextNode(value));
              parent.appendChild(ele);
              return ele;
         //Get Values from Map, if value is null pass empty string
         private String getValue(HashMap map, String tagName) {
              String value = "";
              try {
                   value = (String) map.get(tagName);
                   if (value == null) {
                        value = "";
              } catch (Exception e) {
                   e.printStackTrace();
              return value;
    Regards,
    Ananth

  • Theory - Best way to store this type of data for retrieval?

    Hi everyone,
    So I'm pretty new to databases and I'm trying to figure out an efficient way to retrieve this kind of data:
    an ID that is 36 digits long
    col1 = {option1, option2, option3...}
    col2 = {option1, option2, option3...}
    coln = {option1, option2, option3...}
    I need to be able to perform queries on the data based on some concatenation of 3 digit sequences for the ID
    for example, I may want to retrieve all the records where the ID begins with '123' or where the ID begins with '123123', or '123123200', etc,
    There are going to be close to a billion if not more of these records
    the 3 digit sequences will always be a number between 000-255
    It is not necessary for me to have a 36 digit long ID, I simply chose that because it seemed like the simplest way to associate a record with its combination of 3 digit sequences.
    Like I said, I'm very new to databases. I've been doing a lot of reading on indexing and clustering and nested tables and partitions, but I'm not quite sure which of these I should pursue with this kind of data. Most of the examples that I've read about don't really deal about querying with variable precision.
    Would the best way to get this data simply be to use an 'is like' statement on the ID? If so, are there any kinds of indexing I should take a look at that would benefit from knowing that the is like statements would follow the format of <3 digits,3 digits,3 digits>? Also, at the data level, would it be more efficient to use hexadecimal to store the sequences of 3 digits since they conviently fall in the range of 00-FF? I'm just throwing ideas out there, I haven't found much help browsing the web, but maybe I haven't looked in the right place. If anyone has any ideas or places to redirect me, it would be great!
    Also, I know sometimes it helps to know the main kind of queries on the data that someone is primarily concerned about. In this case, most queries will be selective counts, for example finding the number of records whose ID's begin with '123006011' and col1='option1'.
    Thanks,
    Alex
    Edited by: user9022475 on Jun 23, 2010 9:37 AM

    So I'm starting to rewrite my code. I was shocked at how easy it was to implement the SAX parser, but it works great. Now I'm on to doing away with my nasty string arrays.
    Of course, the basic layout of the XML is like this:
    <result1>
    <element1>value</element1>
    <element2>value</element2>
    </result1>
    <result2>
    I thought about storing each element/value in a HashMap for each result. This works great for a single result. But what if I have 1000 results? Do I store 1000 HashMaps in an ArrayList (if that's even possible)? Is there a way to define an array of HashMaps?

  • Best way to store large amounts of data

    Greetings!
    I have some code that will parse through XML data one character at a time, determine if it's an opening or closing tag, what the tag name is, and what the value between the tags is. All of the results are saved in a 2D string array. Each parent result can have a variable number of child results associated with it and it is possible to have over 2,000 parent results.
    Currently, I initialize a new string that I will use to store the values at the beginning of the method.
    String[][] initialXMLValues = new String[2000][45]I have no idea how many results will actually be returned when the method is initially called, so I don't know what to do besides make initialXMLValues around the maximum values I expect to have.
    As I parse through the XML, I look for a predefined tag that signifies the start of a result. Each tag/value that follows is stored in a single element of an arraylist in the form "tagname,value". When I reach the closing parent tag, I convert the arraylist to a String[], store the size of the array if it is bigger than the previous array (to track the maximum size of the child results), store it in initialXMLValues[i.] (<- peroid to avoid post showing up in italics), then increment i
    When I'm all done parsing, I create a new String String[][] XMLValues = new String[i][j], where i is equal to the total number of parent results (from last paragraph) and j is equal to the maximum number of child results. I then use a nested for loop to store all of the values from initialXMLValues into XMLValues. The whole point of this is to minimize the overall size of the returned String Array and minimize the number of null valued fields.
    I know this is terribly inefficient, but I don't know a better way to do it. The problem is having to have the size of the array initilized before I really know how many results I'm going to end up storing. Is there a better way to do this?

    So I'm starting to rewrite my code. I was shocked at how easy it was to implement the SAX parser, but it works great. Now I'm on to doing away with my nasty string arrays.
    Of course, the basic layout of the XML is like this:
    <result1>
    <element1>value</element1>
    <element2>value</element2>
    </result1>
    <result2>
    I thought about storing each element/value in a HashMap for each result. This works great for a single result. But what if I have 1000 results? Do I store 1000 HashMaps in an ArrayList (if that's even possible)? Is there a way to define an array of HashMaps?

  • Need a good Data Structure/ Algorithm

    I am working on a small problem that requires me to cache a large amount of key/value pairs of data. I must then do a lookup on the cache for a large number of words one after another until I find a word that is present as a Key and then quit.
    The cache is pretty large. About 600 - 1000 words as keys and ints as values.
    Is there an existing Data Structure in Java for this? If not, what type of data structure (B-tree etc) is best suited to cache such data and what algorithm should be used for lookup?

    The lookup for hashmap is efficient for very large maps up to the amount of memory you have. If you tune the load factor you can minimise the impact of having very large tables.
    Another option is to have a fixed array of HashMaps. You can use the hashcode (or your own) to put the key, value into the HashMap. I am not sure if this is actaully any faster, as I believe one is enough, but if you have concern this is what you can do.

  • Transfering Table data from one page to another page in OAF

    Hi All,
    Could you please help me with the following requirement. I am trying to transfer the first page selected records to second page, but running into issue.
    I have 2 custom OAF pages:
    1st Page is Invoice Search page and upon searching for an invoice, user can select 'multi records' (its table region with multi-select) and click on upload button.
    The button internally calls setForwardUrl method and calls 2nd page, where second page contains Advacned Table region to show the selected records from 1st page.
    Since user can select more than 1 record in Search region on first page, I would like to hold all rows in an array of Hashmap with Integer index and transfer it to 2nd page. Following is the hashmap syntax I am using:
    java.util.HashMap<Integer,InvoiceRow> map=new <Integer,InvoiceRow>(); // Here InvoiceRow is a custom CLASS structure with InvoiceNumber and Customer Number as variables inside.
    But if I pass the above HashMap to setForwardURL method, the JDeveloper throwing an exception saying that "setForwardURL cannot invoke" message.
    Could you please help me how can I transfer the first page multiselected records to second page?
    Appreciate your time.
    -- Venkat

    Venket, the approach i told you can try in below way:
    public String getSelectedData()
            String whereclause = "(";
           // String whereclause1 = "(";
         XXCONTAINLINESVOImpl vo = this.getXXCONTAINLINESVO1();
          //OAViewObject vo=(OAViewObject)getXXDPECONTAINLINESVO1();
          // System.out.println("debTEST"+punload);
           Row[] sumVoRow =vo.getFilteredRows("Select1", "Y");
            System.out.println("deb multi select test"+sumVoRow.length);
        if (sumVoRow != null && sumVoRow.length > 0)
         for (int i = 0; i < sumVoRow.length; i++) {
                  String wipEntityId =
                  sumVoRow[i].getAttribute("LineId").toString();             
                  whereclause = whereclause+sumVoRow[i].getAttribute("LineId").toString()+",";
                System.out.println("deb multi select test"+whereclause);
            if (whereclause.length() > 0 && whereclause.charAt(whereclause.length()-1)==',')
                 StringBuilder b = new StringBuilder(whereclause);
                 b.replace(whereclause.lastIndexOf(","), whereclause.lastIndexOf(",") + 1, ")" );
                 whereclause = b.toString();
               //  return whereclause;          
            System.out.println("deb where clause test"+whereclause);
        return whereclause;
    so this method will return the value as like : whereclause=(111,222,333) then put this in one session varibale and pass to the below method from CO
        public void processPOData (String wherclause)
            String query = getXXDPECONTAINDATAVO1().getQuery();//Old queryStringBuffer stringbuffer = new StringBuffer();
                      String newwhereclause ="LINE.LINE_ID IN "+wherclause;
                        System.out.println("DEB NEW where clause:"+newwhereclause);
                         StringBuffer stringbuffer = new StringBuffer();  
                       // stringbuffer.append("SELECT rownum LINE_NUM,A.* FROM (");
                        stringbuffer.append(query);
                        stringbuffer.append("  where ");
                       stringbuffer.append(newwhereclause);
                        ViewDefImpl viewdefimpl = getXXDPECONTAINDATAVO1().getViewDefinition();
                        viewdefimpl.setQuery(stringbuffer.toString());
                        System.out.println("DEB NEW QUERY TEST:"+stringbuffer.toString());
                        getXXDPECONTAINDATAVO1().executeQuery();
    Let me know if stil r u facing isssue
    Thnaks
    Deb

  • How to reconcile deleted users with GTC

    Hi all,
    I'm wandering wich is the best approach to perform reconciliation of deleted users using GTC connector. (It doesn't concile it by default, does it?).
    I don't know if it's a bad idea to mark the deletion in the target table row (setting a value in a column) and revoke the user through an Entity Adapter. Should it be better to develop a custom Scheduled Task for this?
    Any tip will be considered!
    Thanks in advance,

    Hi,
    Yes I run both Schedule task as "time-programmed" . I usually run creation task first and then it is followed by delete recon task.
    I am not fully understanding what do you mean by starting GTC generated task automatically? Please give me more insight before I comment on this.
    For delete recon you need to do following
    HashMap userValues[];
    userValues = null;
    userValues=createDeleteHashMap(results);
    Set deletedAcc = reconUtil.provideDeletionDetectionData(resourceObject, userValues);
    missingUser = reconUtil.getMissingAccounts(resourceObject, deletedAcc);
    long reconEvent[] = reconUtil.deleteDetectedAccounts(missingUser);
    Here userValues is array of Hashmap which have all the non revoked user.
    So your steps should be.
    1.Query the table wich store all active users and store them in an array of hashmap
    2.Pass it to provideDeletionDetectionData method.
    3.pass step 2 result set to getMissingAccounts method.
    4.Pass step 3 result set to deleteDetectedAccounts.
    Alternatively you do following.If in your query you can find out which user is deleted and if you are oim9.1 then follow these steps.
    1.Query the table and get revoked/deleted user and store then in a hashmap.
    2.Use createDeleteReconciliationEvent(java.lang.String psObjName, java.util.Map poAttributeList) to create the delete reconciliation event.
    First approach is bit risky because if somehow in your table or view all the record are delete or revoked or by any error GTC connector did not find any record then it will revoked all the user from OIM which can lead to disaster as you are doing trusted recon.
    Please let me know if you have any more questions.
    Regards
    Nitesh

  • How do i call the name of this object?

    Hey
    As the code functions now it prints out the numbers that i set in the HashMap (1,2,3,4). How do i get it to print getName() of the object from Disciplin class?
    i tried this: array.add(disciplin2.getName(disciplin));
    but that gives me this error:
    getName() in Disciplin cannot be applied to (java.lang.String)
    I hope you guys can help me out.
    public class GetDisciplin
         private ArrayList array;
         private HashMap<String, Disciplin> disciplins;
         private Disciplin disciplin2;
          * Constructor for objects of class GetDisciplin
         public GetDisciplin()
              disciplins = new HashMap<String, Disciplin>();
              enterNewDisciplin();
              array = new ArrayList();
          * An example of a method - replace this comment with your own
          * @param  y   a sample parameter for a method
          * @return     the sum of x and y
         public void enterNewDisciplin()
              disciplins.put("1", new Disciplin("Bryst sv�mning"));
              disciplins.put("2", new Disciplin("Kr�l"));
              disciplins.put("3", new Disciplin("Ryg sv�mning"));
              disciplins.put("4", new Disciplin("Butterfly"));
         public ArrayList showAllDisciplins()
            Set<String> keys = disciplins.keySet();
            for(String disciplin : keys)
                array.add(disciplin);  
            return array;
    }

    Just use values() instead of keySet() on the map. e.g.
    for(Disciplin d : disciplins.values())
         array.add(d.getName());

Maybe you are looking for

  • Why are my songs not numbered?

    why are my songs not numbered?

  • CS5: File size issue?!

    I am currently trying Photoshop CS5 and found some issues regarding memory and file size. One issue shows up as following: Opened a 21MP photo via Camera Raw as Smart Object, used Noise Reduction Filter and saved this one Layer image as PSD without m

  • I accidentally deleted both of my catalogs!

    In my New Years' organizing spree today, I decided to split my Lightroom catalog into two separate catalogs.  I didn't see an efficient way of doing this, so what I did was copy my entire catalog into a new catalog, and then I deleted (from disk) the

  • Loading all website links in one window

    Does anyone know how to capture / prevent links from opening a new window in Air? I am an ajax developer and I have several sites that load in an iframe in my air application. One of the sites has links that open in a new window. Is there anyway to k

  • MM SUS - Consignment Purchase Order

    Hi Are consignment POs supported in the MM-SUS scenario? I have tried creating a PO with item category K and the XML fails in SUS. Any suggestions? We are on ECC 604 and SRM 7.0