2015-01-10 4 views
1

가입이 내 qbean 클래스querydsl-SQL 내가 querydsl 및 SQL에 beginer에 오전

final QBean<SystemPath> systemPathBean = bean(SystemPath.class, systemPath.systemPathId 
     , systemPath.path, systemPath.organId 
); 

final QBean<SecurableItemType> securableItemTypeBean = bean(SecurableItemType.class, securableItemType.all()); 

final QBean<SecurableItem> securableItemBean = bean(SecurableItem.class, securableItem.securableItemId 
    , securableItem.name, securableItem.enabled, securableItem.position, securableItem.uniqueId 
    , systemPathBean.as("systemPath") 
    , securableItemTypeBean.as("securableItemType") 
); 

final QBean<RoleSecurableItem> roleSecurableItemBean = bean(RoleSecurableItem.class, bean(SecurableItem.class 
    , securableItem.securableItemId, securableItem.position, securableItem.name 
    , securableItemBean.as("parent") 
    , securableItem.enabled).as("securableItem") 
); 

final QBean<Role> roleBean = bean(Role.class, role.roleId, role.name 
    , role.enabled, role.uniqueId, role.description 
    , GroupBy.list(roleSecurableItemBean).as("securableItems") 
); 

final QBean<UserRole> userRoleBean = bean(UserRole.class, roleBean.as("role")); 

final QBean<UserIpAddress> userIpAddressBean = bean(UserIpAddress.class, bean(IpAddress.class 
    , ipAddress.ipAddressId, ipAddress.ip 
    , bean(IpType.class, ipType.all()).as("ipType")).as("ipAddress")); 

final QBean<AppUser> appUserBean = bean(AppUser.class, appUser.userId, appUser.personalCode 
    , appUser.firstName, appUser.lastName, appUser.username, appUser.password, appUser.enabled 
    , appUser.picture, appUser.organId, appUser.description, appUser.loginTry, appUser.userLocked 
    , GroupBy.list(userRoleBean).as("roles") 
    , GroupBy.list(userIpAddressBean).as("ipAddresses") 
); 

이다 나는 복잡한 선택 쿼리 을 수행해야하고 이것은 나의 선택 쿼리입니다

return queryFactory 
    .from(appUser) 
    .fullJoin(appUser._fkuserRole472634, userRole) 
    .fullJoin(userRole.fkuserRole820825, role) 
    .fullJoin(role._fkroleSecur628757, roleSecurableItem) 
    .fullJoin(roleSecurableItem.fkroleSecur233998, securableItem) 
    .fullJoin(securableItem.fksecurable177065, systemPath) 
    .fullJoin(securableItem.fksecurable353324, securableItemType) 
    .fullJoin(appUser._fkuserIpAd409749, userIpAddress) 
    .fullJoin(userIpAddress.fkuserIpAd387468, ipAddress) 
    .fullJoin(ipAddress.fkipAddress105451, ipType) 
    .where(where) 
    .transform(GroupBy.groupBy(appUser.userId) 
    .list(appUserBean)); 

하지만 때 나는이 오류가 발생하는 코드를 실행 중입니다 :

created sql: select APP_USER.USER_ID 
from SECURITY.APP_USER APP_USER 
full join SECURITY.USER_ROLE USER_ROLE 
on APP_USER.USER_ID = USER_ROLE.USER_ID 
full join SECURITY.ROLE ROLE 
on USER_ROLE.ROLE_ID = ROLE.ROLE_ID 
full join SECURITY.ROLE_SECURABLE_ITEM ROLE_SECURABLE_ITEM 
on ROLE.ROLE_ID = ROLE_SECURABLE_ITEM.ROLE_ID 
full join SECURITY.SECURABLE_ITEM SECURABLE_ITEM 
on ROLE_SECURABLE_ITEM.SECURABLE_ITEM_ID = SECURABLE_ITEM.SECURABLE_ITEM_ID 
full join SECURITY.SYSTEM_PATH SYSTEM_PATH 
on SECURABLE_ITEM.SECURABLE_ITEM_ID = SYSTEM_PATH.SYSTEM_PATH_ID 
full join SECURITY.SECURABLE_ITEM_TYPE SECURABLE_ITEM_TYPE 
on SECURABLE_ITEM.SECURABLE_ITEM_TYPE_CODE = SECURABLE_ITEM_TYPE.CODE 
full join SECURITY.USER_IP_ADDRESS USER_IP_ADDRESS 
on APP_USER.USER_ID = USER_IP_ADDRESS.USER_ID 
full join SECURITY.IP_ADDRESS IP_ADDRESS 
on USER_IP_ADDRESS.IP_ADDRESS_ID = IP_ADDRESS.IP_ADDRESS_ID 
full join SECURITY.IP_TYPE IP_TYPE 
on IP_ADDRESS.IP_TYPE_CODE = IP_TYPE.CODE 
where APP_USER.USERNAME = ? and APP_USER.USER_LOCKED = ? and APP_USER.ENABLED = ? and  APP_USER.LOGIN_TRY <= ? 
ERROR [2015-01-10 10:40:50,015] io.dropwizard.jersey.errors.LoggingExceptionMapper: Error  handling a request: d0767b57da188c25 
! java.lang.IllegalArgumentException: argument type mismatch 

답변

0

where 표현식은 정확히과 콩에 정의 된 유형이 일치합니다. 예제 : APP_USER.LOGIN_TRY <= ? 값이 정수인 경우 LOGIN_TRY이 정수로 정의 된 경우

행운을 비네!