import java.sql.Time;

import javax.annotation.Generated;

import org.jooq.Parameter;
import org.jooq.impl.AbstractRoutine;


/**
 * This class is generated by jOOQ.
 */
@Generated(
    value = {
        "http://www.jooq.org";,
        "jOOQ version:3.9.1"
    },
    comments = "This class is generated by jOOQ"
)
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class GetClosestTimeSlot extends AbstractRoutine<java.lang.Void> {

    private static final long serialVersionUID = 1736943077;

    /**
     * The parameter <code>sminq.get_closest_time_slot.queueId</code>.
     */
    public static final Parameter<Integer> QUEUEID =
createParameter("queueId", org.jooq.impl.SQLDataType.INTEGER, false, false);

    /**
     * The parameter <code>sminq.get_closest_time_slot.joinTime</code>.
     */
    public static final Parameter<Time> JOINTIME =
createParameter("joinTime", org.jooq.impl.SQLDataType.TIME, false, false);

    /**
     * The parameter <code>sminq.get_closest_time_slot.dayOfWeek</code>.
     */
    public static final Parameter<Byte> DAYOFWEEK =
createParameter("dayOfWeek", org.jooq.impl.SQLDataType.TINYINT, false,
false);

    /**
     * The parameter <code>sminq.get_closest_time_slot.group_id</code>.
     */
    public static final Parameter<Integer> GROUP_ID =
createParameter("group_id", org.jooq.impl.SQLDataType.INTEGER, false,
false);

    /**
     * The parameter <code>sminq.get_closest_time_slot.start_time</code>.
     */
    public static final Parameter<Time> START_TIME =
createParameter("start_time", org.jooq.impl.SQLDataType.TIME, false, false);

    /**
     * The parameter <code>sminq.get_closest_time_slot.end_time</code>.
     */
    public static final Parameter<Time> END_TIME =
createParameter("end_time", org.jooq.impl.SQLDataType.TIME, false, false);

    /**
     * The parameter <code>sminq.get_closest_time_slot.min_slot_id</code>.
     */
    public static final Parameter<Integer> MIN_SLOT_ID =
createParameter("min_slot_id", org.jooq.impl.SQLDataType.INTEGER, false,
false);

    /**
     * The parameter <code>sminq.get_closest_time_slot.max_slot_id</code>.
     */
    public static final Parameter<Integer> MAX_SLOT_ID =
createParameter("max_slot_id", org.jooq.impl.SQLDataType.INTEGER, false,
false);

    /**
     * The parameter <code>sminq.get_closest_time_slot.min_join_time</code>.
     */
    public static final Parameter<Time> MIN_JOIN_TIME =
createParameter("min_join_time", org.jooq.impl.SQLDataType.TIME, false,
false);

    /**
     * The parameter <code>sminq.get_closest_time_slot.max_join_time</code>.
     */
    public static final Parameter<Time> MAX_JOIN_TIME =
createParameter("max_join_time", org.jooq.impl.SQLDataType.TIME, false,
false);

    /**
     * Create a new routine call instance
     */
    public GetClosestTimeSlot() {
        super("get_closest_time_slot", Sminq.SMINQ);

        addInParameter(QUEUEID);
        addInParameter(JOINTIME);
        addInParameter(DAYOFWEEK);
        addOutParameter(GROUP_ID);
        addOutParameter(START_TIME);
        addOutParameter(END_TIME);
        addOutParameter(MIN_SLOT_ID);
        addOutParameter(MAX_SLOT_ID);
        addOutParameter(MIN_JOIN_TIME);
        addOutParameter(MAX_JOIN_TIME);
    }

    /**
     * Set the <code>queueId</code> parameter IN value to the routine
     */
    public void setQueueid(Integer value) {
        setValue(QUEUEID, value);
    }

    /**
     * Set the <code>joinTime</code> parameter IN value to the routine
     */
    public void setJointime(Time value) {
        setValue(JOINTIME, value);
    }

    /**
     * Set the <code>dayOfWeek</code> parameter IN value to the routine
     */
    public void setDayofweek(Byte value) {
        setValue(DAYOFWEEK, value);
    }

    /**
     * Get the <code>group_id</code> parameter OUT value from the routine
     */
    public Integer getGroupId() {
        return get(GROUP_ID);
    }

    /**
     * Get the <code>start_time</code> parameter OUT value from the routine
     */
    public Time getStartTime() {
        return get(START_TIME);
    }

    /**
     * Get the <code>end_time</code> parameter OUT value from the routine
     */
    public Time getEndTime() {
        return get(END_TIME);
    }

    /**
     * Get the <code>min_slot_id</code> parameter OUT value from the routine
     */
    public Integer getMinSlotId() {
        return get(MIN_SLOT_ID);
    }

    /**
     * Get the <code>max_slot_id</code> parameter OUT value from the routine
     */
    public Integer getMaxSlotId() {
        return get(MAX_SLOT_ID);
    }

    /**
     * Get the <code>min_join_time</code> parameter OUT value from the
routine
     */
    public Time getMinJoinTime() {
        return get(MIN_JOIN_TIME);
    }

    /**
     * Get the <code>max_join_time</code> parameter OUT value from the
routine
     */
    public Time getMaxJoinTime() {
        return get(MAX_JOIN_TIME);
    }
}


