}
// Get parent id
- Integer parent = category.getParent();
+ Long parent = category.getParent();
// Is the id set?
if (parent > 0) {
/**
* Id number of category
*/
- private Integer id;
+ private Long id;
/**
* Parent category id
*/
- private Integer parent;
+ private Long parent;
/**
* Title of category
* @param title Category title
* @param parent Parent id
*/
- protected BaseCategory (final Integer id, final String title, final Integer parent) {
+ protected BaseCategory (final Long id, final String title, final Long parent) {
// Set all here
this.setId(id);
this.setTitle(title);
* @return the id
*/
@Override
- public final Integer getId () {
+ public final Long getId () {
return this.id;
}
* @param id the id to set
*/
@Override
- public final void setId (final Integer id) {
+ public final void setId (final Long id) {
this.id = id;
}
* @return the parent
*/
@Override
- public final Integer getParent () {
+ public final Long getParent () {
return this.parent;
}
* @param parent the parent to set
*/
@Override
- public final void setParent (final Integer parent) {
+ public final void setParent (final Long parent) {
this.parent = parent;
}
* Id number of category
* @return the id
*/
- public Integer getId ();
+ public Long getId ();
/**
* Id number of category
* @param id the id to set
*/
- public void setId (final Integer id);
+ public void setId (final Long id);
/**
* Parent category id
* @return the parent
*/
- public Integer getParent ();
+ public Long getParent ();
/**
* Parent category id
* @param parent the parent to set
*/
- public void setParent (final Integer parent);
+ public void setParent (final Long parent);
/**
* Title of category
* @param title Category title
* @param parent Parent id
*/
- public ProductCategory (final Integer id, final String title, final Integer parent) {
+ public ProductCategory (final Long id, final String title, final Long parent) {
// Call parent constructor
super(id, title, parent);
}
// "Walk" through all entries
while (resultSet.next()) {
// Get id, title and parent id
- Integer id = resultSet.getInt(PizzaCategoryDatabaseConstants.COLUMN_ID);
+ Long id = resultSet.getLong(PizzaCategoryDatabaseConstants.COLUMN_ID);
String title = resultSet.getString(PizzaCategoryDatabaseConstants.COLUMN_TITLE);
- Integer parent = resultSet.getInt(PizzaCategoryDatabaseConstants.COLUMN_PARENT);
+ Long parent = resultSet.getLong(PizzaCategoryDatabaseConstants.COLUMN_PARENT);
// Debug message
this.getLogger().debug(MessageFormat.format("id={0},title={1},parent={2}", id, title, parent));