blob: c6ca7788eef9160afe8389ae4bdc173b31ac22fa [file] [log] [blame]
import ns java.lang.Double
import ns java.lang.String
import ns org.eclipse.osbp.dsl.^dto.lib.services.JPQL
import ns org.eclipse.osbp.dsl.^dto.lib.services.JPQL.create
import ns org.eclipse.osbp.dsl.^dto.lib.services.impl.AbstractDTOService.findDtos
import ns org.eclipse.osbp.dsl.^dto.lib.services.impl.AbstractDTOService.findValues
import ns org.eclipse.xtext.xbase.lib.IterableExtensions.last
import ns org.eclipse.xtext.xbase.lib.ObjectExtensions.operator_mappedTo
import ns org.osbp.mysmartshop.dtos.AddressDto
import ns org.osbp.mysmartshop.dtos.BaseUUIDDto.getId
import ns org.osbp.mysmartshop.dtos.CashPaymentDto
import ns org.osbp.mysmartshop.dtos.CashPaymentMethodDto
import org.osbp.mysmartshop.dtos.CashPositionDto
import ns org.osbp.mysmartshop.dtos.CashPositionDto
import ns org.osbp.mysmartshop.dtos.CashRegisterDto
import org.osbp.mysmartshop.dtos.CashSlipDto
import ns org.osbp.mysmartshop.dtos.CashSlipDto
import ns org.osbp.mysmartshop.dtos.CompanyDto
import ns org.osbp.mysmartshop.dtos.CompanyGroupDto
import ns org.osbp.mysmartshop.dtos.CompanyRelationTypeDto
import ns org.osbp.mysmartshop.dtos.DepartmentDto
import ns org.osbp.mysmartshop.dtos.DtoTestChildContainmentDto
import ns org.osbp.mysmartshop.dtos.DtoTestChildCrossRefDto
import ns org.osbp.mysmartshop.dtos.DtoTestParentDto
import ns org.osbp.mysmartshop.dtos.McustomerDto
import ns org.osbp.mysmartshop.dtos.BarDto
import ns org.osbp.mysmartshop.dtos.TestDto
import ns org.osbp.mysmartshop.dtos.CashSubPositionDto
import ns org.osbp.mysmartshop.dtos.CashDrawerCurrencyDto
import ns org.osbp.mysmartshop.dtos.CashDrawerSumDto
package org.osbp.mysmartshop.dtos.service {
dtoservice BarDtoService provides BarDto {
mutable persistenceUnit testCarstore
}
dtoservice DtoTestParentDtoService provides DtoTestParentDto {
mutable persistenceUnit testCarstore
}
dtoservice DtoTestChildContainmentDtoService provides DtoTestChildContainmentDto {
mutable persistenceUnit testCarstore
}
dtoservice DtoTestChildCrossRefDtoService provides DtoTestChildCrossRefDto {
mutable persistenceUnit testCarstore
}
dtoservice McustomerDtoService provides McustomerDto {
mutable persistenceUnit testCarstore
}
dtoservice CashRegisterDtoService provides CashRegisterDto {
mutable persistenceUnit testCarstore
}
dtoservice CashSlipDtoService provides CashSlipDto {
mutable persistenceUnit testCarstore
def Double calcSum( CashSlipDto slip ) {
val ql = createJPQL( "select sum(p.price) from CashPosition p where p.slip.id = :slipUUID", # {
"slipUUID" -> slip.^id
} )
print( "Foo" )
val resultList = findValues( ql )
print( "Bar" )
return resultList.get( 00 ) as Double
}
}
dtoservice CashPositionDtoService provides CashPositionDto {
mutable persistenceUnit testCarstore
def CashPositionDto findLast( String slipUUID ) {
val ql = createJPQL( "select p from CashPosition p where p.slip.id = :slipUUID order by p.price", # {
"slipUUID" -> slipUUID
} )
return findDtos( ql ).last
}
}
dtoservice CashSubPositionDtoService provides CashSubPositionDto {
mutable persistenceUnit testCarstore
}
dtoservice CashPaymentMethodDtoService provides CashPaymentMethodDto {
mutable persistenceUnit testCarstore
}
dtoservice CompanyRelationTypeDtoService provides CompanyRelationTypeDto {
mutable persistenceUnit testCarstore
}
dtoservice CompanyGroupDtoService provides CompanyGroupDto {
mutable persistenceUnit testCarstore
}
dtoservice CompanyDtoService provides CompanyDto {
mutable persistenceUnit testCarstore
}
dtoservice AddressDtoService provides AddressDto {
mutable persistenceUnit testCarstore
}
dtoservice DepartmentDtoService provides DepartmentDto {
mutable persistenceUnit testCarstore
}
dtoservice TestDtoService provides TestDto {
mutable persistenceUnit testCarstore
}
dtoservice CashDrawerCurrencyDtoService provides CashDrawerCurrencyDto {
mutable persistenceUnit testCarstore
}
dtoservice CashDrawerSumDtoService provides CashDrawerSumDto {
mutable persistenceUnit testCarstore
}
dtoservice CashPaymentDtoService provides CashPaymentDto {
mutable persistenceUnit testCarstore
}
}