SlideShare uma empresa Scribd logo
1 de 50
Baixar para ler offline
2009   5   22
•
                •

                •
                •

2009   5   22
2009   5   22
•
                •
                •
                •



2009   5   22
•
                •
                •
                •

                •
2009   5   22
2009   5   22
2009   5   22
2009   5   22
2009   5   22
2009   5   22
2009   5   22
2009   5   22
•
           •
           •
           •
2009   5   22
2009   5   22
•
           •
           •

2009   5   22
•
           •
           •
           •

2009   5   22
2009   5   22
•



2009   5   22
•


           •
2009   5   22
•

           •
           •
2009   5   22
•
           •
           •
           •
2009   5   22
2009   5   22
2009   5   22
2009   5   22
2009   5   22
•
           •
           •
           •
2009   5   22
2009   5   22
•
                    <p><lift:helloWorld.howdy
/></p>




                class
HelloWorld
{

                

def
howdy
=
<span>Welcome
to
helloworld
at

                {new
_root_.java.util.Date}</span>

                }



2009   5   22
•



2009   5   22
•




2009   5   22
•


2009   5   22
•
                <p>
                

<lift:helloWorld.howdy
/>
                </p>




2009   5   22
•
                class
HelloWorld
{
                

def
howdy
=

                






<span>
                







Welcome
to
helloworld
at

                








{new
_root_.java.util.Date}
                





</span>
                }


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



<entry:description
/>

                



<entry:amount
/>
<br
/>
                



<entry:submit
/>
                </lift:
SampleSnipet.add
>


2009   5   22
•
                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
2009   5   22
•
           •
           •
                •
           •
2009   5   22
•
            ‣
            ‣
            ‣

       •
            ‣
            ‣
            ‣

2009   5   22
•
       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
•
           object
Expense
extends
Expense
with

           LongKeyedMetaMapper[Expense]
{
           override
def
fieldOrder
=

           




List(dateOf,
description,
amount)
           }




2009   5   22
•
                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
•
                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
2009   5   22
•
           •

           •
           •

2009   5   22
2009   5   22
•
           •

           •
           •
2009   5   22
•
           •
           •

2009   5   22
2009   5   22
2009   5   22
2009   5   22

Mais conteúdo relacionado

Destaque

新北市新幸福系列:老人照顧(修正版) 0827
新北市新幸福系列:老人照顧(修正版) 0827新北市新幸福系列:老人照顧(修正版) 0827
新北市新幸福系列:老人照顧(修正版) 0827jessie0203
 
20090613 Seasar Conference2009 Spring
20090613 Seasar Conference2009 Spring20090613 Seasar Conference2009 Spring
20090613 Seasar Conference2009 SpringTomohito Ozaki
 
Shibuya.Trac.0.11 Tracとバグ収束曲線?
Shibuya.Trac.0.11 Tracとバグ収束曲線?Shibuya.Trac.0.11 Tracとバグ収束曲線?
Shibuya.Trac.0.11 Tracとバグ収束曲線?Tomohito Ozaki
 
2016技職高教政策(定稿)
2016技職高教政策(定稿)2016技職高教政策(定稿)
2016技職高教政策(定稿)jessie0203
 
2016十二年國教(定稿)
2016十二年國教(定稿)2016十二年國教(定稿)
2016十二年國教(定稿)jessie0203
 
java-ja 第1回 チキチキ『( ゜ェ゜)・;’.、ゴフッ』 - Visitor
java-ja 第1回 チキチキ『( ゜ェ゜)・;’.、ゴフッ』 - Visitorjava-ja 第1回 チキチキ『( ゜ェ゜)・;’.、ゴフッ』 - Visitor
java-ja 第1回 チキチキ『( ゜ェ゜)・;’.、ゴフッ』 - VisitorTomohito Ozaki
 
20081128 Bp Study#15 Active Record
20081128 Bp Study#15 Active Record20081128 Bp Study#15 Active Record
20081128 Bp Study#15 Active RecordTomohito Ozaki
 
20091008 Jjug Ccc 2009fall
20091008 Jjug Ccc 2009fall20091008 Jjug Ccc 2009fall
20091008 Jjug Ccc 2009fallTomohito Ozaki
 
20081115 Scala勉強会東京#2
20081115 Scala勉強会東京#220081115 Scala勉強会東京#2
20081115 Scala勉強会東京#2Tomohito Ozaki
 
