Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
773668c6
Kaydet (Commit)
773668c6
authored
Ock 18, 2012
tarafından
Lionel Elie Mamane
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
OKeySet: tryRefetch and refreshRow share most of their code
üst
c2567a65
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
55 deletions
+26
-55
KeySet.cxx
dbaccess/source/core/api/KeySet.cxx
+25
-55
KeySet.hxx
dbaccess/source/core/api/KeySet.hxx
+1
-0
No files found.
dbaccess/source/core/api/KeySet.cxx
Dosyayı görüntüle @
773668c6
...
...
@@ -881,45 +881,9 @@ void OKeySet::tryRefetch(const ORowSetRow& _rInsertRow,bool bRefetch)
{
if
(
bRefetch
)
{
// we just areassign the base members
try
{
Reference
<
XParameters
>
xParameter
(
m_xStatement
,
UNO_QUERY
);
OSL_ENSURE
(
xParameter
.
is
(),
"No Parameter interface!"
);
xParameter
->
clearParameters
();
sal_Int32
nPos
=
1
;
connectivity
::
ORowVector
<
ORowSetValue
>::
Vector
::
const_iterator
aParaIter
;
connectivity
::
ORowVector
<
ORowSetValue
>::
Vector
::
const_iterator
aParaEnd
;
OUpdatedParameter
::
iterator
aUpdateFind
=
m_aUpdatedParameter
.
find
(
m_aKeyIter
->
first
);
if
(
aUpdateFind
==
m_aUpdatedParameter
.
end
()
)
{
aParaIter
=
m_aParameterValueForCache
.
get
().
begin
();
aParaEnd
=
m_aParameterValueForCache
.
get
().
end
();
}
else
{
aParaIter
=
aUpdateFind
->
second
.
get
().
begin
();
aParaEnd
=
aUpdateFind
->
second
.
get
().
end
();
}
for
(
++
aParaIter
;
aParaIter
!=
aParaEnd
;
++
aParaIter
,
++
nPos
)
{
::
dbtools
::
setObjectWithInfo
(
xParameter
,
nPos
,
aParaIter
->
makeAny
(),
aParaIter
->
getTypeKind
()
);
}
connectivity
::
ORowVector
<
ORowSetValue
>::
Vector
::
const_iterator
aIter2
=
m_aKeyIter
->
second
.
first
->
get
().
begin
();
SelectColumnsMetaData
::
const_iterator
aPosIter
=
(
*
m_pKeyColumnNames
).
begin
();
SelectColumnsMetaData
::
const_iterator
aPosEnd
=
(
*
m_pKeyColumnNames
).
end
();
for
(;
aPosIter
!=
aPosEnd
;
++
aPosIter
,
++
aIter2
)
setOneKeyColumnParameter
(
nPos
,
xParameter
,
*
aIter2
,
aPosIter
->
second
.
nType
,
aPosIter
->
second
.
nScale
);
aPosIter
=
(
*
m_pForeignColumnNames
).
begin
();
aPosEnd
=
(
*
m_pForeignColumnNames
).
end
();
for
(;
aPosIter
!=
aPosEnd
;
++
aPosIter
,
++
aIter2
)
setOneKeyColumnParameter
(
nPos
,
xParameter
,
*
aIter2
,
aPosIter
->
second
.
nType
,
aPosIter
->
second
.
nScale
);
m_xSet
=
m_xStatement
->
executeQuery
();
OSL_ENSURE
(
m_xSet
.
is
(),
"No resultset form statement!"
);
bRefetch
=
m_xSet
->
next
();
bRefetch
=
doTryRefetch_throw
();
}
catch
(
const
Exception
&
)
{
...
...
@@ -1327,22 +1291,9 @@ sal_Bool SAL_CALL OKeySet::previous( ) throw(SQLException, RuntimeException)
return
previous_checked
(
sal_True
);
}
// -----------------------------------------------------------------------------
void
SAL_CALL
OKeySet
::
refreshRow
()
throw
(
SQLException
,
RuntimeException
)
bool
OKeySet
::
doTryRefetch_throw
()
throw
(
SQLException
,
RuntimeException
)
{
RTL_LOGFILE_CONTEXT_AUTHOR
(
aLogger
,
"dbaccess"
,
"Ocke.Janssen@sun.com"
,
"OKeySet::refreshRow"
);
if
(
isBeforeFirst
()
||
isAfterLast
()
||
!
m_xStatement
.
is
())
return
;
m_xRow
=
NULL
;
::
comphelper
::
disposeComponent
(
m_xSet
);
if
(
m_aKeyIter
->
second
.
second
.
second
.
is
()
)
{
m_xRow
=
m_aKeyIter
->
second
.
second
.
second
;
return
;
}
// we just areassign the base members
// we just reassign the base members
Reference
<
XParameters
>
xParameter
(
m_xStatement
,
UNO_QUERY
);
OSL_ENSURE
(
xParameter
.
is
(),
"No Parameter interface!"
);
xParameter
->
clearParameters
();
...
...
@@ -1379,8 +1330,27 @@ void SAL_CALL OKeySet::refreshRow() throw(SQLException, RuntimeException)
setOneKeyColumnParameter
(
nPos
,
xParameter
,
*
aIter
,
aPosIter
->
second
.
nType
,
aPosIter
->
second
.
nScale
);
m_xSet
=
m_xStatement
->
executeQuery
();
OSL_ENSURE
(
m_xSet
.
is
(),
"No resultset form statement!"
);
sal_Bool
bOK
=
m_xSet
->
next
();
OSL_ENSURE
(
m_xSet
.
is
(),
"No resultset from statement!"
);
return
m_xSet
->
next
()
}
// -----------------------------------------------------------------------------
void
SAL_CALL
OKeySet
::
refreshRow
()
throw
(
SQLException
,
RuntimeException
)
{
RTL_LOGFILE_CONTEXT_AUTHOR
(
aLogger
,
"dbaccess"
,
"Ocke.Janssen@sun.com"
,
"OKeySet::refreshRow"
);
if
(
isBeforeFirst
()
||
isAfterLast
()
||
!
m_xStatement
.
is
())
return
;
m_xRow
=
NULL
;
::
comphelper
::
disposeComponent
(
m_xSet
);
if
(
m_aKeyIter
->
second
.
second
.
second
.
is
()
)
{
m_xRow
=
m_aKeyIter
->
second
.
second
.
second
;
return
;
}
sal_Bool
bOK
=
doTryRefetch_throw
();
if
(
!
bOK
)
{
OKeySetMatrix
::
iterator
aTemp
=
m_aKeyIter
;
...
...
@@ -1392,7 +1362,7 @@ void SAL_CALL OKeySet::refreshRow() throw(SQLException, RuntimeException)
else
{
m_xRow
.
set
(
m_xSet
,
UNO_QUERY
);
OSL_ENSURE
(
m_xRow
.
is
(),
"No row f
or
m statement!"
);
OSL_ENSURE
(
m_xRow
.
is
(),
"No row f
ro
m statement!"
);
}
}
...
...
dbaccess/source/core/api/KeySet.hxx
Dosyayı görüntüle @
773668c6
...
...
@@ -149,6 +149,7 @@ namespace dbaccess
sal_Int32
_nType
,
sal_Int32
_nScale
)
const
;
::
rtl
::
OUStringBuffer
createKeyFilter
();
bool
doTryRefetch_throw
()
throw
(
::
com
::
sun
::
star
::
sdbc
::
SQLException
,
::
com
::
sun
::
star
::
uno
::
RuntimeException
);;
void
tryRefetch
(
const
ORowSetRow
&
_rInsertRow
,
bool
bRefetch
);
void
executeUpdate
(
const
ORowSetRow
&
_rInsertRow
,
const
ORowSetRow
&
_rOrginalRow
,
const
::
rtl
::
OUString
&
i_sSQL
,
const
::
rtl
::
OUString
&
i_sTableName
,
const
::
std
::
vector
<
sal_Int32
>&
_aIndexColumnPositions
=
::
std
::
vector
<
sal_Int32
>
());
void
executeInsert
(
const
ORowSetRow
&
_rInsertRow
,
const
::
rtl
::
OUString
&
i_sSQL
,
const
::
rtl
::
OUString
&
i_sTableName
=
::
rtl
::
OUString
(),
bool
bRefetch
=
false
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment