Search code examples
playorm

scanned packages


I have on my Eclipse workspace 2 projects:

  1. playOrm (it's generated a jar file)
  2. MyOwnProject ( I use the jar file generated above to use playOrm like ORM to Cassandra on MyOwnProject )

My question:

How can I, for my classes defined on MyOwnProject, use the same benefits of the User class defined on com.alvazan.test.db sample? When I execute a class located at MyOwnProject, playOrm creates it on my keyspace, and also manages the insert (NoSqlEntityManager.put() ) or query ( @NoSqlQuery )

I put those annotations on my classes but when I execute them the error message appears:

java.lang.IllegalArgumentException: Entity type=com.s1mbi0se.dmp.da.bean.User was not scanned and added to meta information on startup.  It is either missing @NoSqlEntity annotation or it was not in list of scanned packages

I tried defining my classes with a @NoSqlEntity annotation but it's still not working.


Solution

  • Are you missing the class nosql.Persistence.class in your jar file or folder?

    If so, create a nosql.Persistence.java file.

    PlayOrm scans all jars and folders on the classpath for nosql.Persistence and ONLY scans jars and folders with that file.

    Why don't we use persistence.xml like JPA?

    Because LOTS of frameworks and IDE's screw persistence.xml by only copying class files so we use a class file to be compatible with more frameworks. ie. like playframework.org which is a real-time development framework(NO need to reboot server when you change stuff as all our classes are rescanned but we need a class file to pull that trick off)

    If you haven't tried playframework.org, give it a spin....it is fast for developer productivity.

    later, Dean