Red Hat Web Application Framework 6.1 Manuel d'utilisateur Page 68

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 230
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 67
54 Chapter 8. WAF Application Development Tutorial
package com.example.binder;
import com.arsdigita.db.Sequences;
import com.arsdigita.domain.DomainObject;
import com.arsdigita.persistence.DataObject;
import com.arsdigita.util.Assert;
import com.arsdigita.util.UncheckedWrapperException;
import java.io.IOException;
import java.io.Writer;
import java.sql.SQLException;
import java.math.BigInteger;
import org.apache.log4j.Logger;
/**
* A bit of text with a title.
*
* @see com.example.binder.Note
* @author Justin Ross
*/
public class Note extends DomainObject {
private static final Logger s_log = Logger.getLogger(Note.class);
public static final String BASE_DATA_OBJECT_TYPE =
"com.example.binder.Note";
static final String ID = "id";
static final String TITLE = "title";
static final String BODY = "body";
protected String getBaseDataObjectType() {
return BASE_DATA_OBJECT_TYPE;
}
protected Note(final DataObject data) {
super(data);
if (isNew()) {
try {
set(ID, Sequences.getNextValue().toBigInteger());
} catch (SQLException sqle) {
throw new UncheckedWrapperException(sqle);
}
}
}
/**
* Gets the note’s unique ID.
*
* @return The <code>BigInteger</code> ID; it cannot be null
*/
public final BigInteger getID() {
return (BigInteger) get(ID);
}
/**
* Gets the title of the note.
*
* @return The <code>String</code> title; it cannot be null
*/
public final String getTitle() {
return (String) get(TITLE);
}
Vue de la page 67
1 2 ... 63 64 65 66 67 68 69 70 71 72 73 ... 229 230

Commentaires sur ces manuels

Pas de commentaire