DetriusXii
unread,Aug 2, 2011, 3:37:59 PM8/2/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to squeryl-contributors
Anyways, when defining a many-to-many relation, the table gets defined
into the Postgres public schema rather than the schema I want it to be
defined at.
Currently, the trait org.squeryl.dsl.QueryDsl has the following two
functions
def manyToManyRelation[L <: KeyedEntity[_],R <: KeyedEntity[_],A <:
KeyedEntity[_]](l: Table[L], r: Table[R]) = new
ManyToManyRelationBuilder(l,r,None)
def manyToManyRelation[L <: KeyedEntity[_],R <: KeyedEntity[_],A <:
KeyedEntity[_]](l: Table[L], r: Table[R], nameOfMiddleTable: String) =
new ManyToManyRelationBuilder(l,r,Some(nameOfMiddleTable))
I'd like a third manyToManyRelation to be defined
def manyToManyRelation[L <: KeyedEntity[_],R <: KeyedEntity[_],A <:
KeyedEntity[_]](l: Table[L], r: Table[R], nameOfMiddleTable: String,
prefix: String) = new
ManyToManyRelationBuilder(l,r,Some(nameOfMiddleTable), Some(prefix))
The constructor for class ManyToManyRelationBuilder[L <:
KeyedEntity[_], R <: KeyedEntity[_]](l: Table[L], r: Table[R],
nameOverride: Option[String], schemaOverride : Option[String])
The constructor for class class ManyToManyRelationImpl[L <:
KeyedEntity[_],
R <: KeyedEntity[_],
A <: KeyedEntity[_]](val leftTable:
Table[L],
val rightTable:
Table[R],
aClass: Class[A],
f: (L,R,A)=>
Pair[EqualityExpression,EqualityExpression],
schema: Schema,
nameOverride:
Option[String],
schemaOverride:
Option[String])
class ManyToManyRelationImpl[L <: KeyedEntity[_],
R <: KeyedEntity[_],
A <: KeyedEntity[_]](val leftTable:
Table[L],
val rightTable:
Table[R],
aClass: Class[A],
f: (L,R,A)=>
Pair[EqualityExpression,EqualityExpression],
schema: Schema,
nameOverride:
Option[String],
schemaOverride:
Option[String])
extends Table[A]
(nameOverride.getOrElse(schema.tableNameFromClass(aClass)), aClass,
schema, schemaOverride) with ManyToManyRelation[L,R,A]
It's just gives the ability to handle custom schemas in Postgres
properly.