A Persistence Framework for Scala and NoSQL
TestDataGenerator
and
CustomGeneratorPool
by wrapping them in longevity
classes. Slightly simplified the API for adding a custom test data
generators.LongevityContext
constructors and apply
methods
that take either a LongevityConfig
or a Typesafe config.@subdomain
in package
longevity.subdomain.annotations
.Subdomain
constructor and apply
method that
collect all the PTypes
and CTypes
by package scanning.@component
,
@derivedComponent
, @derivedPersistent
, @keyVal
, @mprops
,
@persistent
, @polyComponent
, and @polyPersistent
in package
longevity.subdomain.annotations
.PType
inner objects keys
and
indexes
to look for keys and indexes. Users must now define
PType.keySet
, and override PType.indexSet
, to declare keys and
indexes. We made this change since the object scanning was
superfluous, and complicates the API. (In contrast, scanning for
properties is useful, as users need to be able to call properties by
name. However, users never really need to call keys and indexes by
name, so there is no advantage to naming them in an inner object.)PType.emptyKeySet
.PType.partitionKey
methods return Key[P]
instead of PartitionKey[P]
. this is for convenience of Scala 2.11
users, so they dont have to declare the full type of their keySet.longevity.subdomain.Key
and longevity.subdomain.PartitionKey
.
Remove types longevity.subdomain.AnyKey
and
longevity.subdomain.AnyPartitionKey
, as they no longer serve any
purpose.longevity.subdomain.KeyVal
.longevity.subdomain.EType
(for "embeddable
type") to longevity.subdomain.CType
(for "component type").longevity.subdomain.Embeddable
and
longevity.subdomain.Persistent
. Users no longer need to extend
their subdomain classes with these empty marker traits.RepoCrudSpec
from a FeatureSpec
to a
FlatSpec
. Users using LongevityContext.repoCrudSpec
will notice
significantly less verbose test output.DateTime
to UTC time zone. This
seems like the best approach right now, as both Cassandra and
MongoDB back ends support timestamps without time zone
information. It also resolves issues with sorting dates.KeyVal.key
and change KeyVal
from an
abstract class into a trait. To migrate existing code, you will need
to remove the Key
argument supplied to each of your KeyVal
types.longevity.subdomain.query
. This
should not affect you if you are only using the query DSL.Please refer to the user manual for the latest on the query API.
In brief, we have collapsed packages longevity.subdomain.embeddable
and longevity.subdomain.persistent
into longevity.subdomain
. We have moved a number of classes that were nothing more than DDD synonyms for existing longevity terms into a new side-project called longevity-ddd
.
In effect we are cleaning out the namespace and removing some of the clutter of our DDD roots in our continued efforts to develop a general-purpose persistence framework.
The bloody details:
DerivedType
to DerivedEType
. Rename
PolyType
to PolyEType
.CoreDomain
, GenericSubdomain
, and
SupportingSubdomain
from package longevity.subdomain
to
longevity.ddd.subdomain
.Entity
, EntityType
, ValueObject
, and
ValueType
from package longevity.subdomain.embeddable
to
longevity.ddd.subdomain
.Event
, Root
, and ViewItem
from package
longevity.subdomain.persistent
to package
longevity.ddd.subdomain
.EventType
, RootType
, and View
from package
longevity.subdomain.ptype
to package longevity.ddd.subdomain
.DerivedEType
, EType
, ETypePool
,
Embeddable
, and PolyEType
from package
longevity.subdomain.embeddable
to longevity.subdomain
.Persistent
from package
longevity.subdomain.persistent
to longevity.subdomain
.DerivedPType
, PType
, PTypePool
, and
PolyPType
from package longevity.subdomain.ptype
to
longevity.subdomain
.longevity.ddd.subdomain
into a separate
project called longevity-ddd
. If you want to continue using the
wrapper classes found there, please add the following dependency to
your project: libraryDependencies += "org.longevityframework" %% "longevity-ddd" % "x.y.z"
.There was a bug in our use of Scala reflection. In brief, we were using the class loader (i.e., scala reflection Mirror
) that was used to load the longevity library. This is bogus, as we are reflecting against user classes! We changed things to reflect on the mirror of the TypeTags
(they get wrapped in TypeKeys
) that the user library provides to use.
End result is that projects that do funky things with class loaders will not get reflection exceptions when using longevity.
Some odds and ends that have been accumulating in the backlog.
PersistenceStrategy
to BackEnd
. Move
BackEnd
from being a separate argument to LongevityContext
creator methods, to being part of the config, under config property
longevity.backEnd
.OPState
to go along with FPState
and FOPState
.LongevityContext.jsonMarshaller
and
LongevityContext.jsonUnmarshaller
.Some odds and ends that have been accumulating in the backlog. The next release, Jetsam, will be more of the same.
PState.dirty
. We are taking this out because
there we may decide to stop keeping track of the original version
of the persistent object, in order to reduce memory usage.RepoPool.createSchema()
and configuration flag
autocreateSchema
.Repo
methods and database calls.RepoPool.closeSession()
. This was
added because leaving the Cassandra session open can cause user
programs to fail to terminate under certain circumstances, If your
main program is hanging when using Cassandra, please call this
method at the end of your program.the previous fix in 0.11.3 was bogus. one of those days!
this bug is a NullPointerE in Cassandra create or update methods. It occurred when optimistic locking was turned off. i need to expand my test suite to cover different configs...