flush()的FlushModeType

Persistence Context

EntityManager的flush()執行時機可能在:

* flush()的FlushModeType預設是AUTO時:
o 如果是Transaction-scoped EntityManager,在交 易確認時會flush()。
o 如果是Extended-scoped EntityManager,或者Application-Managed EntityManager,則是在EntityManager關閉時flush()。
* 如果查詢某個實體前,該實體有變動,則會先flush()再進行查詢。
* 主動呼叫EntityManager的flush()方法

how to draw text with frame box

how to draw text with frame box in JasperReport

<textField pattern="">
<reportElement mode="Transparent" x="3″ y="3″ width="124″ height="16″ forecolor="#000000″ backcolor="#FFFFFF"/>
<box>
<pen lineWidth="0.5″/>
<topPen lineWidth="0.5″/>
<leftPen lineWidth="0.5″/>
<bottomPen lineWidth="0.5″/>
<rightPen lineWidth="0.5″/>
</box>
<textElement markup="none">
<font fontName="Times New Roman" size="9″ isBold="false"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$F{field1}]]></textFieldExpression>
</textField>

AppServ 移轉到CentOS 5.3

Centos 5.3 i386
基本安裝, 也沒勾server選項
安裝其它軟體
yum install php
yum install php-gd
yum install php-mysql
yum install mysql-server
yum install php-mbstring

安裝vmware tools
rpm -ivh VMwareTools-7.7.5-156745.i386.rpm
然後跟著提示打
/usr/bin/vmware-config-tools.pl

路徑
mysql data
/var/lib/mysql

www
/var/www/html

add follow to /etc/my.cf,  因為有些資料沒有設default character set , 所以
直接copy檔案的話, 其db的default character會變成latin
[mysql]
default-character-set = utf8

[mysqld]

default-character-set = utf8
character-set-server = utf8
collation-server = utf8_general_ci
init_connect = ‘SET collation_connection = utf8_general_ci’
init_connect = ‘SET NAMES utf8’

更改etc/php.ini
display_error = on
register_global = on
include_path = “.:/php/includes;/var/www/html/FastTemplate"

JUnit for Jasper Reports Finally

Flexing Your Code: JUnit for Jasper Reports

JUnit for Jasper Reports
Finally … today I had a chance, between hectic schedules, to write our first JUnit for Jasper reports. GOOGLE wasn’t friendly this time, so had a clean canvas to work from :)

The repeating hurdle I faced was that I’m required to design and develop a report well before any of the database structures or data is captured within the system. It’s like trying to extract a report on something that doesn’t exist yet … how funny …