Phantom DSL scala.NotImplementedError












0















I'm using Phantom DSL (v2.28.0, scala v2.12.7) and upon each query to my database I receive the following ambiguous error:




scala.NotImplementedError: an implementation is missing




This doesn't happen when I use .future() to resolve my query, in that case queries work just fine. Also, running a .executableQuery() method returns a properly formatted query, which all points to my failure to build a model properly, but I don't get it what I'm doing wrong. Example queries:



Working queries:



db.entries.select.all.future // -> Returns a Future[ResultSet]
db.entries.select.where(_.user_id is userId).future() // -> ^


Failing queries:



db.entries.select.all.fetch // -> Err
db.entries.select.where(_.user_id is userId).fetch() // -> Err
db.entries.select.all.fetchRecord // -> Err
...


The same goes for paginateRecord() etc.



 case class Rec(
id: UUID,
body: String,
time: DateTime,
user_id: Integer
)

abstract class active extends Table[active, Rec] {
object id extends UUIDColumn with PartitionKey
object body extends StringColumn
object time extends DateTimeColumn
object user_id extends IntColumn
}

class BasicDatabase(override val connector: CassandraConnection) extends Database[BasicDatabase](connector) {
object entries extends active with Connector
}
implicit val keySpace: KeySpace = KeySpace("some_keyspace")
implicit val session: Session = db.session
object db extends BasicDatabase(CassandraConnector.default)


I'm still a newbie so any suggestions are useful, thanks in advance.










