This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new ProposalMapping( | |
executionDate = None, | |
commencementDate = None, | |
expirationDate = None, | |
freeMonths = None, | |
leaseTerm = None | |
) | |
new ProposalMapping( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Entity representing mapping of comp proposal from XLS column names. | |
* | |
* @author FS | |
*/ | |
// Please preserve attribute order when defining a new mapping | |
class ProposalMapping( | |
// Date | |
val executionDate: Option[String], | |
val commencementDate: Option[String], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Ugly one-liner: type is in the middle of the line, implementation takes less than half a line | |
// Pain! | |
implicit class RichSsWorkbook(wb: Workbook) { | |
def apply(i: Int): Sheet = wb.getSheetAt(i) | |
def bytes: Array[Byte] = { | |
val baos = new ByteArrayOutputStream | |
wb.write(baos) | |
baos.toByteArray | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait Parsers { | |
type Elem | |
type Input = Reader[Elem] | |
sealed abstract class ParseResult[+T] { | |
... | |
} | |
case class Success[+T](result: T, override val next: Input) extends ParseResult[T] { | |
... | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait A { | |
val a: Int | |
} | |
trait B extends A { | |
println(a) | |
} | |
trait C extends A { | |
override val a: Int = 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT status_temp.id FROM ( | |
SELECT temp_batch.original_id as id, temp_batch.validation_errors, COUNT(temps_enabled.id), COUNT(temps_disabled.id) | |
FROM comp_proposal_raw_temp_batch temp_batch | |
LEFT OUTER JOIN comp_proposal_raw temps_enabled | |
ON temps_enabled.temp_batch_id = temp_batch.id AND temps_enabled.dont_integrate = 0 | |
LEFT OUTER JOIN comp_proposal_raw temps_disabled | |
ON temps_disabled.temp_batch_id = temp_batch.id AND temps_disabled.dont_integrate = 1 | |
GROUP BY temp_batch.original_id | |
HAVING (COUNT(temps_enabled.id) = 0 AND COUNT(temps_disabled.id) > 0) OR temp_batch.validation_errors > 0 | |
) status_temp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Generated by Slick (select terms optimized for clarity) | |
# Takes 47034 ms | |
SELECT * | |
FROM ( | |
SELECT x281.id | |
FROM `comp_proposal_raw_batch_comp_proposal_raw` x282, `comp_proposal_raw` x281 | |
WHERE (x282.`comp_proposal_raw_batch_proposals_id` = 4936) AND (x281.`id` = x282.`comp_proposal_raw_id`) | |
) x187 | |
INNER JOIN ( | |
SELECT * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Merge: | |
z | |
|\ | |
| g | |
x | | | |
| * | | |
| | f | |
| * | | |
| * | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import test.* | |
Parent.withNewSession { | |
Parent.withNewTransaction { | |
def parent = new Parent() | |
.addToChildren(new Child(name: "a")) | |
.addToChildren(new Child(name: "b")) | |
.addToChildren(new Child(name: "c")) | |
.save(failOnError: true) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait Foo { self => | |
type SelfType <: Foo { | |
type SelfType = self.SelfType | |
} | |
} | |
// SelfType points to its child type | |
trait FooExtLvl1 extends Foo { | |
type SelfType = FooExtLvl2 | |
} |
OlderNewer