I have a question. It's about EJB 3.0 Persistence API...

Hello.

I'm studying Java persistence API..

I tested a few Annotations.

Example..

@@Entity

@Table(name = "EJB_ORDER_VENDOR")

@NamedQueries({

@NamedQuery(name = "findVendorsByPartialName",query = "SELECT v "

+ "FROM Vendor v " + "WHERE LOCATE(:name, v.name) > 0")

, @NamedQuery(name = "findVendorByOrder", query = "SELECT DISTINCT l.vendorPart.vendor "

+ "FROM Order o, IN(o.lineItems) l " + "WHERE o.orderId = :id "

+ "ORDER BY l.vendorPart.vendor.name")

})

public class Vendor implements java.io.Serializable {

private Collection<VendorPart> vendorParts;

private String address;

private String contact;

private String name;

private String phone;

private int vendorId;

public Vendor() {

}

public Vendor(

int vendorId,

String name,

String address,

String contact,

String phone) {

this.vendorId = vendorId;

this.name = name;

this.address = address;

this.contact = contact;

this.phone = phone;

}

@Id

public int getVendorId() {

return vendorId;

}

public void setVendorId(int vendorId) {

this.vendorId = vendorId;

}

Is it.. must write annotation code each field?

Or, JPA making field auto?

Please answer me..

ps) Sorry for my English very poor..

[1420 byte] By [qwfea] at [2007-11-27 9:06:37]
# 1
Hi,You might want to post this in: persistence@glassfish.dev.java.net ejb@glassfish.dev.java.netSend an email to them.OK.eveMessage was edited by: evepokua
evepokuaa at 2007-7-12 21:42:17 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...