Java, Webprogrammierung, Linux und mehr

Java, Webprogrammierung, Linux und mehr

Virtual Home of Johannes Geppert

  • Home
  • Über mich
  • Meine Linktipps
  • Kontakt
  • Impressum

New Showcase for the jqGrid feature in Struts2 jQuery Plugin is available

Posted in Struts jQuery Plugin, hibernate, jQuery, struts2 by jogep
Jan 26 2010
TrackBack Address.

Since today the new Showcase is available. The new Showcase is specially for the jqGrid based Grid Feature.

The Showcase is provided with the Full Hibernate Plugin for Struts2 and shows how easy it is to create a AJAX based paging table in Struts2 that is  searchable, sortable and editable. Also it shows how to implement a Grid with an Subgrid.

The Showcase based on Struts2 2.1.8.1, Full Hibernate Plugin 2.1.3 GA and Struts2 jQuery Plugin 1.8.2.

Per default the Showcase is read-only to see how to edit, add and delete items, download the showcase and following the instructions.

Visit Showcase: http://www.weinfreund.de/struts2-jquery-grid-showcase/
Download Showcase: http://code.google.com/p/struts2-jquery/downloads/list

No Comments yet »
Tagged as: hibernate, jqgrid, jQuery, plugin, showcase, struts2

In Hibernate mit OneToMany Beziehungen arbeiten

Posted in hibernate, java, spring by jogep
Jul 28 2008
TrackBack Address.

Bei einer Java Anwendung die mit Hibernate oder JPA als Persistence Framework arbeitet, kann es vorkommen das man alle Objekte mit HQL ermitteln will deren OneToMany Beziehungen eine bestimmte Größe haben oder mehr als null Elemente beinhalten.

Eine Beispiel Definition unserer Klassen könnte in etwa so aussehen.
MyObject:

@Entity
@Table(name = "my_object", schema = "public")
public class MyObject implements java.io.Serializable
{
  private Set<mysubobject>  subObjects = new HashSet</mysubobject><mysubobject>(0);
 
  @OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.LAZY, mappedBy = "myobject")
  public Set</mysubobject><mysubobject> getSubObjects()
  {
    return this.subObjects;
  }
}
</mysubobject>

MySubObject:

@Entity
@Table(name = "my_sub_object", schema = "public")
public class MySubObject implements java.io.Serializable
{
  private MyObject myObject;
 
  @ManyToOne(cascade = {}, fetch = FetchType.LAZY)
  @JoinColumn(name = "myobject", unique = false)
  public MyObject getMyObject()
  {
    return this.myObject;
  }
}

Nach dem wir unsere Klassen mit Annotations oder auch XML definiert haben können wir jetzt in unserem DAO Objekt mit folgenden HQL Befehl alle Objekte von der Datenbank anfordern die mindestens ein Element im Set subObjects haben.

public List<myobject> findAllWithElements()
{
  try
  {
    String queryString = "select model from MyObject model where size(subObjects ) > 0";
    return getHibernateTemplate().find(queryString);
  }
  catch (RuntimeException re)
  {
    log.error("find all with elements failed", re);
    throw re;
  }
}
</myobject>
No Comments yet »
Tagged as: annotions, count, hibernate, hql, jpa, persistence, set, size, spring

Social Links

TwitterTwitter XingXing TechnoratiTechnorati GithubGithub

Kategorien

  • Allgemein
  • datenbanken
  • hdr
  • java
    • sap
    • spring
    • struts2
    • hibernate
    • axis2
    • webservices
    • Struts jQuery Plugin
  • linux
  • projekte
  • sonstiges
  • witze
  • jQuery
  • php
  • piratenpartei

Schlagwörter

ajax Array bilder checksum client e-mail email gallerie hdr hdr bild hdr bilder hibernate integration java jax-rc jersey jpeg jqgrid jQuery leipzig linux mail openSUSE options Photo php plugin properties qtpfsgui resize rest showcase smtp spring struts2 versenden video web gallerie web service webservice wein weinfreund weingut widgets witze

Archiv

  • März 2010 (1)
  • Januar 2010 (4)
  • Dezember 2009 (1)
  • November 2009 (1)
  • Oktober 2009 (1)
  • September 2009 (1)
  • August 2009 (1)
  • Juli 2009 (2)
  • Juni 2009 (4)
  • Mai 2009 (5)
  • April 2009 (1)
  • März 2009 (2)
  • Februar 2009 (2)
  • Januar 2009 (1)
  • September 2008 (1)
  • Juli 2008 (22)

Meta

  • Anmelden
  • Artikel-Feed (RSS)
  • Kommentare als RSS
  • WordPress.org



Add to Technorati Favorites
Technorati Profile
Programming Blog Directory
Programming Blogs - Blog Catalog Blog Directory

blogoscoop
Blogverzeichnis - Blog Verzeichnis bloggerei.de
BlogPingR.de - Blog Ping-Dienst, Blogmonitor
Blog Verzeichnis Social Bookmarking, RSS-Verzeichnis
Blog Top Liste - by TopBlogs.de
http://www.wikio.de
Technology Blogs - Blog Rankings

RSS Neues aus der Weinwelt

  • Wein, Jazz & Oldtimer - das stimmungsvolle Weinfest im Grünen
  • Weinmesse München am 13. und 14. März 2010
  • saborondo Wintermenü - Die perfekte Harmonie von Speisen und Wein
  • XXV. Hamburger Wein-Salon
  • Weingut Kummer-Schuster jetzt NEU bei weinfreund.de
  • Konsumgöttinnen
  • HM4 - der Jungwein des Hauses ist da!
  • Es wei(h)nachtet sehr...
  • Auszeichnungen im Fallstaff Weinguide 2009/2010
  • Weingut Müller-Grossmann jetzt NEU bei weinfreund.de
Powered by WordPress | “Blend” from Spectacu.la WP Themes Club