aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2012-02-08 16:23:47 +0100
committerDan Gudmundsson <[email protected]>2012-02-08 16:23:47 +0100
commitccb614df55fe7c38c52fccb7459c9ec5b382d97b (patch)
tree82ff6434f94b2d75182da56583ebdbf338cd95d3
parent6004ec3e1785913ff0b74054cf614a35c180d54a (diff)
downloadotp-ccb614df55fe7c38c52fccb7459c9ec5b382d97b.tar.gz
otp-ccb614df55fe7c38c52fccb7459c9ec5b382d97b.tar.bz2
otp-ccb614df55fe7c38c52fccb7459c9ec5b382d97b.zip
[mnesia] Fix warning in example code
-rw-r--r--lib/mnesia/doc/src/company.erl45
-rw-r--r--lib/mnesia/doc/src/company_o.erl20
2 files changed, 38 insertions, 27 deletions
diff --git a/lib/mnesia/doc/src/company.erl b/lib/mnesia/doc/src/company.erl
index 28c32ed513..eef5535ed3 100644
--- a/lib/mnesia/doc/src/company.erl
+++ b/lib/mnesia/doc/src/company.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
diff --git a/lib/mnesia/doc/src/company_o.erl b/lib/mnesia/doc/src/company_o.erl
index 3c7ad0d5e5..dffe9840bb 100644
--- a/lib/mnesia/doc/src/company_o.erl
+++ b/lib/mnesia/doc/src/company_o.erl
@@ -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).