~ubuntu-branches/ubuntu/quantal/shotwell/quantal

« back to all changes in this revision

Viewing changes to plugins/shotwell-data-imports/FSpotPhotoTagsTable.vala

  • Committer: Package Import Robot
  • Author(s): Robert Ancell
  • Date: 2012-02-21 13:52:58 UTC
  • mto: This revision was merged to the branch mainline in revision 47.
  • Revision ID: package-import@ubuntu.com-20120221135258-ao9jiib5qicomq7q
Tags: upstream-0.11.92
ImportĀ upstreamĀ versionĀ 0.11.92

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright 2011 Yorba Foundation
 
2
 *
 
3
 * This software is licensed under the GNU Lesser General Public License
 
4
 * (version 2.1 or later).  See the COPYING file in this distribution. 
 
5
 */
 
6
 
 
7
namespace DataImports.FSpot.Db {
 
8
 
 
9
/**
 
10
 * The value object for the "photo_tags" table, representing a single database row.
 
11
 */
 
12
public class FSpotPhotoTagRow : Object {
 
13
    public int64 photo_id;
 
14
    public int64 tag_id;
 
15
}
 
16
 
 
17
/**
 
18
 * This class represents the F-Spot photo_tags table.
 
19
 */
 
20
public class FSpotPhotoTagsTable : FSpotDatabaseTable<FSpotPhotoTagRow> {
 
21
    public static const string TABLE_NAME = "Photo_Tags";
 
22
    
 
23
    public FSpotPhotoTagsTable(Sqlite.Database db, FSpotDatabaseBehavior db_behavior) {
 
24
        base(db);
 
25
        set_behavior(db_behavior.get_photo_tags_behavior());
 
26
    }
 
27
}
 
28
 
 
29
public class FSpotPhotoTagsV0Behavior : FSpotTableBehavior<FSpotPhotoTagRow>, Object {
 
30
    private static FSpotPhotoTagsV0Behavior instance;
 
31
    
 
32
    private FSpotPhotoTagsV0Behavior() {
 
33
    }
 
34
    
 
35
    public static FSpotPhotoTagsV0Behavior get_instance() {
 
36
        if (instance == null)
 
37
            instance = new FSpotPhotoTagsV0Behavior();
 
38
        return instance;
 
39
    }
 
40
    
 
41
    public string get_table_name() {
 
42
        return FSpotPhotoTagsTable.TABLE_NAME;
 
43
    }
 
44
 
 
45
    public string[] list_columns() {
 
46
        return { "photo_id", "tag_id" };
 
47
    }
 
48
    
 
49
    public void build_row(Sqlite.Statement stmt, out FSpotPhotoTagRow row, int offset = 0) {
 
50
        row = new FSpotPhotoTagRow();
 
51
        row.photo_id = stmt.column_int64(offset + 0);
 
52
        row.tag_id = stmt.column_int64(offset + 1);
 
53
    }
 
54
}
 
55
 
 
56
}
 
57