Christoph Kiehl-3 wrote:
> 
> Michal Hybler wrote:
>> I have question is the property jcr:uuid same as node.getUUID()?
>> 
>> because if I ask for uuid by this method node.getUUID() and after that If
>> I
>> request for UUID by this way:
>> 
>> HashMap<String,String> properties = new HashMap<String,String>();
>>              
>>                      PropertyIterator iter = node.getProperties();
>>                      while(iter.hasNext()){
>>                              Property prop = iter.nextProperty();
>>                              if (!prop.getDefinition().isMultiple()) {
>>                                      properties.put(prop.getName(), 
>> prop.getValue().getString());
>>                              }
>>                              
>>                      }
> 
> Could you please provide more of your source code, especially the part
> where you 
> call node.getUUID() and the part where your console output happens?
> 
> Thanks,
> Christoph
> 
> 
> 
> 

I have this method 

                        ws = session.getWorkspace();
                        manager = ws.getQueryManager();
                        query = manager.createQuery("select * from 
nt:unstructured where jcr:uuid
= '"+id+"'",Query.SQL);
                        QueryResult result = query.execute();
                        NodeIterator it = result.getNodes();
                        return it.nextNode(); 
with Id which I remembered when I insert file into jackrabbit.

after that I run this code

HashMap<String,String> properties = new HashMap<String,String>();
                try {
                        PropertyIterator iter = node.getProperties();
                        while(iter.hasNext()){
                                Property prop = iter.nextProperty();
                                if (!prop.getDefinition().isMultiple()) {
                                        properties.put(prop.getName(), 
prop.getValue().getString());
                                }
                                
                        }
                        if (getResNode(node) != null) {
                                Node resNode = getResNode(node);
                                iter = resNode.getProperties();
                                while(iter.hasNext()){
                                        Property prop = iter.nextProperty();
                                        if (!prop.getDefinition().isMultiple()) 
{
                                                properties.put(prop.getName(), 
prop.getValue().getString());
                                        }
                                }
                        }
                } catch (RepositoryException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                }

and write map on console

Set keys = properties.keySet();
                Iterator iter = keys.iterator();
                while (iter.hasNext()) {
                        String key = (String) iter.next();
                        String value = properties.get(key);
                        System.out.println("property "+key+" with value 
"+value);
                } 


UUID which this code writes on the console is distinct from id which I
insert on the start of code. If I insert This id which is shown on the
console the repository returns no file.

-- 
View this message in context: http://www.nabble.com/UUID-tf3448236.html#a9618986
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Reply via email to