All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.rongaru.javaee.webapp.bean.AbstractUpdateHelperTransactionalBeanJSF Maven / Gradle / Ivy

The newest version!
package io.github.rongaru.javaee.webapp.bean;

import io.github.rongaru.javaee.backend.dto.AbstractUpdateHelperDto;
import io.github.rongaru.javaee.backend.service.AbstractUpdateHelperService;
import io.github.rongaru.javaee.webapp.model.AbstractUpdateHelperTransactionalDataModelJSF;

import java.util.Date;

public abstract class AbstractUpdateHelperTransactionalBeanJSF< Dto, Service, UserDto, DataModelJSF, UserLoginDataModelJSF > extends AbstractCreateHelperTransactionalBeanJSF< Dto, Service, UserDto, DataModelJSF, UserLoginDataModelJSF > {

	@Override
	protected boolean updateIntoDatabase( ) {
		DataModelJSF dataModelJSF = getDataModelJSF( );
		Dto record = getAbstractDataModelJSF( ).getRecord( );
		UserDto userDto = getAbstractUserLoginDataModelJSF( ).getUserDto( );
		AbstractUpdateHelperDto< UserDto > createHelperDto = ( AbstractUpdateHelperDto ) record;
		setEditElementParameters( record, dataModelJSF );
		createHelperDto.setUpdatedByUserDto( userDto );
		createHelperDto.setUpdatedDate( new Date( ) );
		return getAbstractService( ).update( record );
	}

	@Override
	protected AbstractUpdateHelperService< Dto > getAbstractService( ) {
		return ( AbstractUpdateHelperService ) getService( );
	}

	@Override
	protected AbstractUpdateHelperTransactionalDataModelJSF< Dto > getAbstractDataModelJSF( ) {
		return ( AbstractUpdateHelperTransactionalDataModelJSF ) getDataModelJSF( );
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy