Search in sources :

Example 1 with Record4

use of org.jooq.Record4 in project textdb by TextDB.

the class KeywordDictionaryResource method listUserDictionaries.

@GET
@Path("/list")
public List<KeywordDictionary> listUserDictionaries(@Session HttpSession session) {
    UInteger userID = UserResource.getUser(session).getUserID();
    Result<Record4<UInteger, String, byte[], String>> result = getUserDictionaryRecord(userID);
    if (result == null)
        return new ArrayList<>();
    List<KeywordDictionary> dictionaryList = result.stream().map(record -> new KeywordDictionary(record.get(KEYWORD_DICTIONARY.KID), record.get(KEYWORD_DICTIONARY.NAME), convertContentToList(record.get(KEYWORD_DICTIONARY.CONTENT)), record.get(KEYWORD_DICTIONARY.DESCRIPTION))).collect(Collectors.toList());
    return dictionaryList;
}
Also used : HttpSession(javax.servlet.http.HttpSession) TexeraWebException(edu.uci.ics.texera.web.TexeraWebException) SqlServer(edu.uci.ics.texera.dataflow.sqlServerInfo.SqlServer) FormDataContentDisposition(org.glassfish.jersey.media.multipart.FormDataContentDisposition) KEYWORD_DICTIONARY(edu.uci.ics.texera.dataflow.jooq.generated.Tables.KEYWORD_DICTIONARY) Result(org.jooq.Result) Collectors(java.util.stream.Collectors) ArrayList(java.util.ArrayList) Record4(org.jooq.Record4) FormDataParam(org.glassfish.jersey.media.multipart.FormDataParam) MediaType(javax.ws.rs.core.MediaType) List(java.util.List) Stream(java.util.stream.Stream) DSL.defaultValue(org.jooq.impl.DSL.defaultValue) Pair(org.apache.commons.lang3.tuple.Pair) javax.ws.rs(javax.ws.rs) java.io(java.io) UInteger(org.jooq.types.UInteger) Session(io.dropwizard.jersey.sessions.Session) GenericWebResponse(edu.uci.ics.texera.web.response.GenericWebResponse) UInteger(org.jooq.types.UInteger) Record4(org.jooq.Record4)

Aggregations

KEYWORD_DICTIONARY (edu.uci.ics.texera.dataflow.jooq.generated.Tables.KEYWORD_DICTIONARY)1 SqlServer (edu.uci.ics.texera.dataflow.sqlServerInfo.SqlServer)1 TexeraWebException (edu.uci.ics.texera.web.TexeraWebException)1 GenericWebResponse (edu.uci.ics.texera.web.response.GenericWebResponse)1 Session (io.dropwizard.jersey.sessions.Session)1 java.io (java.io)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Collectors (java.util.stream.Collectors)1 Stream (java.util.stream.Stream)1 HttpSession (javax.servlet.http.HttpSession)1 javax.ws.rs (javax.ws.rs)1 MediaType (javax.ws.rs.core.MediaType)1 Pair (org.apache.commons.lang3.tuple.Pair)1 FormDataContentDisposition (org.glassfish.jersey.media.multipart.FormDataContentDisposition)1 FormDataParam (org.glassfish.jersey.media.multipart.FormDataParam)1 Record4 (org.jooq.Record4)1 Result (org.jooq.Result)1 DSL.defaultValue (org.jooq.impl.DSL.defaultValue)1 UInteger (org.jooq.types.UInteger)1