net.sourceforge.floggy.persistence
Interface IDable


public interface IDable

Exports the RMS id used to identify the Persistable entity in the underlined system. This interface is optional. The developer must implement it to have access to the RecordStore id of the persisted object. The setId method is used to set the id obtained from the RMS system. The setId does not have effect if called by the developer because Floggy uses its internal id value to persist the objects.

public class Order implements Persistable, IDable {
 private int id;
 public void setId(int id) {
  this.id = id;
 }
 public int getId() {
  return id;
 }
}

...

public void save() {
 Order order = ...
 int id = pm.save(order);
 //id and order.getId() have the same value
}

Since:
1.3.0

Method Summary
 void setId(int id)
          Setter method to the id field.
 

Method Detail

setId

void setId(int id)
Setter method to the id field. It is used by the framework to export the RMS id value.

Parameters:
id - RMS id.


Copyright © 2006-2011 Floggy Open Source Group. All Rights Reserved.