formatidentifier table renamed to fileextension.

git-svn-id: http://scm.dspace.org/svn/repo/trunk@274 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
Robert Tansley
2002-08-15 18:12:27 +00:00
parent fa7faf6c55
commit 992de42a17
3 changed files with 10 additions and 10 deletions

View File

@@ -65,11 +65,11 @@ CREATE TABLE BitstreamFormatRegistry
);
-------------------------------------------------------
-- FormatIdentifier table
-- FileExtension table
-------------------------------------------------------
DROP TABLE FormatIdentifier;
DROP TABLE FileExtension;
CREATE TABLE FormatIdentifier
CREATE TABLE FileExtension
(
id INTEGER PRIMARY KEY,
bitstream_format_id INTEGER REFERENCES BitstreamFormatRegistry(bitstream_format_id),

View File

@@ -113,7 +113,7 @@ public class BitstreamFormat
extensions = new ArrayList();
TableRowIterator tri = DatabaseManager.query(context,
"SELECT * FROM formatidentifier WHERE bitstream_format_id=" +
"SELECT * FROM fileextension WHERE bitstream_format_id=" +
getID());
while (tri.hasNext())
@@ -496,14 +496,14 @@ public class BitstreamFormat
// Delete extensions
DatabaseManager.updateQuery(bfContext,
"DELETE FROM formatidentifier WHERE bitstream_format_id=" +
"DELETE FROM fileextension WHERE bitstream_format_id=" +
getID());
// Rewrite extensions
for (int i = 0; i < extensions.size(); i++)
{
String s = (String) extensions.get(i);
TableRow r = DatabaseManager.create(bfContext, "formatidentifier");
TableRow r = DatabaseManager.create(bfContext, "fileextension");
r.setColumn("bitstream_format_id", getID());
r.setColumn("extension", s);
DatabaseManager.update(bfContext, r);
@@ -540,7 +540,7 @@ public class BitstreamFormat
// Delete extensions
DatabaseManager.updateQuery(bfContext,
"DELETE FROM formatidentifier WHERE bitstream_format_id=" +
"DELETE FROM fileextension WHERE bitstream_format_id=" +
getID());
// Delete this format from database

View File

@@ -103,12 +103,12 @@ public class FormatIdentifier
return null;
}
// See if the extension is in the FormatIdentifier table
// See if the extension is in the fileextension table
TableRowIterator tri = DatabaseManager.query(context,
"SELECT bitstreamformatregistry.* FROM bitstreamformatregistry, " +
"formatidentifier WHERE formatidentifier.extension LIKE '" +
"fileextension WHERE fileextension.extension LIKE '" +
extension +"' AND bitstreamformatregistry.bitstream_format_id=" +
"formatidentifier.bitstream_format_id");
"fileextension.bitstream_format_id");
if (tri.hasNext())
{