Muhammad Jamal Shaikh
Muhammad Jamal Shaikh

Reputation: 157

Questions about POJO!

i am converting my .net application to java. my DAL(Data Access Layer) is based on Linq2Sql.

will pojo provide me all the functinality which linq2sql provides ? i want to avoid hybernate because of performance issues i have heard from people who used it.

what i want from POJO is

1.load objects with childrens 2.query them using linq or some similary feature.

i am told that simple inserts , update and delete on entities are possible in POJO . plz confirm this.

thanks Jamal.

P.S please answer all the qeustions having a question mark sign.

Upvotes: 0

Views: 156

Answers (2)

Dubas
Dubas

Reputation: 2876

POJO (Plain Old Java Object) are simple objets to map variables usually are used to identify the entities.

For example if you have a table "Employee" with id and name. Your POJO can be like:

public class Employee {

   private Long id;

   private String name;

   public Long getId(){ return id;}
   public void setId(Long id){ this.id = id;}
   public String getName(){ return name;}
   public void setName(String name){ this.name = name;}
}

As you seen this object is only used to store the data associated to the Employee. The persistence is done by a ORM framework like Hibernate that can relate this pojo to a table in your database and provides methods to query the database for POJO objects like the Criteria API used by hibernate (that is little similar that the LINQ queries)

Upvotes: 0

Bill K
Bill K

Reputation: 62769

You have a single question mark sign.

The answer to that is no, POJO is just a Plain Old Java Object (Unless someone has made the terrible mistake of creating a library called POJO).

The closest you'll probably come to Linq2Sql is using Hibernate.

Upvotes: 2

Related Questions