forked from guolindev/LitePal
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add byte array type of field mapping as blob in table.
- Loading branch information
1 parent
a18aa74
commit 10f7d1f
Showing
6 changed files
with
89 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#Wed Apr 10 15:27:10 PDT 2013 | ||
#Mon Jan 18 19:36:36 CST 2016 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
litepal/src/main/java/org/litepal/tablemanager/typechange/BlobOrm.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package org.litepal.tablemanager.typechange; | ||
|
||
/** | ||
* This class deals with byte type. | ||
* | ||
* @author Tony Green | ||
* @since 1.3.1 | ||
*/ | ||
public class BlobOrm extends OrmChange{ | ||
|
||
/** | ||
* If the field type passed in is byte, it will change it into blob as | ||
* column type. | ||
*/ | ||
@Override | ||
public String object2Relation(String fieldType) { | ||
if (fieldType != null) { | ||
if (fieldType.equals("byte") || fieldType.equals("java.lang.Byte")) { | ||
return "blob"; | ||
} | ||
} | ||
return null; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters