[storage] Replace 'DSentity' with 'loadEntity'
[abstract.git] / storage / aaLoadEntity.h
blob9c041c65c0c76afc400dace3b26262d76033c59f
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim:set ts=2 sw=2 sts=2 et cindent tw=79 ft=cpp: */
3 /*
4 * Copyright (C) 2007 Sergey Yanovich <ynvich@gmail.com>
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; either version 2 of the
9 * License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
16 * You should have received a copy of the GNU General Public
17 * License along with this program; if not, write to the
18 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 * Boston, MA 02111-1307, USA.
22 #ifndef AALOADENTITY_H
23 #define AALOADENTITY_H 1
25 #define AA_LOADENTITY_CID \
26 {0xc4bf8150, 0x5fe4, 0x409c, {0xbb, 0x30, 0x7b, 0x0f, 0x77, 0xeb, 0x04, 0x0e}}
27 #define AA_LOADENTITY_CONTRACT_ID "@aasii.org/storage/load-entity;1"
29 class mozIStorageConnection;
30 class mozIStorageStatement;
31 class aaIEntity;
33 class aaLoadEntity : public aaILoadQuery,
34 public aaIQuery
36 public:
37 aaLoadEntity(nsISupports *aOuter);
38 virtual ~aaLoadEntity();
39 NS_DECL_ISUPPORTS
40 NS_DECL_AAIQUERY
41 NS_DECL_AAILOADQUERY
43 nsresult Init() { return mConnection ? NS_OK : NS_ERROR_INVALID_ARG; }
44 private:
45 friend class aaStorageTest;
47 nsCOMPtr<mozIStorageConnection> mConnection;
48 nsCOMPtr<mozIStorageStatement> mStatement;
50 const char* getSelectQuery() const;
51 const char* getItemContract() const;
52 aaIEntity* fetchRow();
55 #endif /* AALOADENTITY_H */