Hi everyone,

    In official document, there are some code about Partition-aware data 
loading.

    private void loadPartition(Connection conn, int part, 
IgniteBiInClosure<Long, Person> clo) {
    try (PreparedStatement st = conn.prepareStatement("select * from PERSONS 
where partId=?")) {
      st.setInt(1, part);
      
      try (ResultSet rs = st.executeQuery()) {
        while (rs.next()) {
          Person person = new Person(rs.getLong(1), rs.getString(2), 
rs.getString(3));
          
          clo.apply(person.getId(), person);
        }
      }
    }
    catch (SQLException e) {
      throw new CacheLoaderException("Failed to load values from cache store.", 
e);
    }
  }    I have a question in real scenario in the previous bold code: My table 
like Person has 100 columns, so I will list so many colmuns, it is not very 
efficient.    But, in the default implemention of cache.loadCache(), there are 
good code for mapping the DB table to cache object.    Can I reuse these code 
through some API?     Thanks your reply.



Bob


---------------------------------------------------------------------------------------------------
Confidentiality Notice: The information contained in this e-mail and any 
accompanying attachment(s)
is intended only for the use of the intended recipient and may be confidential 
and/or privileged of
Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of 
this communication is
not the intended recipient, unauthorized use, forwarding, printing,  storing, 
disclosure or copying
is strictly prohibited, and may be unlawful.If you have received this 
communication in error,please
immediately notify the sender by return e-mail, and delete the original message 
and all copies from
your system. Thank you.
---------------------------------------------------------------------------------------------------

Reply via email to