Skip to content

AeroLink - Freight Management System is an Enterprise Information System built to be a project study of using Agile Methodology in developing Enterprise Information Systems

License

Notifications You must be signed in to change notification settings

AeroLink/AeroLink-source

Repository files navigation

AeroLink-source

AeroLink - Freight Management System is an Enterprise Information System built to be a project study of using Agile Methodology in developing Enterprise Information Systems

Synapse DB Operations Framework

  • Select
   
   Model m = new Model();
  
   List list = m.get();
   
   //Get certain columns
   //list = m.get("column", "column", "column");
   
   for(Object obj : list) {
     HashMap row = (HashMap) obj;
     
     //getting the value thru accessing the column name in the hashmap
     //row.get("column_name").toString();
     
   }
   
   //Or you could do this
   m.get().stream().forEach(obj -> {
      HashMap row = (HashMap) obj;
      
      //getting the value thru accessing the column name in the hashmap
      //row.get("column_name").toString();
   });
   
   //get Certain columns
   m.get("columns", "columns").stream().forEach(obj -> {
      HashMap row = (HashMap) obj;
      
      //getting the value thru accessing the column name in the hashmap
      //row.get("column_name").toString();
   });
 
  • Insert
  Model m = new Model();
  
  //Basic Insert
  m.insert(new Object[][]{
    {"column_name0", "value0"},
    {"column_name1", "value1"},
    {"column_name2", "value2"},
  });
  
  //Return autogenerated ID
  int id = m.insert(new Object[][]{
    {"column_name0", "value0"},
    {"column_name1", "value1"},
    {"column_name2", "value2"},
  }, true);
  
  • Update
   Model m = new Model();
   
   m.update(new Object[][]{
       {"column_name0", "value0"},
       {"column_name1", "value1"},
       {"column_name2", "value2"},
    }).where(new Object[][]{
       {"column_name0", "=", "value0"}
    }).executeUpdate();
   
  • Delete
   Model m = new Model();
   
   m.delete().where(new Object[][]{
       {"column_name0", "=", "value0"}
    }).executeUpdate();
   

About

AeroLink - Freight Management System is an Enterprise Information System built to be a project study of using Agile Methodology in developing Enterprise Information Systems

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published