mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-18 07:23:08 +00:00
DS-2248 Ensure that DSpaceObject subclasses create typed TableRows when instantiated.
This commit is contained in:
@@ -39,11 +39,11 @@ import org.dspace.storage.rdbms.TableRowIterator;
|
|||||||
public class Bitstream extends DSpaceObject
|
public class Bitstream extends DSpaceObject
|
||||||
{
|
{
|
||||||
/** log4j logger */
|
/** log4j logger */
|
||||||
private static Logger log = Logger.getLogger(Bitstream.class);
|
private static final Logger log = Logger.getLogger(Bitstream.class);
|
||||||
|
|
||||||
|
|
||||||
/** The row in the table representing this bitstream */
|
/** The row in the table representing this bitstream */
|
||||||
private TableRow bRow;
|
private final TableRow bRow;
|
||||||
|
|
||||||
/** The bitstream format corresponding to this bitstream */
|
/** The bitstream format corresponding to this bitstream */
|
||||||
private BitstreamFormat bitstreamFormat;
|
private BitstreamFormat bitstreamFormat;
|
||||||
@@ -64,6 +64,11 @@ public class Bitstream extends DSpaceObject
|
|||||||
Bitstream(Context context, TableRow row) throws SQLException
|
Bitstream(Context context, TableRow row) throws SQLException
|
||||||
{
|
{
|
||||||
super(context);
|
super(context);
|
||||||
|
|
||||||
|
// Ensure that my TableRow is typed.
|
||||||
|
if (null == row.getTable())
|
||||||
|
row.setTable("bitstream");
|
||||||
|
|
||||||
bRow = row;
|
bRow = row;
|
||||||
|
|
||||||
// Get the bitstream format
|
// Get the bitstream format
|
||||||
|
@@ -40,10 +40,10 @@ import org.dspace.storage.rdbms.TableRowIterator;
|
|||||||
public class Bundle extends DSpaceObject
|
public class Bundle extends DSpaceObject
|
||||||
{
|
{
|
||||||
/** log4j logger */
|
/** log4j logger */
|
||||||
private static Logger log = Logger.getLogger(Bundle.class);
|
private static final Logger log = Logger.getLogger(Bundle.class);
|
||||||
|
|
||||||
/** The table row corresponding to this bundle */
|
/** The table row corresponding to this bundle */
|
||||||
private TableRow bundleRow;
|
private final TableRow bundleRow;
|
||||||
|
|
||||||
/** The bitstreams in this bundle */
|
/** The bitstreams in this bundle */
|
||||||
private List<Bitstream> bitstreams;
|
private List<Bitstream> bitstreams;
|
||||||
@@ -62,6 +62,11 @@ public class Bundle extends DSpaceObject
|
|||||||
Bundle(Context context, TableRow row) throws SQLException
|
Bundle(Context context, TableRow row) throws SQLException
|
||||||
{
|
{
|
||||||
super(context);
|
super(context);
|
||||||
|
|
||||||
|
// Ensure that my TableRow is typed.
|
||||||
|
if (null == row.getTable())
|
||||||
|
row.setTable("bundle");
|
||||||
|
|
||||||
bundleRow = row;
|
bundleRow = row;
|
||||||
bitstreams = new ArrayList<Bitstream>();
|
bitstreams = new ArrayList<Bitstream>();
|
||||||
String bitstreamOrderingField = ConfigurationManager.getProperty("webui.bitstream.order.field");
|
String bitstreamOrderingField = ConfigurationManager.getProperty("webui.bitstream.order.field");
|
||||||
|
@@ -42,10 +42,10 @@ import java.util.*;
|
|||||||
public class Community extends DSpaceObject
|
public class Community extends DSpaceObject
|
||||||
{
|
{
|
||||||
/** log4j category */
|
/** log4j category */
|
||||||
private static Logger log = Logger.getLogger(Community.class);
|
private static final Logger log = Logger.getLogger(Community.class);
|
||||||
|
|
||||||
/** The table row corresponding to this item */
|
/** The table row corresponding to this item */
|
||||||
private TableRow communityRow;
|
private final TableRow communityRow;
|
||||||
|
|
||||||
/** The logo bitstream */
|
/** The logo bitstream */
|
||||||
private Bitstream logo;
|
private Bitstream logo;
|
||||||
@@ -76,6 +76,11 @@ public class Community extends DSpaceObject
|
|||||||
Community(Context context, TableRow row) throws SQLException
|
Community(Context context, TableRow row) throws SQLException
|
||||||
{
|
{
|
||||||
super(context);
|
super(context);
|
||||||
|
|
||||||
|
// Ensure that my TableRow is typed.
|
||||||
|
if (null == row.getTable())
|
||||||
|
row.setTable("community");
|
||||||
|
|
||||||
communityRow = row;
|
communityRow = row;
|
||||||
|
|
||||||
// Get the logo bitstream
|
// Get the logo bitstream
|
||||||
|
@@ -66,7 +66,7 @@ public class Item extends DSpaceObject
|
|||||||
private static final Logger log = Logger.getLogger(Item.class);
|
private static final Logger log = Logger.getLogger(Item.class);
|
||||||
|
|
||||||
/** The table row corresponding to this item */
|
/** The table row corresponding to this item */
|
||||||
private TableRow itemRow;
|
private final TableRow itemRow;
|
||||||
|
|
||||||
/** The e-person who submitted this item */
|
/** The e-person who submitted this item */
|
||||||
private EPerson submitter;
|
private EPerson submitter;
|
||||||
@@ -96,6 +96,11 @@ public class Item extends DSpaceObject
|
|||||||
Item(Context context, TableRow row) throws SQLException
|
Item(Context context, TableRow row) throws SQLException
|
||||||
{
|
{
|
||||||
super(context);
|
super(context);
|
||||||
|
|
||||||
|
// Ensure that my TableRow is typed.
|
||||||
|
if (null == row.getTable())
|
||||||
|
row.setTable("item");
|
||||||
|
|
||||||
itemRow = row;
|
itemRow = row;
|
||||||
modified = false;
|
modified = false;
|
||||||
clearDetails();
|
clearDetails();
|
||||||
|
@@ -77,6 +77,11 @@ public class EPerson extends DSpaceObject
|
|||||||
*/
|
*/
|
||||||
EPerson(Context context, TableRow row) throws SQLException {
|
EPerson(Context context, TableRow row) throws SQLException {
|
||||||
super(context);
|
super(context);
|
||||||
|
|
||||||
|
// Ensure that my TableRow is typed.
|
||||||
|
if (null == row.getTable())
|
||||||
|
row.setTable("eperson");
|
||||||
|
|
||||||
myRow = row;
|
myRow = row;
|
||||||
|
|
||||||
// Cache ourselves
|
// Cache ourselves
|
||||||
|
@@ -78,6 +78,11 @@ public class Group extends DSpaceObject
|
|||||||
Group(Context context, TableRow row) throws SQLException
|
Group(Context context, TableRow row) throws SQLException
|
||||||
{
|
{
|
||||||
super(context);
|
super(context);
|
||||||
|
|
||||||
|
// Ensure that my TableRow is typed.
|
||||||
|
if (null == row.getTable())
|
||||||
|
row.setTable("epersongroup");
|
||||||
|
|
||||||
myRow = row;
|
myRow = row;
|
||||||
|
|
||||||
// Cache ourselves
|
// Cache ourselves
|
||||||
|
Reference in New Issue
Block a user