question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add ability to document model

See original GitHub issue

For example:

/** 
  *  A train route defines a code and a carriage count.  Stops on the route are 
  *   defined elsewhere. 
  */
CREATE TABLE train_route (

  /** The auto generated primary key for this table. */
  _id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,

  /** The unique code for this route, e.g. P1231X */
  train_code TEXT NOT NULL,

  /** The number of carriages on this route. */
  carriage_count INTEGER NOT NULL

);

Would produce:


/** 
  *  A train route defines a code and a carriage count.  Stops on the route are 
  *   defined elsewhere. 
  */
public interface TrainRouteModel {
  String TABLE_NAME = "train_route";

  String _ID = "_id";

  String TRAIN_CODE = "train_code";

  String CARRIAGE_COUNT = "carriage_count";

  String CREATE_TABLE = ""
      + "CREATE TABLE train_route (\n"
      + "\n"
      + "  _id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,\n"
      + "\n"
      + "\n"
      + "  train_code TEXT NOT NULL,\n"
      + "\n"
      + "  carriage_count INTEGER NOT NULL\n"
      + "\n"
      + ")";

  /**
   * Find a train route by its code.
   */
  String SELECT_BY_TRAIN_CODE = ""
      + "SELECT *\n"
      + "FROM train_route\n"
      + "WHERE train_code = ?";

  /** The auto generated primary key for this table. */  
  long _id();

   /** The unique code for this route, e.g. P1231X */
  @NonNull
  String train_code();

  /** The number of carriages on this route. */
  long carriage_count();

...

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
JakeWhartoncommented, Aug 2, 2016

I would also hoist those comments onto the column constants.

0reactions
AlecStrongcommented, Aug 3, 2016

looks perfect, open a PR and we can continue from there

Read more comments on GitHub >

github_iconTop Results From Across the Web

Document Model Support in DynamoDB - All Things Distributed
We are introducing native support for document model like JSON into DynamoDB, the ability to add / remove global secondary indexes, adding more ......
Read more >
Use the document processing model in Power Automate
Select the document processing model you want to use, and then select the document type. In the Form field, add File Content from...
Read more >
External Tools: Document your Power BI Model - Data – Marc
By following the four easy steps in the previous chapter, you can easily add the document model external tool to your Power BI...
Read more >
Document modeling with Amazon DocumentDB and Hackolade
Document modeling is the process of structuring your JSON data, defining data types and relationships with other documents. Access patterns for ...
Read more >
How to Build a Document Understanding Model using Project ...
Document understanding models are AI-apps - built in a new type of SharePoint site called a content center – used to automate the ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found