com.company.sakila.db0.sakila.rental.generated.GeneratedRental Maven / Gradle / Ivy
package com.company.sakila.db0.sakila.rental.generated;
import com.company.sakila.db0.sakila.customer.Customer;
import com.company.sakila.db0.sakila.inventory.Inventory;
import com.company.sakila.db0.sakila.rental.Rental;
import com.company.sakila.db0.sakila.staff.Staff;
import com.speedment.common.annotation.GeneratedCode;
import com.speedment.runtime.config.identifier.ColumnIdentifier;
import com.speedment.runtime.config.identifier.TableIdentifier;
import com.speedment.runtime.core.manager.Manager;
import com.speedment.runtime.core.util.OptionalUtil;
import com.speedment.runtime.field.ComparableField;
import com.speedment.runtime.field.IntField;
import com.speedment.runtime.field.IntForeignKeyField;
import com.speedment.runtime.field.ShortForeignKeyField;
import com.speedment.runtime.typemapper.TypeMapper;
import java.sql.Timestamp;
import java.util.Optional;
/**
* The generated base for the {@link
* com.company.sakila.db0.sakila.rental.Rental}-interface representing entities
* of the {@code rental}-table in the database.
*
* This file has been automatically generated by Speedment. Any changes made to
* it will be overwritten.
*
* @author Speedment
*/
@GeneratedCode("Speedment")
public interface GeneratedRental {
/**
* This Field corresponds to the {@link Rental} field that can be obtained
* using the {@link Rental#getRentalId()} method.
*/
IntField RENTAL_ID = IntField.create(
Identifier.RENTAL_ID,
Rental::getRentalId,
Rental::setRentalId,
TypeMapper.primitive(),
true
);
/**
* This Field corresponds to the {@link Rental} field that can be obtained
* using the {@link Rental#getRentalDate()} method.
*/
ComparableField RENTAL_DATE = ComparableField.create(
Identifier.RENTAL_DATE,
Rental::getRentalDate,
Rental::setRentalDate,
TypeMapper.identity(),
false
);
/**
* This Field corresponds to the {@link Rental} field that can be obtained
* using the {@link Rental#getInventoryId()} method.
*/
IntForeignKeyField INVENTORY_ID = IntForeignKeyField.create(
Identifier.INVENTORY_ID,
Rental::getInventoryId,
Rental::setInventoryId,
Inventory.INVENTORY_ID,
TypeMapper.primitive(),
false
);
/**
* This Field corresponds to the {@link Rental} field that can be obtained
* using the {@link Rental#getCustomerId()} method.
*/
IntForeignKeyField CUSTOMER_ID = IntForeignKeyField.create(
Identifier.CUSTOMER_ID,
Rental::getCustomerId,
Rental::setCustomerId,
Customer.CUSTOMER_ID,
TypeMapper.primitive(),
false
);
/**
* This Field corresponds to the {@link Rental} field that can be obtained
* using the {@link Rental#getReturnDate()} method.
*/
ComparableField RETURN_DATE = ComparableField.create(
Identifier.RETURN_DATE,
o -> OptionalUtil.unwrap(o.getReturnDate()),
Rental::setReturnDate,
TypeMapper.identity(),
false
);
/**
* This Field corresponds to the {@link Rental} field that can be obtained
* using the {@link Rental#getStaffId()} method.
*/
ShortForeignKeyField STAFF_ID = ShortForeignKeyField.create(
Identifier.STAFF_ID,
Rental::getStaffId,
Rental::setStaffId,
Staff.STAFF_ID,
TypeMapper.primitive(),
false
);
/**
* This Field corresponds to the {@link Rental} field that can be obtained
* using the {@link Rental#getLastUpdate()} method.
*/
ComparableField LAST_UPDATE = ComparableField.create(
Identifier.LAST_UPDATE,
Rental::getLastUpdate,
Rental::setLastUpdate,
TypeMapper.identity(),
false
);
/**
* Returns the rentalId of this Rental. The rentalId field corresponds to
* the database column db0.sakila.rental.rental_id.
*
* @return the rentalId of this Rental
*/
int getRentalId();
/**
* Returns the rentalDate of this Rental. The rentalDate field corresponds
* to the database column db0.sakila.rental.rental_date.
*
* @return the rentalDate of this Rental
*/
Timestamp getRentalDate();
/**
* Returns the inventoryId of this Rental. The inventoryId field corresponds
* to the database column db0.sakila.rental.inventory_id.
*
* @return the inventoryId of this Rental
*/
int getInventoryId();
/**
* Returns the customerId of this Rental. The customerId field corresponds
* to the database column db0.sakila.rental.customer_id.
*
* @return the customerId of this Rental
*/
int getCustomerId();
/**
* Returns the returnDate of this Rental. The returnDate field corresponds
* to the database column db0.sakila.rental.return_date.
*
* @return the returnDate of this Rental
*/
Optional getReturnDate();
/**
* Returns the staffId of this Rental. The staffId field corresponds to the
* database column db0.sakila.rental.staff_id.
*
* @return the staffId of this Rental
*/
short getStaffId();
/**
* Returns the lastUpdate of this Rental. The lastUpdate field corresponds
* to the database column db0.sakila.rental.last_update.
*
* @return the lastUpdate of this Rental
*/
Timestamp getLastUpdate();
/**
* Sets the rentalId of this Rental. The rentalId field corresponds to the
* database column db0.sakila.rental.rental_id.
*
* @param rentalId to set of this Rental
* @return this Rental instance
*/
Rental setRentalId(int rentalId);
/**
* Sets the rentalDate of this Rental. The rentalDate field corresponds to
* the database column db0.sakila.rental.rental_date.
*
* @param rentalDate to set of this Rental
* @return this Rental instance
*/
Rental setRentalDate(Timestamp rentalDate);
/**
* Sets the inventoryId of this Rental. The inventoryId field corresponds to
* the database column db0.sakila.rental.inventory_id.
*
* @param inventoryId to set of this Rental
* @return this Rental instance
*/
Rental setInventoryId(int inventoryId);
/**
* Sets the customerId of this Rental. The customerId field corresponds to
* the database column db0.sakila.rental.customer_id.
*
* @param customerId to set of this Rental
* @return this Rental instance
*/
Rental setCustomerId(int customerId);
/**
* Sets the returnDate of this Rental. The returnDate field corresponds to
* the database column db0.sakila.rental.return_date.
*
* @param returnDate to set of this Rental
* @return this Rental instance
*/
Rental setReturnDate(Timestamp returnDate);
/**
* Sets the staffId of this Rental. The staffId field corresponds to the
* database column db0.sakila.rental.staff_id.
*
* @param staffId to set of this Rental
* @return this Rental instance
*/
Rental setStaffId(short staffId);
/**
* Sets the lastUpdate of this Rental. The lastUpdate field corresponds to
* the database column db0.sakila.rental.last_update.
*
* @param lastUpdate to set of this Rental
* @return this Rental instance
*/
Rental setLastUpdate(Timestamp lastUpdate);
/**
* Queries the specified manager for the referenced Inventory. If no such
* Inventory exists, an {@code NullPointerException} will be thrown.
*
* @param foreignManager the manager to query for the entity
* @return the foreign entity referenced
*/
Inventory findInventoryId(Manager foreignManager);
/**
* Queries the specified manager for the referenced Customer. If no such
* Customer exists, an {@code NullPointerException} will be thrown.
*
* @param foreignManager the manager to query for the entity
* @return the foreign entity referenced
*/
Customer findCustomerId(Manager foreignManager);
/**
* Queries the specified manager for the referenced Staff. If no such Staff
* exists, an {@code NullPointerException} will be thrown.
*
* @param foreignManager the manager to query for the entity
* @return the foreign entity referenced
*/
Staff findStaffId(Manager foreignManager);
enum Identifier implements ColumnIdentifier {
RENTAL_ID ("rental_id"),
RENTAL_DATE ("rental_date"),
INVENTORY_ID ("inventory_id"),
CUSTOMER_ID ("customer_id"),
RETURN_DATE ("return_date"),
STAFF_ID ("staff_id"),
LAST_UPDATE ("last_update");
private final String columnId;
private final TableIdentifier tableIdentifier;
Identifier(String columnId) {
this.columnId = columnId;
this.tableIdentifier = TableIdentifier.of( getDbmsId(),
getSchemaId(),
getTableId());
}
@Override
public String getDbmsId() {
return "db0";
}
@Override
public String getSchemaId() {
return "sakila";
}
@Override
public String getTableId() {
return "rental";
}
@Override
public String getColumnId() {
return this.columnId;
}
@Override
public TableIdentifier asTableIdentifier() {
return this.tableIdentifier;
}
}
}