You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
2.2 KiB

package org.leolo.nrdatad.db;
import org.leolo.nrdatad.model.ScheduleAssociation;
import java.sql.SQLException;
import java.util.Collection;
public abstract class TrainAssociationDao extends BaseDao{
public TrainAssociationDao(DatabaseManager manager) {
super(manager);
}
public abstract void insert(ScheduleAssociation scheduleAssociation) throws SQLException;
public abstract boolean hasTrainAssociation(String auid) throws SQLException;
public final boolean hasTrainAssociation(ScheduleAssociation scheduleAssociation) throws SQLException {
return hasTrainAssociation(scheduleAssociation.getAuid());
}
public abstract void update(ScheduleAssociation scheduleAssociation) throws SQLException;
public abstract void updateLastCheck(String auid) throws SQLException;
public final void updateLastCheck(ScheduleAssociation scheduleAssociation) throws SQLException{
updateLastCheck(scheduleAssociation.getAuid());
}
public abstract ReplaceResult replace(ScheduleAssociation scheduleAssociation) throws SQLException;
public abstract int getHashCode(String auid) throws SQLException;
public final int getHashCode(ScheduleAssociation scheduleAssociation) throws SQLException{
return getHashCode(scheduleAssociation.getAuid());
}
public void insertAll(Collection<ScheduleAssociation> scheduleAssociations) throws SQLException{
for(ScheduleAssociation scheduleAssociation:scheduleAssociations){
insert(scheduleAssociation);
}
}
public void updateAll(Collection<ScheduleAssociation> scheduleAssociations) throws SQLException{
for (ScheduleAssociation scheduleAssociation:scheduleAssociations){
update(scheduleAssociation);
}
}
public void updateAllLastCheck(Collection<ScheduleAssociation> scheduleAssociations) throws SQLException{
for (ScheduleAssociation scheduleAssociation:scheduleAssociations){
updateLastCheck(scheduleAssociation);
}
}
public void replaceAll(Collection<ScheduleAssociation> scheduleAssociations) throws SQLException{
for (ScheduleAssociation scheduleAssociation:scheduleAssociations){
replace(scheduleAssociation);
}
}
}