
List result = query.from(customer) //customer: Domain object
.where(customer.lastName.like("A%"), customer.active.eq(true)) //BooleanExpression x2
.orderBy(customer.lastName.asc(), customer.firstName.desc()) //OrderSpecifier x2
.list(customer);
JPAQuery qFrom = query.from(nn);
JPAQuery qFromWhere = qFrom.where(mm);
JPAQuery qFromWhereOrder = qFromWhere.orderBy(oo);
List result = qFromWhereOrder.list(customer);
$("span").fadeIn("slow").text("Alert!");
module Main where main :: IO () main = putStrLn "Hello, World!" -- Type annotation (optional) factorial :: Integer -> Integer -- Using recursion factorial 0 = 1 factorial n | n > 0 = n * factorial (n - 1)| otherwise = error "No negs plz." -- Using fold (implements product) factorial' n = foldl1 (*) [1..n]data TrafficLight = Red | Yellow | Greentype Name = Stringdata Person = Person { firstName :: Name , lastName :: Name , age :: Int } deriving Show
-- class is kind of like interface in Javaclass YesNo a whereyesno :: a -> Bool-- instances are the implementing part for some typeinstance YesNo Int whereyesno 0 = Falseyesno _ = Trueinstance YesNo [a] whereyesno [] = Falseyesno _ = True
class Monad m where -- chain, bind (>>=) :: m a -> (a -> m b) -> m b -- inject, wrapper, pure return :: a -> m afoo :: (Monad m) => Int -> m Intbar :: (Monad m) => Int -> m Boolreturn 1 >>= foo >>= bar
-- With 'concrete' State monadfoo' :: Int -> MyState Intfoo' x = doput xreturn x + xbar' :: Int -> MyState Boolbar' y = doxFromState <- getreturn y * xFromState > 10stuff :: MyState Boolstuff = return 1 >>= foo' >>= bar'doStuff :: MyState BooldoStuff = dox <- foo' 1z <- bar' xreturn z-- foo' 1 --> MyState 2 (1) --> bar' 2 --> MyState False (1)