Issue 15623

Iterate over multiple instances of DarwinCoreRecord

15623
Reporter: mdoering
Assignee: mdoering
Type: NewFeature
Summary: Iterate over multiple instances of DarwinCoreRecord
Priority: Major
Resolution: Fixed
Status: Closed
Created: 2014-05-19 10:42:18.3
Updated: 2015-03-09 13:28:30.152
Resolved: 2015-03-09 13:28:30.129
        
Description: Moved from https://code.google.com/p/darwincore/issues/detail?id=157

----
The current version of the DarwinCoreRecord does not allow multiple instances of darwincorerecord.

For example. if an archive is read into a vector, only the last record can be accessed and the others seem to be cleared.

Unless, I am missing something, or using this wrong? I would like to have access to all records in a file at once.
----
Jul 17, 2012 #1 wixner
That is right. Its definitely lacking documentation.
The same instance if reused for performance reasons and if you want to keep them you would need to make a copy first.

We should improve this and add options to always get a new instance. Ill keep this issue as a feature request?
----
Jul 17, 2012 #2 encima
That would be great. I found that even making a copy does not allow multiple instances, for example it is not possible to create a vector of records. It appears that the record does not implement cloneable so I cannot copy it to another object without calling all methods.

Would love to see it as a feature, added to the Jar though please!
----
Jul 17, 2012  #3 wixner
thats right. But you can use tools like beanutils to do the copy for you, for example: http://commons.apache.org/beanutils/api/org/apache/commons/beanutils/PropertyUtils.html

Of course it would be more convenient to not have to do this - should be added to the next release!]]>
    


Author: mdoering@gbif.org
Comment: https://github.com/gbif/dwca-reader/commit/e8cb45c6c88b53fafa1c8c03b7dbe97f86faba5f
Created: 2015-03-09 13:28:30.149
Updated: 2015-03-09 13:28:30.149