private long generateFromExpression(Object from, MVContext context) throws TransactionException {
        String sql = "insert into mview_expression(mview_id, type, table_owner, table_name, table_alias, expr_order) values(?, 'from', ?, ?, ?, ?)";
        if(from instanceof SQLJoinTableSource) {
            return generateJoinExpression((SQLJoinTableSource)from, context);
        } else if(from instanceof SQLExprTableSource) {
            SQLExprTableSource table = (SQLExprTableSource)from;
            SQLPropertyExpr prop = (SQLPropertyExpr)table.getExpr();
            String name = prop.getName();
            SQLIdentifierExpr ownerExpr = (SQLIdentifierExpr)prop.getOwner();
            String owner = ownerExpr.getName();
            PreparedStatement pstmt = null;
            ResultSet rs = null;
            try{
                pstmt = dbCon.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS);
                pstmt.setLong(1, context.getMview().getId());
                pstmt.setString(2, owner);
                pstmt.setString(3, name);
                pstmt.setString(4, table.getAlias());
                pstmt.setInt(5, ++ table_order);
                pstmt.executeUpdate();
                rs = pstmt.getGeneratedKeys();
                rs.next();
                return rs.getLong(1);
            } catch (SQLException e) {
                logger.error("Error when generate from expression.", e);
                throw new TransactionException(getTransactionID(), e);
            } finally {
                try {
                    rs.close();
                    pstmt.close();
                } catch (Exception ignore) {
                }
            }
        } else {
            throw new TransactionException(getTransactionID(), "Generate from clause should not arrive here");
        }
    }