LucaMs Expert Licensed User Longtime User May 28, 2014 #1 I'm developing a generator of classes related to database tables, which I hope will be useful to everyone. Given I'm lazy today(?), I ask you what functions you would put in a typical class that represents an entity (such as a Customer class). For the moment, I put only normal properties and a "structure" for the validation of the data entered into them. Classes will be for B4A. Everything will be a tool in b4j available to all members, so ... collaborate, please Examples would be: lists of related objects (children); parent object; I/O functions; ...
I'm developing a generator of classes related to database tables, which I hope will be useful to everyone. Given I'm lazy today(?), I ask you what functions you would put in a typical class that represents an entity (such as a Customer class). For the moment, I put only normal properties and a "structure" for the validation of the data entered into them. Classes will be for B4A. Everything will be a tool in b4j available to all members, so ... collaborate, please Examples would be: lists of related objects (children); parent object; I/O functions; ...
LucaMs Expert Licensed User Longtime User May 28, 2014 #3 Added: Insert (into db) Last edited: May 29, 2014
LucaMs Expert Licensed User Longtime User May 29, 2014 #4 Uhm... probably I'll put a Locked property, perhaps it will be helpful. Hey, guys, I'm not writing my personal diary, eh!
Uhm... probably I'll put a Locked property, perhaps it will be helpful. Hey, guys, I'm not writing my personal diary, eh!
LucaMs Expert Licensed User Longtime User May 29, 2014 #5 ok, since no one is interested ... I'll give you this tool for only 500€. I consider the thread closed.
ok, since no one is interested ... I'll give you this tool for only 500€. I consider the thread closed.
DonManfred Expert Licensed User Longtime User May 30, 2014 #6 LucaMs said: Hey, guys, I'm not writing my personal diary, eh! Click to expand... Don´t talk about things if you wish to get comments... Publish it along with an example maybe the example you wanted to write (hihi) about the Nothwind-database... Could be a good exmple of showing the greatness of you Class ;-)
LucaMs said: Hey, guys, I'm not writing my personal diary, eh! Click to expand... Don´t talk about things if you wish to get comments... Publish it along with an example maybe the example you wanted to write (hihi) about the Nothwind-database... Could be a good exmple of showing the greatness of you Class ;-)
LucaMs Expert Licensed User Longtime User May 30, 2014 #7 DonManfred said: Could be a good exmple of showing the greatness of you Class ;-) Click to expand... I need a generator to generate... my class
DonManfred said: Could be a good exmple of showing the greatness of you Class ;-) Click to expand... I need a generator to generate... my class
LucaMs Expert Licensed User Longtime User May 30, 2014 #8 Before I create the generator itself (should not be very complicated) I would like to create some templates for a class based on a table in SQLite. The class should have specific characteristics to be used at its best with B4A. For this reason, I asked suggestions, because then I would have put this tool available to all. For the moment I'm writing the class directly (without too much effort) which will then be automatically generated. At the same time, I developed two classes for the validation of the individual data/fields. I am still stuck at: Fields - class properties with validation; DBFillFromQuery - fills in the fields of the class by taking the data from a db; DBInsert - writes the "class" in the db. Maybe I've spent more time for validation. AddValidValue(ValidValue As Object) RemoveValidValue(ValidValue As Object) AddInvalidValue(InvalidValue As Object) RemoveInvalidValue(InvalidValue As Object) setValidValues(ValidValues As List) + get setInvalidValues(InvalidValues As List) + get for number fields: setMinValue(MinValue As Object) + get setMaxValue(MaxValue As Object) + get Validation messages: Private mErrorDisplayMode As Int ENUM Private mErrorDisplayModeNone As Int: mErrorDisplayModeNone = 0 Private mErrorDisplayModeMsg As Int: mErrorDisplayModeMsg = 1 Private mErrorDisplayModeToast As Int: mErrorDisplayModeToast = 2 Private mErrorDisplayModeLog As Int: mErrorDisplayModeLog = 3 setErrorDisplayMode(ErrorDisplayMode As Int) setErrorMsg (ErrorMsg As String) + get setErrorTitle (ErrorTitle As String) + get setErrorToastLongDuration (LongDuration As Boolean) + get
Before I create the generator itself (should not be very complicated) I would like to create some templates for a class based on a table in SQLite. The class should have specific characteristics to be used at its best with B4A. For this reason, I asked suggestions, because then I would have put this tool available to all. For the moment I'm writing the class directly (without too much effort) which will then be automatically generated. At the same time, I developed two classes for the validation of the individual data/fields. I am still stuck at: Fields - class properties with validation; DBFillFromQuery - fills in the fields of the class by taking the data from a db; DBInsert - writes the "class" in the db. Maybe I've spent more time for validation. AddValidValue(ValidValue As Object) RemoveValidValue(ValidValue As Object) AddInvalidValue(InvalidValue As Object) RemoveInvalidValue(InvalidValue As Object) setValidValues(ValidValues As List) + get setInvalidValues(InvalidValues As List) + get for number fields: setMinValue(MinValue As Object) + get setMaxValue(MaxValue As Object) + get Validation messages: Private mErrorDisplayMode As Int ENUM Private mErrorDisplayModeNone As Int: mErrorDisplayModeNone = 0 Private mErrorDisplayModeMsg As Int: mErrorDisplayModeMsg = 1 Private mErrorDisplayModeToast As Int: mErrorDisplayModeToast = 2 Private mErrorDisplayModeLog As Int: mErrorDisplayModeLog = 3 setErrorDisplayMode(ErrorDisplayMode As Int) setErrorMsg (ErrorMsg As String) + get setErrorTitle (ErrorTitle As String) + get setErrorToastLongDuration (LongDuration As Boolean) + get
LucaMs Expert Licensed User Longtime User May 30, 2014 #9 Completed all, I would like to also create GUIs. EditText.Tag = "#Customer.LastName" <---- for data binding?
Completed all, I would like to also create GUIs. EditText.Tag = "#Customer.LastName" <---- for data binding?