MantisBT - MPfm
View Issue Details
0000357MPfmLibrarypublic2012-05-08 15:202013-02-23 13:35
ycastonguay 
ycastonguay 
normalfeatureN/A
resolvedfixed 
 
0.7.0.00.7.2.0 
0000357: Rewrite the Select, Update, Insert and Delete methods in SQLiteGateway
Add generics and reflection to fill DTOs directly from SQLiteGateway.

Add custom attributes to map property names and database field names when they're different.

Make sure they are all compatible with Mono.Data.SQLite. It can be particularly problematic on Mac OS X because the default SQLite library is missing a feature about metadata. It is the same problem as described here:
https://bugzilla.xamarin.com/show_bug.cgi?id=2128 [^]

Also get rid of DataAdapter for Update/Insert and replace Select with DataReader instead.
No tags attached.
related to 0000353resolved ycastonguay Add support for Mono.Data.SQLite (for Linux and Mac OS X) 
Issue History
2012-05-08 15:20ycastonguayNew Issue
2012-05-08 15:20ycastonguayStatusnew => assigned
2012-05-08 15:20ycastonguayAssigned To => ycastonguay
2012-05-08 15:20ycastonguayDescription Updatedbug_revision_view_page.php?rev_id=172#r172
2012-05-08 15:21ycastonguayRelationship addedrelated to 0000353
2012-05-08 16:02ycastonguayDescription Updatedbug_revision_view_page.php?rev_id=173#r173
2012-05-09 19:49ycastonguayDescription Updatedbug_revision_view_page.php?rev_id=174#r174
2012-05-09 21:40svnCheckin
2012-05-09 21:40svnNote Added: 0000657
2012-05-10 18:54svnCheckin
2012-05-10 18:54svnNote Added: 0000658
2012-05-10 19:04svnCheckin
2012-05-10 19:04svnNote Added: 0000659
2012-05-10 19:19svnCheckin
2012-05-10 19:19svnNote Added: 0000660
2012-05-10 19:24svnCheckin
2012-05-10 19:24svnNote Added: 0000661
2012-05-10 20:23svnCheckin
2012-05-10 20:23svnNote Added: 0000662
2012-05-10 20:44svnCheckin
2012-05-10 20:44svnNote Added: 0000663
2012-05-10 21:06svnCheckin
2012-05-10 21:06svnNote Added: 0000664
2012-05-12 23:46ycastonguayNote Added: 0000665
2012-05-12 23:46ycastonguayStatusassigned => resolved
2012-05-12 23:46ycastonguayFixed in Version => 0.7.2.0
2012-05-12 23:46ycastonguayResolutionopen => fixed
2012-06-19 17:29svnCheckin
2012-06-19 17:29svnNote Added: 0000777
2012-06-24 00:41svnCheckin
2012-06-24 00:41svnNote Added: 0000783
2013-02-23 13:35ycastonguayTarget Version0.7.2.0 => 0.7.0.0

Notes
(0000657)
svn   
2012-05-09 21:40   
The user animal has checked in files related to this issue (revision 476).

Comment:
MPfm 0.6.0.1
* Core
  - Conversion: Added the GetEnumValue method to dynamically create enums.
  - Added the DatabaseFieldNameAttribute attribute for mapping database and object field names.
* Library
  - SQLiteGateway: Added the FillDataTable method as a workaround to support Mono.
  - SQLiteGateway: The Select method for DataTable objects now uses the FillDataTable method.
  - SQLiteGateway: Added the new Select method with generics. It uses reflection to fill the
                   properties of the generic class.
* Sound
  - AudioFile: Added a parameterless constructor and setters to most properties.

Related to issue 0000357.



Files modified:
U MPfm/branches/current/MPfm/frmMain.cs
U MPfm/branches/current/MPfm.Core/Conversion.cs
A MPfm/branches/current/MPfm.Core/DatabaseFieldNameAttribute.cs
U MPfm/branches/current/MPfm.Core/MPfm.Core.csproj
U MPfm/branches/current/MPfm.Library/SQLiteGateway.cs
U MPfm/branches/current/MPfm.Sound/AudioFiles/AudioFile.cs
(0000658)
svn   
2012-05-10 18:54   
The user animal has checked in files related to this issue (revision 477).

Comment:
MPfm 0.6.0.1
* Core
  - Renamed the DatabaseFieldNameAttribute to DatabaseFieldAttribute.
  - DatabaseFieldAttribute: Added SaveToDatabase property.
  - Added the DictionaryExtension extension class with the FindKeyByValue method.
* Library
  - SQLiteGateway: Added the new Update method with generics. It uses reflection to build a SQL command.
  - SQLiteGateway: Added the new GetMap method with generics.
  - SQLiteGateway: Added the new FormatSQLValue method.
* Sound
  - AudioFile: Updated attributes.

Related to issue 0000357.



Files modified:
A MPfm/branches/current/MPfm.Core/Attributes/
A MPfm/branches/current/MPfm.Core/Attributes/DatabaseFieldAttribute.cs
A MPfm/branches/current/MPfm.Core/Extensions/
A MPfm/branches/current/MPfm.Core/Extensions/DictionaryExtension.cs
U MPfm/branches/current/MPfm.Core/MPfm.Core.csproj
U MPfm/branches/current/MPfm.Library/SQLiteGateway.cs
U MPfm/branches/current/MPfm.Sound/AudioFiles/AudioFile.cs
(0000659)
svn   
2012-05-10 19:04   
The user animal has checked in files related to this issue (revision 478).

Comment:
MPfm 0.6.0.0
* Library
  - SQLiteGateway: Added the Insert method with generics.

Related to issue 0000357.



Files modified:
U MPfm/branches/current/MPfm.Library/SQLiteGateway.cs
(0000660)
svn   
2012-05-10 19:19   
The user animal has checked in files related to this issue (revision 479).

Comment:
MPfm 0.6.0.0
* Library
  - SQLiteGateway: Added the SelectOne method.
  - SQLiteGateway: Added a new Update overload for a single where clause.

Related to issue 0000357.



Files modified:
U MPfm/branches/current/MPfm.Library/SQLiteGateway.cs
(0000661)
svn   
2012-05-10 19:24   
The user animal has checked in files related to this issue (revision 480).

Comment:
MPfm 0.6.0.1
* Library
  - SQLiteGateway: Removed the original Update and Insert methods.
  - MPfmGateway: Replaced Select/Update/Insert methods for AudioFile entity.
  - MPfmGateway: Replaced all other Update/Insert methods.

Related to issue 0000357.



Files modified:
U MPfm/branches/current/MPfm.Library/MPfmGateway.cs
U MPfm/branches/current/MPfm.Library/SQLiteGateway.cs
(0000662)
svn   
2012-05-10 20:23   
The user animal has checked in files related to this issue (revision 481).

Comment:
MPfm 0.6.0.1
* Library
  - SQLiteGateway: Removed the UpdateDataTable and UpdateDataTableTransaction methods.
  - SQLiteGateway: Added the SelectTuple and SelectList methods.
  - MPfmGateway: Removed SelectDistinctAlbumTitlesWithFilePaths method.
  - MPfmGateway: Updated the Distinct methods.
  - MPfmGateway: Updated the remaining Select methods.
  - Library: Removed SelectAlbumTitlesWithFilePaths method.

Related to issue 0000357.



Files modified:
U MPfm/branches/current/MPfm.Library/Library.cs
U MPfm/branches/current/MPfm.Library/MPfmGateway.cs
U MPfm/branches/current/MPfm.Library/SQLiteGateway.cs
(0000663)
svn   
2012-05-10 20:44   
The user animal has checked in files related to this issue (revision 482).

Comment:
MPfm 0.6.0.1
* Library
  - SQLiteGateway: Removed older Select and FillDataTable methods.
  - SQLiteGateway: Fixed bug in the FormatSQLValue method (added case for booleans).

Related to issue 0000357.



Files modified:
U MPfm/branches/current/MPfm.Library/SQLiteGateway.cs
(0000664)
svn   
2012-05-10 21:06   
The user animal has checked in files related to this issue (revision 483).

Comment:
MPfm 0.6.0.1
* Library
  - Removed ConvertLibrary class.
  - Created Gateway folder and moved files.
  - Created interface for the SQLiteGateway class.
  - SQLiteGateway: Removed the OpenConnection and CloseConnection methods.
  - SQLiteGateway: Rewrote the Execute and ExecuteScalar methods.

Related to issue 0000357.



Files modified:
D MPfm/branches/current/MPfm.Library/ConvertLibrary.cs
A MPfm/branches/current/MPfm.Library/Gateway/
A MPfm/branches/current/MPfm.Library/Gateway/ISQLiteGateway.cs
A MPfm/branches/current/MPfm.Library/Gateway/MPfmGateway.cs
A MPfm/branches/current/MPfm.Library/Gateway/SQLiteGateway.cs
U MPfm/branches/current/MPfm.Library/MPfm.Library.csproj
D MPfm/branches/current/MPfm.Library/MPfmGateway.cs
D MPfm/branches/current/MPfm.Library/SQLiteGateway.cs
(0000665)
ycastonguay   
2012-05-12 23:46   
All library database operations seem to work with the new generic methods. It works on the three platforms, now without having to build SQLite from source!
(0000777)
svn   
2012-06-19 17:29   
The user animal has checked in files related to this issue (revision 566).

Comment:
MPfm 0.6.0.1

* Library
  - Fixed nasty bug where the application would crash because too many file handles were open (on Linux and Mac OS X).
  - Added more .Close and disposed all objects in all methods.

Related to issue 0000357.


Files modified:
U MPfm/branches/current/MPfm.Library/Gateway/SQLiteGateway.cs
U MPfm/branches/current/MPfm.Mac/MainWindowController.cs
(0000783)
svn   
2012-06-24 00:41   
The user animal has checked in files related to this issue (revision 572).

Comment:
MPfm 0.6.0.1
* Library
  - SQLiteGateway: Fixed crash bug by adding dispose for all commands.

Related to issue 0000357,


Files modified:
U MPfm/branches/current/MPfm.Library/Gateway/SQLiteGateway.cs