Last change
on this file since 26 was
26,
checked in by fmguler, 14 years ago
|
Refs #3 - Ven.save() is transferred to the new package. Save use case is completed. Convert.toDB() converts camel case object names to database names with underscores. Unchecked VenException is thrown by Ven methods. Liquibase changelog (test-db-changelog.xml) is changed to include only a simple object to test save operation. It creates a sample database table and inserts a sample row. On rollback it removes sample data. Using liquibase, Sample.java builds database, tests save operation and rolls back.
QueryGenerator generates insert and update queries for save and generates sequence query to assign ids to new objects. Ven calls query generator and runs the query using spring jdbc template.
Old codebase updated to run at Java 1.4
|
File size:
1.2 KB
|
Line | |
---|
1 | /* |
---|
2 | * Cevir.java |
---|
3 | * |
---|
4 | * Created on December 18, 2006, 10:51 AM |
---|
5 | * (4.12.06 tarihli SpringDaoDeneme çalışmasından derlenmiştir) |
---|
6 | * |
---|
7 | * Ven - Ayar Yerine Gelenek veritabanı erişim nesnesi |
---|
8 | */ |
---|
9 | |
---|
10 | package net.fmg.ven.arac; |
---|
11 | |
---|
12 | import java.util.Locale; |
---|
13 | |
---|
14 | /** |
---|
15 | * Deve harflerle yazılmış metni veritabanı şekline çevirir |
---|
16 | * @author Fatih Mehmet Güler |
---|
17 | */ |
---|
18 | public class Cevir { |
---|
19 | |
---|
20 | /** Creates a new instance of Cevir */ |
---|
21 | public Cevir() { |
---|
22 | } |
---|
23 | |
---|
24 | public static String vt(String deve){ |
---|
25 | if (deve.equals("")) return ""; |
---|
26 | StringBuffer sonuc = new StringBuffer(); |
---|
27 | sonuc.append(deve.substring(0,1).toLowerCase(Locale.ENGLISH)); |
---|
28 | for (int i = 1; i < deve.length(); i++) { |
---|
29 | String ki = deve.substring(i,i+1); |
---|
30 | String kiKucuk = ki.toLowerCase(Locale.ENGLISH); |
---|
31 | if (!ki.equals(kiKucuk)){ |
---|
32 | sonuc.append("_"+kiKucuk); |
---|
33 | }else sonuc.append(ki); |
---|
34 | } |
---|
35 | return sonuc.toString(); |
---|
36 | } |
---|
37 | |
---|
38 | public static String isim(String isim) { |
---|
39 | int i = isim.lastIndexOf("."); |
---|
40 | if (i < 0) return isim; |
---|
41 | return isim.substring(i + 1); |
---|
42 | } |
---|
43 | |
---|
44 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.