Message from discussion
Fwd: [scala-user] Re: Scala and databases
Received: by 10.112.99.198 with SMTP id es6mr35460lbb.1.1352216384314;
Tue, 06 Nov 2012 07:39:44 -0800 (PST)
X-BeenThere: scala-user@googlegroups.com
Received: by 10.112.87.162 with SMTP id az2ls137078lbb.8.gmail; Tue, 06 Nov
2012 07:39:36 -0800 (PST)
Received: by 10.58.169.70 with SMTP id ac6mr489996vec.8.1352216376851;
Tue, 06 Nov 2012 07:39:36 -0800 (PST)
Received: by 10.58.169.70 with SMTP id ac6mr489995vec.8.1352216376817;
Tue, 06 Nov 2012 07:39:36 -0800 (PST)
Return-Path: <tim.pig...@optrak.com>
Received: from mail-vb0-f46.google.com (mail-vb0-f46.google.com [209.85.212.46])
by gmr-mx.google.com with ESMTPS id es5si3268135vdb.2.2012.11.06.07.39.36
(version=TLSv1/SSLv3 cipher=OTHER);
Tue, 06 Nov 2012 07:39:36 -0800 (PST)
Received-SPF: pass (google.com: domain of tim.pig...@optrak.com designates 209.85.212.46 as permitted sender) client-ip=209.85.212.46;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of tim.pig...@optrak.com designates 209.85.212.46 as permitted sender) smtp.mail=tim.pig...@optrak.com
Received: by mail-vb0-f46.google.com with SMTP id ff1so608477vbb.5
for <scala-user@googlegroups.com>; Tue, 06 Nov 2012 07:39:36 -0800 (PST)
d=google.com; s=20120113;
h=mime-version:in-reply-to:references:date:message-id:subject:from:to
:content-type:x-gm-message-state;
bh=fZY5bVymKwMljJAnFEgnfurl9Cc6YM/Re5KT+VrokxE=;
b=QctEcdl7aKAv6R6lmJs9B+253G5elRtEgmibZHVjUTyF9Qoi3EmJEz8beGgYQyDWCx
flklE8CpYRNbW9nUXaE9zqUTtU8nrUELTTpSR2G9nyhKx0Eo4/oRerwJiMCxJeA3UsCM
xx3e8UzEkeCWVu/Rhedg348VZJM6T9jznYjSOwN41OXMWAqDoFGXqSDbDWzWR9Ytehtx
5tsSbLYsrQFvFo/rq+JjJAARsmHo2eRCYTCh0HymIKX57kl+Iz4RCElcGYVjXgyJRi45
qXYRPg3sdWAH1i8SixbDZJkLxS501yuJrTPpyVVEQItwd78eSrUHfG2qA7qzTZts+28f
9jTg==
MIME-Version: 1.0
Received: by 10.220.238.148 with SMTP id ks20mr1271254vcb.5.1352216376632;
Tue, 06 Nov 2012 07:39:36 -0800 (PST)
Received: by 10.58.136.229 with HTTP; Tue, 6 Nov 2012 07:39:36 -0800 (PST)
In-Reply-To: <CABZx1XONz=J8DJzanHd2RMwCBUuGpZCW_7b9HY6OEWRgtnO...@mail.gmail.com>
References: <CAG-LmmBe5Cdn_SRgWGDz_3djRauoeQ+7ofqzKt8kwNfr_mt...@mail.gmail.com>
<a7dc4dcb-bf14-4907-a1ac-487bfb00f9c7@googlegroups.com>
<CAMcsVjaHjcrzBQPBMA_SHsEUU+rRkQha=Gpi08H9dPzjS-6...@mail.gmail.com>
<509253D0.5090...@googlemail.com>
<56acb4f0-8736-4441-86c5-5f23fe5efe9d@googlegroups.com>
<5092ED12.1090...@googlemail.com>
<9539526AD512410BAE0A104C6CD8D...@gmail.com>
<50944218....@googlemail.com>
<A3800F9B6D8B45D4A5149248468DE...@gmail.com>
<509928AA.5060...@googlemail.com>
<FCEAAB34962E4CFFBCB1379040BF0...@gmail.com>
<CABZx1XONz=J8DJzanHd2RMwCBUuGpZCW_7b9HY6OEWRgtnO...@mail.gmail.com>
Date: Tue, 6 Nov 2012 15:39:36 +0000
Message-ID: <CABZx1XMmvvnUpR7XCT-Aq5J54wsA6bC7BxdJOVaW89bFWER...@mail.gmail.com>
Subject: Fwd: [scala-user] Re: Scala and databases
From: Tim Pigden <tim.pig...@optrak.com>
To: scala-user <scala-user@googlegroups.com>
Content-Type: multipart/alternative; boundary=14dae9d253b4c9e69b04cdd56819
X-Gm-Message-State: ALoCoQkXdzaWMLYL037UjMmlfy1BXjQ6hHjvsosbGBS1g0Tk9e0AsLh7+IuAMZNGMw6Cu0lbdeHf
--14dae9d253b4c9e69b04cdd56819
Content-Type: text/plain; charset=ISO-8859-2
Content-Transfer-Encoding: quoted-printable
Flavio - why do you say the real data is mutable (other than in the
database)?
On 6 November 2012 15:36, Fl=E1vio W. Brasil <fwbra...@gmail.com> wrote:
> The point about using immutable classes in functional programming is
> avoid information mutability, so you don't have to worry about concurrenc=
y
> issues.
> Mapperdao classes are immutable, but the "real" entity (information) is
> mutable and can produce concurrency issues. You have a sensation of using
> immutable data, but will have the same issues of mutable classes.
>
> --
> Fl=E1vio W. Brasil
> http://activate-framework.org
> {persistence as it should be}
>
> On Tuesday, 6 de November de 2012 at 13:11, Konstantinos Kougios wrote:
>
> Ok, I see.
>
> To answer the original post and regarding an ORM library, I think the
> mapperdao tutorial is the best link :
> https://mapperdao-examples.googlecode.com/files/tutorial-1.0.0-rc15.pdf ,
> which includes the entity declarations.
>
> Regarding entity declarations that might seem an overhead, I've got a
> f.a.q page: http://code.google.com/p/mapperdao/wiki/FAQ . They are very
> useful for i.e. querying i.e. (select from pe where
> pe.price>10).toSet(queryDao) , compared to the String-based HQL.
>
> Flavio, mapperdao doesn't mutate any instances, i.e.
>
> val updated=3D
> mapperDao.update(ProductEntity,inserted,Product("newv","newv"))
>
> updated , inserted and Product("newv","newv") are 3 separate instances,
> none of them is mutated. mapperdao can be used in a functional way, i.e.
>
> val l =3D List(...products)
> val persistedL=3Dl.map(mapperDao.insert(ProductEntity,_)) // list of
> persisted products i.e. Product with SurrogateIntId
>
> l and persistedL contain different instances.
>
> On 05/11/12 22:55, Fl=E1vio W. Brasil wrote:
>
> Hello Konstantinos,
>
> Thanks for the example Flavio, ok I see. Why the emphasis on
> transactional memory and efficient memory usage? What apps are you
> targeting?
>
> There isn't a specific type of application that is the Activate target.
> It can be used from simple embedded systems to high performance
> environments.
>
> The STM provides a powerful consistency control that is absent in
> regular ORMs, including read validation. It uses optimistic locking that
> permit higher transaction throughput comparing to traditional database
> pessimistic approach. There are other benefits of STM that I will not lis=
t
> here.
>
> A common ORM performance bottleneck is marshal/unmarshal entities
> from/to database. The usual solution for this problem is to use caches.
> Normally ORMs cache implementations fail in aspects like inconsistent
> reads/writes and (believe or not) performance issues. Activate simple use=
s
> the great JVM garbage collector to decide what entities to maintain in
> memory by using soft references. The STM assures that the in-memory
> information is consistent.
>
> Also what's your naming conventions for mapping to the tables?
>
> Entities are mapped to the storage using their simple class name and
> properties names. The 1.1 version will have annotations that permit custo=
m
> names mapping.
>
> mapperdao uses a different approach and your example would look like
>
> class Stock(val code:String,val categories:Set[Category]) // or
> List[Category] etc
> class Category(val name:String,val stocks:Set[Stock])
>
> You can too use an intermediate StockCategory entity if you prefer.
>
> I'm assuming that there is a separate entity declaration that is not in
> your email, right?
>
> MapperDao gives direct control on persistence and transactions to
> client code, i.e.
>
> val tx =3D Transaction.get(txManager, Propagation.Nested,
> Isolation.ReadCommited, -1)
> // will insert category and insert/update related Stock in 1 transaction
> val inserted =3D tx { () =3D>
> mapperDao.insert(CategoryEntity, category)
> }
>
> MapperDao supports nested transactions too along with updates/deletes.
>
> Interesting, you are using spring implementation that uses savepoints to
> do nested transactions. The only difference from Activate is that the
> mapperdao nested transaction will use the database pessimistic locking
> approach.
>
> All web frameworks are supported as mapperdao only needs a DataSource
> to work.
>
> Activate also supports all web frameworks. There is a Play module that ha=
s
> some glue code to make the integration easier.
>
> A major feature of mapperdao is support for immutable classes,
> something that i.e. hibernate doesn't support, along with a typesafe DSL
> for querying.
>
> Seems to me that Mapperdao immutable entities hide a "veiled"
> mutability. An example using Mapperdao:
>
> case class Product(val title: String, val description: String)
> val inserted=3DmapperDao.insert(ProductEntity,Product("title","desc"))
> mapperDao.update(ProductEntity,inserted,Product("newv","newv"))
>
> The Product class is immutable, but the Product entity instance isn't.
> The "inserted" entity is modified to have values "newv". If there is a
> concurrent transaction the entity instance can stay inconsistent. This
> veiled mutability looks dangerous to me.
>
> --
> Fl=E1vio W. Brasil
> http://activate-framework.org
> {persistence as it should be}
>
> On Friday, 2 de November de 2012 at 19:58, Konstantinos Kougios wrote:
>
> Thanks for the example Flavio, ok I see. Why the emphasis on
> transactional memory and efficient memory usage? What apps are you
> targeting? Also what's your naming conventions for mapping to the tables=
?
>
> mapperdao uses a different approach and your example would look like
>
> class Stock(val code:String,val categories:Set[Category]) // or
> List[Category] etc
> class Category(val name:String,val stocks:Set[Stock])
>
> You can too use an intermediate StockCategory entity if you prefer.
>
> MapperDao gives direct control on persistence and transactions to client
> code, i.e.
>
> val tx =3D Transaction.get(txManager, Propagation.Nested,
> Isolation.ReadCommited, -1)
> // will insert category and insert/update related Stock in 1 transaction
> val inserted =3D tx { () =3D>
> mapperDao.insert(CategoryEntity, category)
> }
>
> MapperDao supports nested transactions too along with updates/deletes. Al=
l
> web frameworks are supported as mapperdao only needs a DataSource to work=
.
> A major feature of mapperdao is support for immutable classes, something
> that i.e. hibernate doesn't support, along with a typesafe DSL for queryi=
ng.
>
> On 02/11/12 20:06, Fl=E1vio W. Brasil wrote:
>
> Hello.
>
> Activate is designed to be simple. OO is straightforward to map data and
> relations. Instead of trying to create a magical relational many-to-many
> concept, you do as should do in OO: create a relation entity.
>
> class Stock(var code: String) extends Entity {
> def categories =3D select[StockCategory].where(_.stock :=3D=3D
> this).map(_.category)
> }
> class Category(var name: String) extends Entity {
> def stocks =3D select[StockCategory].where(_.category :=3D=3D
> this).map(_.stock)
> }
> case class StockCategory(stock: Stock, category: Category) extends Entit=
y
>
> To map the same domain using separate entity declaration and "implicit"
> many-to-many relation you have to produce much more code. Activate 1.1
> version (to be released this month) has support for Lists too:
>
> class Person(var name: String, var contacts: List[Contact]) extends
> Entity
>
> There are characteristics that makes Activate different from Slick,
> Mapperdao, Squeryl, Hibernate, etc.
> For example: transparent persistence, optimistic locking with read and
> write validation, nested transactions, efficient memory usage, design by
> contract, migrations dsl, relational and non relational database support=
,
> mass update/delete, play framework support.
> It's a new way to do persistence: simple, highly scalable and consistent.
>
> --
> Fl=E1vio W. Brasil
> http://activate-framework.org
> {persistence as it should be}
>
> On Thursday, 1 de November de 2012 at 19:43, Konstantinos Kougios wrote:
>
> I had a look at activate, I couldn't find a complete example with say a
> many-to-many relationship between 2 entities. From the table DDL to
> mappings (if any) and some queries. Do you have a link?
>
> On 01/11/12 12:52, Rafa=B3 Krzewski wrote:
>
> W dniu czwartek, 1 listopada 2012 11:50:07 UTC+1 u=BFytkownik Konstantin=
os
> Kougios napisa=B3:
>
> There doesn't seem to be other ORM tools for Scala.
>
> Well, there is at least one other: https://github.com/fwbrasil/activate
> :)
>
> Cheers,
> Rafa=B3
>
>
>
>
>
>
>
>
--=20
Tim Pigden
Optrak Distribution Software Limited
+44 (0)1992 517100
http://www.linkedin.com/in/timpigden
http://optrak.com
Optrak Distribution Software Ltd is a limited company registered in England
and Wales.
Company Registration No. 2327613 Registered Offices: Orland House, Mead
Lane, Hertford, SG13 7AT England
This email and any attachments to it may be confidential and are intended
solely for the use of the individual to whom it is addressed. Any views or
opinions expressed are solely those of the author and do not necessarily
represent those of Optrak Distribution Software Ltd. If you are not the
intended recipient of this email, you must neither take any action based
upon its contents, nor copy or show it to anyone. Please contact the sender
if you believe you have received this email in error.
--=20
Tim Pigden
Optrak Distribution Software Limited
+44 (0)1992 517100
http://www.linkedin.com/in/timpigden
http://optrak.com
Optrak Distribution Software Ltd is a limited company registered in England
and Wales.
Company Registration No. 2327613 Registered Offices: Orland House, Mead
Lane, Hertford, SG13 7AT England
This email and any attachments to it may be confidential and are intended
solely for the use of the individual to whom it is addressed. Any views or
opinions expressed are solely those of the author and do not necessarily
represent those of Optrak Distribution Software Ltd. If you are not the
intended recipient of this email, you must neither take any action based
upon its contents, nor copy or show it to anyone. Please contact the sender
if you believe you have received this email in error.
--14dae9d253b4c9e69b04cdd56819
Content-Type: text/html; charset=ISO-8859-2
Content-Transfer-Encoding: quoted-printable
<br><div class=3D"gmail_quote">Flavio - why do you say the real data is mut=
able (other than in the database)?<div class=3D"gmail_extra"><div><div clas=
s=3D"h5"><br><br><div class=3D"gmail_quote">On 6 November 2012 15:36, Fl=E1=
vio W. Brasil <span dir=3D"ltr"><<a href=3D"mailto:fwbra...@gmail.com" t=
arget=3D"_blank">fwbra...@gmail.com</a>></span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
<div>
The point about using immutable classes in functional p=
rogramming is avoid information mutability, so you don't have to worry =
about concurrency issues. </div><div>Mapperdao classes are immutable, =
but the "real" entity (information) is mutable and can produce co=
ncurrency issues. You have a sensation of using immutable data, but will ha=
ve the same issues of mutable classes.</div>
<div>
<div><div><br></div><div>-- </div><div>Fl=E1vio W. Bra=
sil</div><div><a href=3D"http://activate-framework.org" target=3D"_blank">h=
ttp://activate-framework.org</a></div><div>{persistence as it should be}</d=
iv><div>
<br></div></div>
=20
</div><div><div><p style=3D"color:#a0a0a8">On Tuesday, 6 de=
November de 2012 at 13:11, Konstantinos Kougios wrote:</p>
<blockquote type=3D"cite" style=3D"border-left-style:solid;=
border-width:1px;margin-left:0px;padding-left:10px">
<span><div><div>
=20
=20
=20
=20
<div>Ok, I see.<br>
<br>
To answer the original post and regarding an ORM library, I think
the mapperdao tutorial is the best link :
<a href=3D"https://mapperdao-examples.googlecode.com/files/tutorial-1=
.0.0-rc15.pdf" target=3D"_blank">https://mapperdao-examples.googlecode.com/=
files/tutorial-1.0.0-rc15.pdf</a>
, which includes the entity declarations. <br>
<br>
Regarding entity declarations that might seem an overhead, I've
got a f.a.q page: <a href=3D"http://code.google.com/p/mapperdao/wiki/=
FAQ" target=3D"_blank">http://code.google.com/p/mapperdao/wiki/FAQ</a> .
They are very useful for i.e. querying i.e. (select from pe where
pe.price>10).toSet(queryDao) , compared to the String-based
HQL.<br>
<br>
Flavio, mapperdao doesn't mutate any instances, i.e. <br>
<br>
val updated=3D<span style=3D"white-space:pre-wrap"></span>mapperDao.u=
pdate(ProductEntity,inserted,Product(“newv”,”newv”)=
)<br>
<br>
updated , inserted and Product(“newv”,”newv”)=
are 3 separate
instances, none of them is mutated. mapperdao can be used in a
functional way, i.e.<br>
<br>
val l =3D List(...products)<br>
val persistedL=3Dl.map(mapperDao.insert(ProductEntity,_)) // list of
persisted products i.e. Product with SurrogateIntId<br>
<br>
l and persistedL contain different instances.<br>
<br>
On 05/11/12 22:55, Fl=E1vio W. Brasil wrote:<br>
</div><blockquote type=3D"cite"><div>
<div>Hello Konstantinos,</div>
<div><br>
</div>
<div><blockquote type=3D"cite"><div><span>
<div>
<div>
<div>Thanks for the example Flavio, ok I see. Why the
emphasis on transactional memory and efficient memory
usage? What apps are you targeting?</div>
</div>
</div>
</span></div></blockquote></div>
<div>
<div>There isn't a specific type of application that is the
Activate target. It can be used from simple embedded systems
to high performance environments.</div>
<div><br>
</div>
<div>The STM provides a powerful consistency control that is
absent in regular ORMs, including read validation. It uses
optimistic locking that permit higher transaction throughput
comparing to traditional database pessimistic approach. There
are other benefits of STM that I will not list here.</div>
<div><br>
</div>
<div>A common ORM performance bottleneck is marshal/unmarshal
entities from/to database. The usual solution for this problem
is to use caches. Normally ORMs cache implementations fail in
aspects like inconsistent reads/writes and (believe or not)
performance issues. Activate simple uses the great JVM garbage
collector to decide what entities to maintain in memory by
using soft references. The STM assures that the in-memory
information is consistent.</div>
</div>
<div><br>
</div>
<div><blockquote type=3D"cite"><div><span>
<div>
<div>
<div>Also what's your naming conventions for mapping to
the tables?</div>
</div>
</div>
</span></div></blockquote></div>
<div>Entities are mapped to the storage using their simple class
name and properties names. The 1.1 version will have annotations
that permit custom names mapping.</div>
<div><br>
</div>
<div><blockquote type=3D"cite"><div><span>
<div>
<div>
<div>mapperdao uses a different approach and your
example would look like<br>
<br>
class Stock(val code:String,val
categories:Set[Category]) // or List[Category] etc<br>
class Category(val name:String,val stocks:Set[Stock])<br>
<br>
You can too use an intermediate StockCategory entity
if you prefer.</div>
</div>
</div>
</span></div></blockquote></div>
<div>I'm assuming that there is a separate entity declaration tha=
t
is not in your email, right?</div>
<div><br>
</div>
<div><blockquote type=3D"cite"><div><span>
<div>
<div>
<div>MapperDao gives direct control on persistence and
transactions to client code, i.e.<br>
<br>
val tx =3D Transaction.get(txManager,
Propagation.Nested, Isolation.ReadCommited, -1) <br>
// will insert category and insert/update related
Stock in 1 transaction<br>
val inserted =3D tx { () =3D> <br>
mapperDao.insert(CategoryEntity, categ=
ory) <br>
} <br>
<br>
MapperDao supports nested transactions too along with
updates/deletes. </div>
</div>
</div>
</span></div></blockquote></div>
<div>
<div>Interesting, you are using spring implementation that uses
savepoints to do nested transactions. The only difference from
Activate is that the mapperdao nested transaction will use the
database pessimistic locking approach.</div>
<div><br>
</div>
<div><blockquote type=3D"cite"><div><span>
<div>
<div>
<div>All web frameworks are supported as mapperdao
only needs a DataSource to work.</div>
</div>
</div>
</span></div></blockquote></div>
<div>Activate also supports all web frameworks. There is a Play
module that has some glue code to make the integration easier.</d=
iv>
</div>
<div><br>
</div>
<div><blockquote type=3D"cite"><div><span>
<div>
<div>
<div>A major feature of mapperdao is support for
immutable classes, something that i.e. hibernate
doesn't support, along with a typesafe DSL for
querying.</div>
</div>
</div>
</span></div></blockquote></div>
<div>
<div>Seems to me that Mapperdao immutable entities hide a
"veiled" mutability. An example using Mapperdao:</div>
<div><br>
</div>
<div><span style=3D"white-space:pre-wrap"> case
class Product(val title: String, val description: String)</span=
></div>
<div>
<div><span style=3D"white-space:pre-wrap"> </span>val
inserted=3DmapperDao.insert(ProductEntity,Product(“title”,&rdqu=
o;desc”))</div>
<div><span style=3D"white-space:pre-wrap"> </span>mapperDao.updat=
e(ProductEntity,inserted,Product(“newv”,”newv”))</d=
iv>
</div>
<div><br>
</div>
<div>The Product class is immutable, but the Product entity
instance isn't. The "inserted" entity is modified t=
o have
values "newv". If there is a concurrent transaction the=
entity
instance can stay inconsistent. This veiled mutability looks
dangerous to me.</div>
<div><br>
</div>
<div>-- </div>
<div>Fl=E1vio W. Brasil</div>
<div><a href=3D"http://activate-framework.org" target=3D"_blank">ht=
tp://activate-framework.org</a></div>
<div>{persistence as it should be}</div>
<div><br>
</div>
</div>
<p style=3D"color:#a0a0a8">On Friday, 2 de November de 2012 at
19:58, Konstantinos Kougios wrote:</p><blockquote type=3D"cite"><di=
v>
<span>
<div>
<div>
=20
<div>Thanks for the example Flavio, ok I see. Why the
emphasis on transactional memory and efficient memory
usage? What apps are you targeting? Also what's y=
our
naming conventions for mapping to the tables?<br>
<br>
mapperdao uses a different approach and your example
would look like<br>
<br>
class Stock(val code:String,val
categories:Set[Category]) // or List[Category] etc<br>
class Category(val name:String,val stocks:Set[Stock])<br>
<br>
You can too use an intermediate StockCategory entity if
you prefer.<br>
<br>
MapperDao gives direct control on persistence and
transactions to client code, i.e.<br>
<br>
val tx =3D Transaction.get(txManager, Propagation.Nested,
Isolation.ReadCommited, -1) <br>
// will insert category and insert/update related Stock
in 1 transaction<br>
val inserted =3D tx { () =3D> <br>
mapperDao.insert(CategoryEntity, categor=
y) <br>
} <br>
<br>
MapperDao supports nested transactions too along with
updates/deletes. All web frameworks are supported as
mapperdao only needs a DataSource to work. A major
feature of mapperdao is support for immutable classes,
something that i.e. hibernate doesn't support, along
with a typesafe DSL for querying.<br>
<br>
On 02/11/12 20:06, Fl=E1vio W. Brasil wrote:<br>
</div><blockquote type=3D"cite"><div>
<div>
<div>
<div>Hello.</div>
<div><br>
</div>
<div>Activate is designed to be simple. OO
is straightforward to map data and relation=
s.
Instead of trying to create a magical relational
many-to-many concept, you do as should do in OO:
create a relation entity.</div>
<div><br>
</div>
<div><span style=3D"white-space:pre-wrap"> </span>class
Stock(var code: String) extends Entity {</div>
<div><span style=3D"white-space:pre-wrap"> </span>def
categories =3D select[StockCategory].where(_.stock
:=3D=3D this).map(_.category)</div>
<div><span style=3D"white-space:pre-wrap"> </span>}</di=
v>
<div><span style=3D"white-space:pre-wrap"> </span>class
Category(var name: String) extends Entity {</div>
<div><span style=3D"white-space:pre-wrap"> </span>def
stocks =3D select[StockCategory].where(_.category
:=3D=3D this).map(_.stock)</div>
<div><span style=3D"white-space:pre-wrap"> </span>}</di=
v>
<div><span style=3D"white-space:pre-wrap"> </span>case
class StockCategory(stock: Stock, category:
Category) extends Entity</div>
<div><br>
</div>
<div>To map the same domain using separate entity
declaration and "implicit" many-to-many rel=
ation
you have to produce much more code. Activate 1.1
version (to be released this month) has support
for Lists too:</div>
<div><br>
</div>
<div><span style=3D"white-space:pre-wrap"> </span>class
Person(var name: String, var contacts:
List[Contact]) extends Entity</div>
<div><br>
</div>
<div>There are characteristics that makes Activate
different from Slick, Mapperdao, Squeryl,
Hibernate, etc.</div>
<div>For example: transparent persistence,
optimistic locking with read and write validation,
nested transactions, efficient memory usage,
design by contract, migrations dsl, relational
and non relational database support, mass
update/delete, play framework support. </div>
<div>It's a new way to do persistence: simple,
highly scalable and consistent. </div>
</div>
<div>
<div><br>
</div>
<div>-- </div>
<div>Fl=E1vio W. Brasil</div>
<div><a href=3D"http://activate-framework.org" target=
=3D"_blank">http://activate-framework.org</a></div>
<div>{persistence as it should be}</div>
<div><br>
</div>
</div>
<p style=3D"color:#a0a0a8">On Thursday, 1 de November
de 2012 at 19:43, Konstantinos Kougios wrote:</p><block=
quote type=3D"cite"><div>
<div> <span>
<div>
<div>
=20
<div>I had a look at activate, I couldn't
find a complete example with say a
many-to-many relationship between 2
entities. From the table DDL to mappings
(if any) and some queries. Do you have a
link?<br>
<br>
On 01/11/12 12:52, Rafa=B3 Krzewski wrote:<br=
>
</div><blockquote type=3D"cite"><div>
<div>
<div>W dniu czwartek, 1 listopada 2012
11:50:07 UTC+1 u=BFytkownik Konstantinos
Kougios napisa=B3:
<blockquote type=3D"cite"><div>
<div>
<div>There doesn't seem to be
other ORM tools for Scala. <br=
>
<br>
</div>
</div>
</div></blockquote><div><span style=3D"fo=
nt-family:'Helvetica neue',Arial,Verdana,sans-serif;line-height:17p=
x">Well,
there is at least one other: </s=
pan><span><a href=3D"https://github.com/fwbrasil/activate" target=3D"_blank=
">https://github.com/fwbrasil/activate</a></span> :)</div>
<div><br>
</div>
<div>Cheers,</div>
<div>Rafa=B3</div>
<div><br>
</div>
</div>
</div>
</div></blockquote><br>
</div>
</div>
</span> </div>
</div></blockquote><div> <br>
</div>
</div>
</div></blockquote><br>
</div>
</div>
</span> </div></blockquote><div> <br>
</div>
</div></blockquote><br>
=20
</div></div></span>
=20
=20
=20
=20
</blockquote>
=20
<div>
<br>
</div>
</div></div></blockquote></div><br><br clear=3D"all"><div><br><=
/div></div></div><div class=3D"im">-- <br><span style=3D"font-family:Verdan=
a,arial,Helvetica,sans-serif;font-size:12px">Tim Pigden<br>Optrak Distribut=
ion Software Limited<br>
<a href=3D"tel:%2B44%20%280%291992%20517100" value=3D"+441992517100" target=
=3D"_blank">+44 (0)1992 517100</a><br>
<a href=3D"http://www.linkedin.com/in/timpigden" target=3D"_blank">http://w=
ww.linkedin.com/in/timpigden</a><br><a href=3D"http://optrak.com/" target=
=3D"_blank">http://optrak.com</a><br><small><small>Optrak Distribution Soft=
ware Ltd is a limited company registered in England and Wales.<br>
Company Registration No. 2327613 Registered Offices: Orland House, Mead Lan=
e, Hertford, SG13 7AT England <br>This email and any attachments to it=
may be confidential and are intended solely for the use of the individual =
to whom it is addressed. Any views or opinions expressed are solely those o=
f the author and do not necessarily represent those of Optrak Distribution =
Software Ltd. If you are not the intended recipient of this email, you must=
neither take any action based upon its contents, nor copy or show it to an=
yone. Please contact the sender if you believe you have received this email=
in error.</small></small></span><br>
</div></div>
</div><br><br clear=3D"all"><div><br></div>-- <br><span style=3D"font-famil=
y:Verdana,arial,Helvetica,sans-serif;font-size:12px">Tim Pigden<br>Optrak D=
istribution Software Limited<br>+44 (0)1992 517100<br><a href=3D"http://www=
.linkedin.com/in/timpigden" target=3D"_blank">http://www.linkedin.com/in/ti=
mpigden</a><br>
<a href=3D"http://optrak.com/" target=3D"_blank">http://optrak.com</a><br><=
small><small>Optrak Distribution Software Ltd is a limited company register=
ed in England and Wales.<br>Company Registration No. 2327613 Registered Off=
ices: Orland House, Mead Lane, Hertford, SG13 7AT England <br>
This email and any attachments to it may be confidential and are intended s=
olely for the use of the individual to whom it is addressed. Any views or o=
pinions expressed are solely those of the author and do not necessarily rep=
resent those of Optrak Distribution Software Ltd. If you are not the intend=
ed recipient of this email, you must neither take any action based upon its=
contents, nor copy or show it to anyone. Please contact the sender if you =
believe you have received this email in error.</small></small></span><br>
--14dae9d253b4c9e69b04cdd56819--