Your SlideShare is downloading. ×
  • Like
20090522 Scalaユーザー会#1
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Now you can save presentations on your phone or tablet

Available for both IPhone and Android

Text the download link to your phone

Standard text messaging rates apply

20090522 Scalaユーザー会#1

  • 1,135 views
Published

 

Published in Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
1,135
On SlideShare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
23
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. 2009 5 22
  • 2. • • • • 2009 5 22
  • 3. 2009 5 22
  • 4. • • • • 2009 5 22
  • 5. • • • • • 2009 5 22
  • 6. 2009 5 22
  • 7. 2009 5 22
  • 8. 2009 5 22
  • 9. 2009 5 22
  • 10. 2009 5 22
  • 11. 2009 5 22
  • 12. 2009 5 22
  • 13. • • • • 2009 5 22
  • 14. 2009 5 22
  • 15. • • • 2009 5 22
  • 16. • • • • 2009 5 22
  • 17. 2009 5 22
  • 18. • 2009 5 22
  • 19. • • 2009 5 22
  • 20. • • • 2009 5 22
  • 21. • • • • 2009 5 22
  • 22. 2009 5 22
  • 23. 2009 5 22
  • 24. 2009 5 22
  • 25. 2009 5 22
  • 26. • • • • 2009 5 22
  • 27. 2009 5 22
  • 28. • <p><lift:helloWorld.howdy
/></p> class
HelloWorld
{ 

def
howdy
=
<span>Welcome
to
helloworld
at
 {new
_root_.java.util.Date}</span> } 2009 5 22
  • 29. • 2009 5 22
  • 30. • 2009 5 22
  • 31. • 2009 5 22
  • 32. • <p> 

<lift:helloWorld.howdy
/> </p> 2009 5 22
  • 33. • class
HelloWorld
{ 

def
howdy
=
 






<span> 







Welcome
to
helloworld
at
 








{new
_root_.java.util.Date} 





</span> } 2009 5 22
  • 34. • <lift:SampleSnipet.add
form=quot;POSTquot;> 



<entry:description
/>
 



<entry:amount
/>
<br
/> 



<entry:submit
/> </lift:
SampleSnipet.add
> 2009 5 22
  • 35. • class
SampleSnipet
 


def
add
(xhtml
:
NodeSeq)
:
NodeSeq
=
{ 







var
desc
=
quot;quot; 







var
amount
=
quot;0quot; 







def
processEntryAdd
()
{
...
} 







bind(quot;entryquot;,
xhtml, 











quot;descriptionquot;
->
SHtml.text(desc,
desc
=
_), 











quot;amountquot;
->
SHtml.text(amount,
amount
=
_), 











quot;submitquot;
->
SHtml.submit(Add,
 

















processEntryAdd)) 



} } 2009 5 22
  • 36. 2009 5 22
  • 37. • • • • • 2009 5 22
  • 38. • ‣ ‣ ‣ • ‣ ‣ ‣ 2009 5 22
  • 39. • class
Expense
extends
LongKeyedMapper[Expense]
with
IdPK
{ 


def
getSingleton
=
Expense 


object
dateOf
extends
MappedDateTime(this) 


object
description
extends
MappedString(this,100) 


object
amount
extends
MappedDecimal(this, 








MathContext.DECIMAL64,
2) 


object
account
extends
 





MappedLongForeignKey(this,
Account) } 2009 5 22
  • 40. • object
Expense
extends
Expense
with
 LongKeyedMetaMapper[Expense]
{ override
def
fieldOrder
=
 




List(dateOf,
description,
amount) } 2009 5 22
  • 41. • val
myEntries1
=
Expense.findAll

 val
myEntries2
=
Expense.findAll(By_>(Expense.amout,5)
)
 val
recentEntries
=
Expense.findAll( 

BySql(quot;dateOf
>
(CURRENT_DATE
-
interval
’30
days’)quot;, 

IHaveValidatedThisSQL(quot;dchenbeckerquot;,quot;2008-12-03quot;)) 2009 5 22
  • 42. • var
myEntr=
Expense.create myEntry.dateOf(new
Date).description(quot;A
sample
entryquot;) myEntry.amount(BigDecimal(quot;127.20quot;)) myEntry.save myEntry.delete 2009 5 22
  • 43. 2009 5 22
  • 44. • • • • 2009 5 22
  • 45. 2009 5 22
  • 46. • • • • 2009 5 22
  • 47. • • • 2009 5 22
  • 48. 2009 5 22
  • 49. 2009 5 22
  • 50. 2009 5 22