@Test public void testFindByMetadataField() throws Exception { String schema = "dc"; String element = "contributor"; String qualifier = "author"; String value = "value"; Iterator<Item> result = itemService.findByMetadataField(context, schema, element, qualifier, value); assertThat("testFindByMetadataField 0", result, notNullValue()); assertFalse("testFindByMetadataField 1", result.hasNext()); context.turnOffAuthorisationSystem(); itemService.addMetadata(context, it, schema, element, qualifier, Item.ANY, value); itemService.update(context, it); context.restoreAuthSystemState(); result = itemService.findByMetadataField(context, schema, element, qualifier, value); assertThat("testFindByMetadataField 3", result, notNullValue()); assertTrue("testFindByMetadataField 4", result.hasNext()); assertTrue("testFindByMetadataField 5", result.next().equals(it)); }
@Override public boolean equals(Object obj) { if (obj == null) { return false; } Class<?> objClass = HibernateProxyHelper.getClassWithoutInitializingProxy(obj); if (this.getClass() != objClass) { return false; } final Item otherItem = (Item) obj; if (!this.getID().equals(otherItem.getID())) { return false; } return true; }
Item extends DSpaceObject implements DSpaceObjectLegacySupport { @Override public boolean equals(Object obj) { if (obj == null) { return false; } Class<?> objClass = HibernateProxyHelper.getClassWithoutInitializingProxy(obj); if (this.getClass() != objClass) { return false; } final Item otherItem = (Item) obj; if (!this.getID().equals(otherItem.getID())) { return false; } return true; } }
Item extends DSpaceObject implements DSpaceObjectLegacySupport { @Override public boolean equals(Object obj) { if (obj == null) { return false; } Class<?> objClass = HibernateProxyHelper.getClassWithoutInitializingProxy(obj); if (this.getClass() != objClass) { return false; } final Item otherItem = (Item) obj; if (!this.getID().equals(otherItem.getID())) { return false; } return true; } protected  Item(); }
Item extends DSpaceObject implements DSpaceObjectLegacySupport { @Override public boolean equals(Object obj) { if (obj == null) { return false; } Class<?> objClass = HibernateProxyHelper.getClassWithoutInitializingProxy(obj); if (this.getClass() != objClass) { return false; } final Item otherItem = (Item) obj; if (!this.getID().equals(otherItem.getID())) { return false; } return true; } protected  Item(); boolean isArchived(); boolean isWithdrawn(); boolean isDiscoverable(); Date getLastModified(); void setLastModified(Date lastModified); void setArchived(boolean isArchived); void setDiscoverable(boolean discoverable); void setOwningCollection(Collection c); Collection getOwningCollection(); EPerson getSubmitter(); void setSubmitter(EPerson sub); List<Collection> getCollections(); void clearCollections(); Collection getTemplateItemOf(); List<Bundle> getBundles(); List<Bundle> getBundles(String name); @Override boolean equals(Object obj); @Override int hashCode(); @Override int getType(); @Override String getName(); @Override Integer getLegacyId(); ItemService getItemService(); }
Item extends DSpaceObject implements DSpaceObjectLegacySupport { @Override public boolean equals(Object obj) { if (obj == null) { return false; } Class<?> objClass = HibernateProxyHelper.getClassWithoutInitializingProxy(obj); if (this.getClass() != objClass) { return false; } final Item otherItem = (Item) obj; if (!this.getID().equals(otherItem.getID())) { return false; } return true; } protected  Item(); boolean isArchived(); boolean isWithdrawn(); boolean isDiscoverable(); Date getLastModified(); void setLastModified(Date lastModified); void setArchived(boolean isArchived); void setDiscoverable(boolean discoverable); void setOwningCollection(Collection c); Collection getOwningCollection(); EPerson getSubmitter(); void setSubmitter(EPerson sub); List<Collection> getCollections(); void clearCollections(); Collection getTemplateItemOf(); List<Bundle> getBundles(); List<Bundle> getBundles(String name); @Override boolean equals(Object obj); @Override int hashCode(); @Override int getType(); @Override String getName(); @Override Integer getLegacyId(); ItemService getItemService(); static final String ANY; }