Coder Social home page Coder Social logo

trikke / android-sqlite-generator Goto Github PK

View Code? Open in Web Editor NEW
79.0 79.0 11.0 451 KB

A Compiler which generates helper-classes and structures from describing json schemes. Less hassle, less boilerplate code that needs to be written and easier to maintain.

License: Apache License 2.0

Java 100.00%

android-sqlite-generator's People

Contributors

weltonrodrigo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-sqlite-generator's Issues

small fix!

congrats!

I know after all this work, this is nothing!!

no primary key defined - generation correct

primary key defined - generation dodgy


hmm, what about create the table class (setters&getters) ?

then at ProviderClient we can have something like :

//Automotodetails the table class (setters&getters)

    public static List<Automotodetails> getAllAutomotodetailss(Context c) {
        List<Automotodetails> automotodetailss = new ArrayList<Automotodetails>();
        Automotodetails automotodetails = null;

        Cursor cursor = getAllTable(c);

        cursor.moveToFirst();
        while (!cursor.isAfterLast()) {
            automotodetails = cursorToAutomotodetails(cursor);
            automotodetailss.add(automotodetails);
            cursor.moveToNext();
        }

        // Make sure to close the cursor
        cursor.close();

        return automotodetailss;
    }

    private static Automotodetails cursorToAutomotodetails(Cursor cursor) {
        if (cursor == null || cursor.getColumnCount() == 0)
            return null;

        Automotodetails automotodetails = new Automotodetails();
        automotodetails.setautomotodetail_id(cursor.getLong(0));
        automotodetails.setautomoto_id(cursor.getLong(1));
        automotodetails.setkm_daterec(cursor.getString(2));
        automotodetails.setkm_counter(cursor.getLong(3));
        automotodetails.setfixes(cursor.getString(4));
        automotodetails.setcost(cursor.getDouble(5));
        automotodetails.setwhere(cursor.getString(6));
        automotodetails.setcomment(cursor.getString(7));
        automotodetails.setautomotodetail_daterec(cursor.getString(8));
        automotodetails.setautomotodetail_guid(cursor.getString(9));

        return automotodetails;
    }

on activity/fragment will work like :

        List<Automotodetails> automotodetailss = AutomotodetailsContentProviderClient.getAllAutomotodetailss(this);
        Toast.makeText(this, String.valueOf(automotodetailss.size()), 3000).show();

on create database better do in transaction (?)

    @Override
    public void onCreate(SQLiteDatabase db) {
        Log.d(TAG, "Creating a new Database. Current version " + DATABASE_VERSION);

        db.beginTransaction();

        try {
            db.execSQL(DATABASE_AUTOMOTODETAILS_CREATE);
            db.execSQL(DATABASE_AUTOMOTOS_CREATE);

            db.setTransactionSuccessful();
        } finally {
            db.endTransaction();
        }
    }

forgot to add is primary key

tuning_id INTEGER --> PRIMARY KEY

on sqlitehelper create table variables


here need to be "item" ?


where at delete/update procedures working like charm by UNIQUEID var!

still confused again with "_id"
what happening here ? how can be row query there ? I have to modify each with table_PK ?

thanks!!!


updated
http://www.pipiscrew.com/works/sqlite-manager-v1-0/

v1.8.3 - generate table structure for Trikke โ€“ android-sqlite-generator!

Gradle plugin

Hello, could you make a gradle plugin for this generator ? I would really like to use this generator in one of my projects, yet I am not really willing to manage all the resources it creates on my own, that is what are gradle plugins for.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.