share|improve this question





























    0















    I'm using Phantom DSL (v2.28.0, scala v2.12.7) and upon each query to my database I receive the following ambiguous error:




    scala.NotImplementedError: an implementation is missing




    This doesn't happen when I use .future() to resolve my query, in that case queries work just fine. Also, running a .executableQuery() method returns a properly formatted query, which all points to my failure to build a model properly, but I don't get it what I'm doing wrong. Example queries:



    Working queries:



    db.entries.select.all.future // -> Returns a Future[ResultSet]
    db.entries.select.where(_.user_id is userId).future() // -> ^


    Failing queries:



    db.entries.select.all.fetch // -> Err
    db.entries.select.where(_.user_id is userId).fetch() // -> Err
    db.entries.select.all.fetchRecord // -> Err
    ...


    The same goes for paginateRecord() etc.



     case class Rec(
    id: UUID,
    body: String,
    time: DateTime,
    user_id: Integer
    )

    abstract class active extends Table[active, Rec] {
    object id extends UUIDColumn with PartitionKey
    object body extends StringColumn
    object time extends DateTimeColumn
    object user_id extends IntColumn
    }

    class BasicDatabase(override val connector: CassandraConnection) extends Database[BasicDatabase](connector) {
    object entries extends active with Connector
    }
    implicit val keySpace: KeySpace = KeySpace("some_keyspace")
    implicit val session: Session = db.session
    object db extends BasicDatabase(CassandraConnector.default)


    I'm still a newbie so any suggestions are useful, thanks in advance.










    share|improve this question



























      0












      0








      0








      I'm using Phantom DSL (v2.28.0, scala v2.12.7) and upon each query to my database I receive the following ambiguous error:




      scala.NotImplementedError: an implementation is missing




      This doesn't happen when I use .future() to resolve my query, in that case queries work just fine. Also, running a .executableQuery() method returns a properly formatted query, which all points to my failure to build a model properly, but I don't get it what I'm doing wrong. Example queries:



      Working queries:



      db.entries.select.all.future // -> Returns a Future[ResultSet]
      db.entries.select.where(_.user_id is userId).future() // -> ^


      Failing queries:



      db.entries.select.all.fetch // -> Err
      db.entries.select.where(_.user_id is userId).fetch() // -> Err
      db.entries.select.all.fetchRecord // -> Err
      ...


      The same goes for paginateRecord() etc.



       case class Rec(
      id: UUID,
      body: String,
      time: DateTime,
      user_id: Integer
      )

      abstract class active extends Table[active, Rec] {
      object id extends UUIDColumn with PartitionKey
      object body extends StringColumn
      object time extends DateTimeColumn
      object user_id extends IntColumn
      }

      class BasicDatabase(override val connector: CassandraConnection) extends Database[BasicDatabase](connector) {
      object entries extends active with Connector
      }
      implicit val keySpace: KeySpace = KeySpace("some_keyspace")
      implicit val session: Session = db.session
      object db extends BasicDatabase(CassandraConnector.default)


      I'm still a newbie so any suggestions are useful, thanks in advance.










      share|improve this question
















      I'm using Phantom DSL (v2.28.0, scala v2.12.7) and upon each query to my database I receive the following ambiguous error:




      scala.NotImplementedError: an implementation is missing




      This doesn't happen when I use .future() to resolve my query, in that case queries work just fine. Also, running a .executableQuery() method returns a properly formatted query, which all points to my failure to build a model properly, but I don't get it what I'm doing wrong. Example queries:



      Working queries:



      db.entries.select.all.future // -> Returns a Future[ResultSet]
      db.entries.select.where(_.user_id is userId).future() // -> ^


      Failing queries:



      db.entries.select.all.fetch // -> Err
      db.entries.select.where(_.user_id is userId).fetch() // -> Err
      db.entries.select.all.fetchRecord // -> Err
      ...


      The same goes for paginateRecord() etc.



       case class Rec(
      id: UUID,
      body: String,
      time: DateTime,
      user_id: Integer
      )

      abstract class active extends Table[active, Rec] {
      object id extends UUIDColumn with PartitionKey
      object body extends StringColumn
      object time extends DateTimeColumn
      object user_id extends IntColumn
      }

      class BasicDatabase(override val connector: CassandraConnection) extends Database[BasicDatabase](connector) {
      object entries extends active with Connector
      }
      implicit val keySpace: KeySpace = KeySpace("some_keyspace")
      implicit val session: Session = db.session
      object db extends BasicDatabase(CassandraConnector.default)


      I'm still a newbie so any suggestions are useful, thanks in advance.







      scala cassandra phantom-dsl






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 20 '18 at 21:03







      Milan Velebit

















      asked Nov 20 '18 at 20:43









      Milan VelebitMilan Velebit

      7552619




      7552619
























          1 Answer
          1






          active

          oldest

          votes


















          0














          Alright, after digging into the source code, I figured out that the fromRow() method of the abstract class was failing so I added an override:



          abstract class active extends Table[active, Rec] {
          object id extends TimeUUIDColumn
          object body extends StringColumn
          object time extends DateTimeColumn
          object user_id extends IntColumn

          override def fromRow(row: Row): Rec = Rec(id(row), body(row), time(row), user_id(row))
          }


          This fixed the issue albeit I'm still not sure as to why it was failing in the first case, so any answer with appropriate explanation is still welcome.






          share|improve this answer
























          • Last time I had this error, I had a type mismatch in my case class. Did you try changing the Integer in your case class to Int?

            – Wizard
            Dec 16 '18 at 17:55













          • @Wizard Yeah I did but to no avail

            – Milan Velebit
            Dec 16 '18 at 18:04











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53401210%2fphantom-dsl-scala-notimplementederror%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          Alright, after digging into the source code, I figured out that the fromRow() method of the abstract class was failing so I added an override:



          abstract class active extends Table[active, Rec] {
          object id extends TimeUUIDColumn
          object body extends StringColumn
          object time extends DateTimeColumn
          object user_id extends IntColumn

          override def fromRow(row: Row): Rec = Rec(id(row), body(row), time(row), user_id(row))
          }


          This fixed the issue albeit I'm still not sure as to why it was failing in the first case, so any answer with appropriate explanation is still welcome.






          share|improve this answer
























          • Last time I had this error, I had a type mismatch in my case class. Did you try changing the Integer in your case class to Int?

            – Wizard
            Dec 16 '18 at 17:55













          • @Wizard Yeah I did but to no avail

            – Milan Velebit
            Dec 16 '18 at 18:04
















          0














          Alright, after digging into the source code, I figured out that the fromRow() method of the abstract class was failing so I added an override:



          abstract class active extends Table[active, Rec] {
          object id extends TimeUUIDColumn
          object body extends StringColumn
          object time extends DateTimeColumn
          object user_id extends IntColumn

          override def fromRow(row: Row): Rec = Rec(id(row), body(row), time(row), user_id(row))
          }


          This fixed the issue albeit I'm still not sure as to why it was failing in the first case, so any answer with appropriate explanation is still welcome.






          share|improve this answer
























          • Last time I had this error, I had a type mismatch in my case class. Did you try changing the Integer in your case class to Int?

            – Wizard
            Dec 16 '18 at 17:55













          • @Wizard Yeah I did but to no avail

            – Milan Velebit
            Dec 16 '18 at 18:04














          0












          0








          0







          Alright, after digging into the source code, I figured out that the fromRow() method of the abstract class was failing so I added an override:



          abstract class active extends Table[active, Rec] {
          object id extends TimeUUIDColumn
          object body extends StringColumn
          object time extends DateTimeColumn
          object user_id extends IntColumn

          override def fromRow(row: Row): Rec = Rec(id(row), body(row), time(row), user_id(row))
          }


          This fixed the issue albeit I'm still not sure as to why it was failing in the first case, so any answer with appropriate explanation is still welcome.






          share|improve this answer













          Alright, after digging into the source code, I figured out that the fromRow() method of the abstract class was failing so I added an override:



          abstract class active extends Table[active, Rec] {
          object id extends TimeUUIDColumn
          object body extends StringColumn
          object time extends DateTimeColumn
          object user_id extends IntColumn

          override def fromRow(row: Row): Rec = Rec(id(row), body(row), time(row), user_id(row))
          }


          This fixed the issue albeit I'm still not sure as to why it was failing in the first case, so any answer with appropriate explanation is still welcome.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 21 '18 at 21:35









          Milan VelebitMilan Velebit

          7552619




          7552619













          • Last time I had this error, I had a type mismatch in my case class. Did you try changing the Integer in your case class to Int?

            – Wizard
            Dec 16 '18 at 17:55













          • @Wizard Yeah I did but to no avail

            – Milan Velebit
            Dec 16 '18 at 18:04



















          • Last time I had this error, I had a type mismatch in my case class. Did you try changing the Integer in your case class to Int?

            – Wizard
            Dec 16 '18 at 17:55













          • @Wizard Yeah I did but to no avail

            – Milan Velebit
            Dec 16 '18 at 18:04

















          Last time I had this error, I had a type mismatch in my case class. Did you try changing the Integer in your case class to Int?

          – Wizard
          Dec 16 '18 at 17:55







          Last time I had this error, I had a type mismatch in my case class. Did you try changing the Integer in your case class to Int?

          – Wizard
          Dec 16 '18 at 17:55















          @Wizard Yeah I did but to no avail

          – Milan Velebit
          Dec 16 '18 at 18:04





          @Wizard Yeah I did but to no avail

          – Milan Velebit
          Dec 16 '18 at 18:04




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53401210%2fphantom-dsl-scala-notimplementederror%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Guess what letter conforming each word

          Port of Spain

          Run scheduled task as local user group (not BUILTIN)