java-ja 第1回 チキチキ『( ゜ェ゜)・;’.、ゴフッ』 - Interpreter
java-ja 第1回 チキチキ『( ゜ェ゜)・;’.、ゴフッ』 - Interpreterjava-ja 第1回 チキチキ『( ゜ェ゜)・;’.、ゴフッ』 - Interpreter
java-ja 第1回 チキチキ『( ゜ェ゜)・;’.、ゴフッ』 - InterpreterTomohito Ozaki
 
20090911 Seasar Conference2009 Autumn
20090911 Seasar Conference2009 Autumn20090911 Seasar Conference2009 Autumn
20090911 Seasar Conference2009 AutumnTomohito Ozaki
 
20120804 ll decade lt_yuroyoro
20120804 ll decade lt_yuroyoro20120804 ll decade lt_yuroyoro
20120804 ll decade lt_yuroyoroTomohito Ozaki
 
これまでのScala これからのScala (20100904 Scala座#01 )
これまでのScala これからのScala (20100904 Scala座#01 )これまでのScala これからのScala (20100904 Scala座#01 )
これまでのScala これからのScala (20100904 Scala座#01 )Tomohito Ozaki
 
20090306 Wicket勉強会第2回
20090306 Wicket勉強会第2回20090306 Wicket勉強会第2回
20090306 Wicket勉強会第2回Tomohito Ozaki
 

Destaque (15)

新北市新幸福系列:老人照顧(修正版) 0827
新北市新幸福系列:老人照顧(修正版) 0827新北市新幸福系列:老人照顧(修正版) 0827
新北市新幸福系列:老人照顧(修正版) 0827
 
20090613 Seasar Conference2009 Spring
20090613 Seasar Conference2009 Spring20090613 Seasar Conference2009 Spring
20090613 Seasar Conference2009 Spring
 
Shibuya.Trac.0.11 Tracとバグ収束曲線?
Shibuya.Trac.0.11 Tracとバグ収束曲線?Shibuya.Trac.0.11 Tracとバグ収束曲線?
Shibuya.Trac.0.11 Tracとバグ収束曲線?
 
2016技職高教政策(定稿)
2016技職高教政策(定稿)2016技職高教政策(定稿)
2016技職高教政策(定稿)
 
2016十二年國教(定稿)
2016十二年國教(定稿)2016十二年國教(定稿)
2016十二年國教(定稿)
 
java-ja 第1回 チキチキ『( ゜ェ゜)・;’.、ゴフッ』 - Visitor
java-ja 第1回 チキチキ『( ゜ェ゜)・;’.、ゴフッ』 - Visitorjava-ja 第1回 チキチキ『( ゜ェ゜)・;’.、ゴフッ』 - Visitor
java-ja 第1回 チキチキ『( ゜ェ゜)・;’.、ゴフッ』 - Visitor
 
20081128 Bp Study#15 Active Record
20081128 Bp Study#15 Active Record20081128 Bp Study#15 Active Record
20081128 Bp Study#15 Active Record
 
20091008 Jjug Ccc 2009fall
20091008 Jjug Ccc 2009fall20091008 Jjug Ccc 2009fall
20091008 Jjug Ccc 2009fall
 
20081115 Scala勉強会東京#2
20081115 Scala勉強会東京#220081115 Scala勉強会東京#2
20081115 Scala勉強会東京#2
 
java-ja 第1回 チキチキ『( ゜ェ゜)・;’.、ゴフッ』 - Interpreter
java-ja 第1回 チキチキ『( ゜ェ゜)・;’.、ゴフッ』 - Interpreterjava-ja 第1回 チキチキ『( ゜ェ゜)・;’.、ゴフッ』 - Interpreter
java-ja 第1回 チキチキ『( ゜ェ゜)・;’.、ゴフッ』 - Interpreter
 
20090622 Bp Study#22
20090622 Bp Study#2220090622 Bp Study#22
20090622 Bp Study#22
 
20090911 Seasar Conference2009 Autumn
20090911 Seasar Conference2009 Autumn20090911 Seasar Conference2009 Autumn
20090911 Seasar Conference2009 Autumn
 
20120804 ll decade lt_yuroyoro
20120804 ll decade lt_yuroyoro20120804 ll decade lt_yuroyoro
20120804 ll decade lt_yuroyoro
 
これまでのScala これからのScala (20100904 Scala座#01 )
これまでのScala これからのScala (20100904 Scala座#01 )これまでのScala これからのScala (20100904 Scala座#01 )
これまでのScala これからのScala (20100904 Scala座#01 )
 
20090306 Wicket勉強会第2回
20090306 Wicket勉強会第2回20090306 Wicket勉強会第2回
20090306 Wicket勉強会第2回
 

20090522 Scalaユーザー会#1

  • 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