Hibernatte sorgu yazarken HQL dediğimiz özel bir dil kullanıyoruz.(Hibernate Query Language).
Sorgulama yaparken sorgunun içine "?" veya ":parametreismi" formatında değişken alanlar vererek, dışarıdan dinamik sorgu parametreleri kullanabiliyoruz:
Örnek Hql Sorgusu:
Query query = session.createSQLQuery(
"select u.urun_kod from urun u where u.urun_kod = :urunKod")
.setParameter("urunKod", "21");
List result = query.list();
Hibernate içinde kullanabileceğiniz örnek sql sorgusu:
Query query = this.getCurrentSession().createSQLQuery("SELECT count(URUN.ID) "
+ " FROM URUN"
+ " WHERE URUN.URUN_NO = :urunNo "
+ " AND URUN.ID != :urunId ");
query.setParameter("urunNo", String.valueOf(urunNo) );
query.setParameter("urunId", (int) urunId);
2 Eylül 2014 Salı
HttpServletResponse veya HttpSession cannot be resolved to a type HATASI:
Bu hatayı alıyorsak öncelikli olarak projemizde tomcatin olup olmadığına bakmamız gerekli servers sekmesinden.Çünkü bu tomcatin içindeki servlet-api,jar'a bağlı bir nesne.Ve tomcat olmadığı için dolayısıyla da jar olmadığı içn proje bu nesneyi bulamıyor.Eğer kurulu değilse:
1)Project > Properties > Java Build Path > Libraries > Add library from library tab > Choose server runtime > Next > choose Apache Tomcat v 7.0 > Finish > Ok
Eğer buna rağmen hala hata veryorsa veya zaten bi tomcat varsa projede bu durumda Project Properties'de tomcatiniz seçili olmamış olabililr.
2)Project->Properties->Targeted Runtimes burdan tomcatinizi seçip aply dediğinizde.
Nesnelerin projenizde yer aldığını tanımlanabildiğini göreceksiniz..
14 Mayıs 2014 Çarşamba
İNTERNET EXPLORER'DA DEFAULT OLARAK GELEN SÜRÜMÜ JSP'DE DEĞİŞTİRMEK/HOW CAN WE CHANGE DEFAULT INTERNET EXPLORER VERSION SETTINGS ON JSP?
1)Internet Explorer'da öncelikle F12 developer tools ile aşağıdaki default kısmı görüyorsanız:
/If you see docuemnt mode option on internet explorer with using F12.
2)Daha sonra projede kullanılacak tüm css'leri ,script'leri hangi jsp'de tanımladıysanız o jsp'de şu kod satırını değiştirin.
/Then choose the jsp which is described all the css and scripts then change the code below:
<meta http-equiv="X-UA-Compatible" content="IE=9" />
/If you see docuemnt mode option on internet explorer with using F12.
2)Daha sonra projede kullanılacak tüm css'leri ,script'leri hangi jsp'de tanımladıysanız o jsp'de şu kod satırını değiştirin.
/Then choose the jsp which is described all the css and scripts then change the code below:
<meta http-equiv="X-UA-Compatible" content="IE=9" />
burada content yerine internet explorer'ın hangi versiyonunun olmasını istiyorsanız öyle değiştirin.
/Here you can change the content with any version you want
Ve daha sonra tekrar F12 ile değişip değişmediğini kontrol edebilirsiniz.
/Then you can control changes with using internet explorer F12
24 Nisan 2014 Perşembe
PERMGEN SPACE HATASI
Eclipse ile çalışırken permgen space hatası alıyorsanız,bu hatayı şu adımları izleyerek çözebilirsiniz:
1)Eclipse'imiz açıyoruz üstteki Run sekmesine tıklıyoruz.
2)Daha sonra çıkan run arguments'a tıklıyoruz.
3)Run arguments'ta solda Tomcat'i seçip sağda ise Arguments'i seçiyoruz ve altta VM Arguments kısmına sonuna -Xmx1024m ekliyoruz
Kaydol:
Kayıtlar (Atom)



