Permalink
Browse files

Merge branch 'dgud/mnesia/fix-qlc-warning' into maint

* dgud/mnesia/fix-qlc-warning:
  [mnesia] Fix warning in example code
  • Loading branch information...
dgud committed Feb 28, 2012
2 parents 7742649 + ccb614d commit 1ac9351c019231b81caa9d27df0339da284247e8
Showing with 38 additions and 27 deletions.
  1. +27 −18 lib/mnesia/doc/src/company.erl
  2. +11 −9 lib/mnesia/doc/src/company_o.erl
@@ -1,19 +1,20 @@
%% ``The contents of this file are subject to the Erlang Public License,
%%
%% %CopyrightBegin%
%%
%% Copyright Ericsson AB 1999-2012. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved via the world wide web at http://www.erlang.org/.
%%
%% retrieved online at http://www.erlang.org/.
%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
%%
%% The Initial Developer of the Original Code is Ericsson Utvecklings AB.
%% Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings
%% AB. All Rights Reserved.''
%%
%% $Id$
%%
%% %CopyrightEnd%
%%
-module(company).
@@ -83,16 +84,24 @@ g() -> l.
%3
female_bosses() ->
Q = qlc:q( [{E#employee.name, Boss#employee.name} ||
E <- mnesia:table(employee),
Boss <- mnesia:table(employee),
Atdep <- mnesia:table(at_dep),
Mgr <- mnesia:table(manager),
E#employee.sex == female,
Atdep#at_dep.emp == E#employee.emp_no,
Mgr#manager.emp == Boss#employee.emp_no,
Atdep#at_dep.dept_id == Mgr#manager.dept]
H1 = qlc:q( [{Atdep#at_dep.dept_id,E} ||
E <- mnesia:table(employee),
E#employee.sex == female,
Atdep <- mnesia:table(at_dep),
Atdep#at_dep.emp == E#employee.emp_no]
),
H2 = qlc:q( [{Mgr#manager.emp,E} ||
{AtdepDeptId, E} <- H1,
Mgr <- mnesia:table(manager),
AtdepDeptId == Mgr#manager.dept]
),
Q = qlc:q( [{E#employee.name, Boss#employee.name} ||
{MgrEmp,E} <- H2,
Boss <- mnesia:table(employee),
MgrEmp == Boss#employee.emp_no]
),
mnesia:transaction(fun() -> qlc:e(Q) end).
%3
@@ -1,20 +1,22 @@
%% ``The contents of this file are subject to the Erlang Public License,
%%
%% %CopyrightBegin%
%%
%% Copyright Ericsson AB 1999-2012. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved via the world wide web at http://www.erlang.org/.
%%
%% retrieved online at http://www.erlang.org/.
%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
%%
%% The Initial Developer of the Original Code is Ericsson Utvecklings AB.
%% Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings
%% AB. All Rights Reserved.''
%%
%% $Id$
%%
%% %CopyrightEnd%
%%
-module(company_o).
-compile(export_all).

0 comments on commit 1ac9351

Please sign in to comment.