@Test @Override public void testGetParentObject() throws SQLException { assertThat("testGetParentObject 0", bs.getParentObject(), nullValue()); }
public DSpaceObject getParentObject() throws SQLException { Bundle[] bundles = getBundles(); if (bundles != null && (bundles.length > 0 && bundles[0] != null)) { Item[] items = bundles[0].getItems(); if (items != null && items.length > 0) { return items[0]; } else { return null; } } else { TableRow qResult = DatabaseManager.querySingle(bContext, "SELECT collection_id FROM collection " + "WHERE logo_bitstream_id = ?",getID()); if (qResult != null) { return Collection.find(bContext,qResult.getIntColumn("collection_id")); } else { qResult = DatabaseManager.querySingle(bContext, "SELECT community_id FROM community " + "WHERE logo_bitstream_id = ?",getID()); if (qResult != null) { return Community.find(bContext,qResult.getIntColumn("community_id")); } else { return null; } } } }
Bitstream extends DSpaceObject { public DSpaceObject getParentObject() throws SQLException { Bundle[] bundles = getBundles(); if (bundles != null && (bundles.length > 0 && bundles[0] != null)) { Item[] items = bundles[0].getItems(); if (items != null && items.length > 0) { return items[0]; } else { return null; } } else { TableRow qResult = DatabaseManager.querySingle(bContext, "SELECT collection_id FROM collection " + "WHERE logo_bitstream_id = ?",getID()); if (qResult != null) { return Collection.find(bContext,qResult.getIntColumn("collection_id")); } else { qResult = DatabaseManager.querySingle(bContext, "SELECT community_id FROM community " + "WHERE logo_bitstream_id = ?",getID()); if (qResult != null) { return Community.find(bContext,qResult.getIntColumn("community_id")); } else { return null; } } } } }
Bitstream extends DSpaceObject { public DSpaceObject getParentObject() throws SQLException { Bundle[] bundles = getBundles(); if (bundles != null && (bundles.length > 0 && bundles[0] != null)) { Item[] items = bundles[0].getItems(); if (items != null && items.length > 0) { return items[0]; } else { return null; } } else { TableRow qResult = DatabaseManager.querySingle(bContext, "SELECT collection_id FROM collection " + "WHERE logo_bitstream_id = ?",getID()); if (qResult != null) { return Collection.find(bContext,qResult.getIntColumn("collection_id")); } else { qResult = DatabaseManager.querySingle(bContext, "SELECT community_id FROM community " + "WHERE logo_bitstream_id = ?",getID()); if (qResult != null) { return Community.find(bContext,qResult.getIntColumn("community_id")); } else { return null; } } } } Bitstream(Context context, TableRow row); }
Bitstream extends DSpaceObject { public DSpaceObject getParentObject() throws SQLException { Bundle[] bundles = getBundles(); if (bundles != null && (bundles.length > 0 && bundles[0] != null)) { Item[] items = bundles[0].getItems(); if (items != null && items.length > 0) { return items[0]; } else { return null; } } else { TableRow qResult = DatabaseManager.querySingle(bContext, "SELECT collection_id FROM collection " + "WHERE logo_bitstream_id = ?",getID()); if (qResult != null) { return Collection.find(bContext,qResult.getIntColumn("collection_id")); } else { qResult = DatabaseManager.querySingle(bContext, "SELECT community_id FROM community " + "WHERE logo_bitstream_id = ?",getID()); if (qResult != null) { return Community.find(bContext,qResult.getIntColumn("community_id")); } else { return null; } } } } Bitstream(Context context, TableRow row); static Bitstream find(Context context, int id); static Bitstream[] findAll(Context context); int getID(); String getHandle(); int getSequenceID(); void setSequenceID(int sid); String getName(); void setName(String n); String getSource(); void setSource(String n); String getDescription(); void setDescription(String n); String getChecksum(); String getChecksumAlgorithm(); long getSize(); void setUserFormatDescription(String desc); String getUserFormatDescription(); String getFormatDescription(); BitstreamFormat getFormat(); void setFormat(BitstreamFormat f); void update(); InputStream retrieve(); Bundle[] getBundles(); int getType(); boolean isRegisteredBitstream(); int getStoreNumber(); DSpaceObject getParentObject(); }
Bitstream extends DSpaceObject { public DSpaceObject getParentObject() throws SQLException { Bundle[] bundles = getBundles(); if (bundles != null && (bundles.length > 0 && bundles[0] != null)) { Item[] items = bundles[0].getItems(); if (items != null && items.length > 0) { return items[0]; } else { return null; } } else { TableRow qResult = DatabaseManager.querySingle(bContext, "SELECT collection_id FROM collection " + "WHERE logo_bitstream_id = ?",getID()); if (qResult != null) { return Collection.find(bContext,qResult.getIntColumn("collection_id")); } else { qResult = DatabaseManager.querySingle(bContext, "SELECT community_id FROM community " + "WHERE logo_bitstream_id = ?",getID()); if (qResult != null) { return Community.find(bContext,qResult.getIntColumn("community_id")); } else { return null; } } } } Bitstream(Context context, TableRow row); static Bitstream find(Context context, int id); static Bitstream[] findAll(Context context); int getID(); String getHandle(); int getSequenceID(); void setSequenceID(int sid); String getName(); void setName(String n); String getSource(); void setSource(String n); String getDescription(); void setDescription(String n); String getChecksum(); String getChecksumAlgorithm(); long getSize(); void setUserFormatDescription(String desc); String getUserFormatDescription(); String getFormatDescription(); BitstreamFormat getFormat(); void setFormat(BitstreamFormat f); void update(); InputStream retrieve(); Bundle[] getBundles(); int getType(); boolean isRegisteredBitstream(); int getStoreNumber(); DSpaceObject getParentObject();  }