On Tue, Mar 21, 2017 at 11:10 PM, Lukas Eder <[email protected]> wrote:

> Hmm, interesting. Can you post the generated code for your GetClosestTimeSlot
> class? I suspect there may have bene something wrong with its generation...
>
> 2017-03-21 12:09 GMT+01:00 Sheldon D'Souza <[email protected]>:
>
>> DELIMITER ;;
>>  CREATE PROCEDURE get_closest_time_slot(IN queueId INT, IN joinTime TIME,
>> IN dayOfWeek TINYINT,OUT group_id INT,OUT start_time TIME, OUT end_time
>> TIME, OUT slot_id MEDIUMINT,OUT appointmentTime TIME)
>>    BEGIN
>>    SELECT 
>> a.group_id,a.start_time,a.end_time,ABS(TIMEDIFF(joinTime,a.start_time))
>> + ABS(TIMEDIFF(joinTime,a.end_time)) AS closest_group, MAX(b.slot_id) AS
>> max_slot_id,MAX(b.start_time_slot) as maxAppointmentTime,MIN(b.slot_id)
>> AS min_slot_id,MIN(b.start_time_slot) as minAppointmentTime FROM
>> Calendar_time_slot_group AS a JOIN Calendar_time_slot AS b on a.group_id =
>> b.group_id WHERE a.queue_id = queueId AND a.day = dayOfWeek GROUP BY
>> a.group_id ORDER BY closest_group ASC LIMIT 1;
>>    END ;;
>> DELIMITER ;
>>
>>
>> On Tue, Mar 21, 2017 at 4:20 PM, Lukas Eder <[email protected]> wrote:
>>
>>> Hi Sheldon,
>>>
>>> Thank you for your message. A few questions on my side:
>>>
>>> - You're using MySQL, correct?
>>> - What's the CREATE PROCEDURE declaration of your procedure?
>>> - What exactly is null that shouldn't be?
>>>
>>> Cheers,
>>> Lukas
>>>
>>> 2017-03-21 11:23 GMT+01:00 Sheldon D'Souza <[email protected]>:
>>>
>>>> We are facing an issue with Procedure calls
>>>>
>>>> when we call the procedure from CLI
>>>>
>>>> call `db`.`get_closest_time_slot`(1, time '15:49:58',
>>>> 2,@group_id,@start_time,@end_time,@min_id,@max_id,@min_time,@max_time);
>>>>
>>>>
>>>> we get the output but when the same is called from Jooq
>>>>
>>>>
>>>>  GetClosestTimeSlot output = new GetClosestTimeSlot();
>>>>
>>>>         Configuration configuration = this.configuration.derive();
>>>>
>>>>         configuration.settings().setRenderNameStyle(RenderNameStyle.
>>>> AS_IS);
>>>>
>>>>         output.setQueueid(queueId);
>>>>
>>>>         output.setDayofweek((byte)dayOfWeek);
>>>>
>>>>         output.setJointime(selectJoinTime);
>>>>
>>>>         LOGGER.info("Get closest time slot for {}, {}, {}", queueId,
>>>> selectJoinTime, dayOfWeek);
>>>>
>>>>         output.execute(configuration);
>>>>
>>>>
>>>> The output is null, is there something we are missing?
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "jOOQ User Group" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to [email protected].
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>> --
>>> You received this message because you are subscribed to a topic in the
>>> Google Groups "jOOQ User Group" group.
>>> To unsubscribe from this topic, visit https://groups.google.com/d/to
>>> pic/jooq-user/jkStC1GkicA/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to
>>> [email protected].
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "jOOQ User Group" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "jOOQ User Group" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/jooq-user/jkStC1GkicA/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "jOOQ 
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to