2023/3/13

JPA+complex key+custom Query

 

來源:

https://www.cnblogs.com/520playboy/p/6512592.html 


整個來說,就是有複合主鍵

然後要使用 

public interface XxXXxxDAO extends CrudRepository<TcAgvjReady, String> {


如果報『.hibernate.QueryException: could not resolve property』

不要以為要什麼特殊設定

就是來源網站裡面說的 

『要寫xml的name』 ,而我bean裡面的id是什麼宣告,就宣告什麼


2021/11/1

visual studio 2019 新增oracle 連線無法使用entity framework 6

以下內容在2019上,『或許』能成功,但是很繁瑣
目前先把軟體降階到2017
到今日(2021/11/15)有VS2022,但是oracle 的ODP .Net還沒有推出
等有oracle for 2022的再來測試

在選擇entity framewark 的地方,就是一直反灰,無法使用
提示『XXXX找不到資料庫提供者XXXX'
甚至還會在選擇entity framework 版本時,突然消失
怎麼建立都是不行
後來自己找到原因

步驟1.把CPU改成X64,然後重新開啟
步驟2.專案清除。專案重建
步驟3.把6.122.21.1改為4.122.21.1
     <providers>
          <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
          <provider invariantName="Oracle.ManagedDataAccess.Client" type="Oracle.ManagedDataAccess.EntityFramework.EFOracleProviderServices,
                    Oracle.ManagedDataAccess.EntityFramework, Version=6.122.21.1, Culture=neutral, PublicKeyToken=89b483f429c47342" />
        </providers>



上述無效,

重新建立app,設定方式如下:

1.app.config裡面有三段,建議保留

<configSections>
    <!--<section name="oracle.manageddataaccess.client" type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.122.21.1, Culture=neutral, PublicKeyToken=89b483f429c47342" />-->
    
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
  </configSections>


<providers>
      <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
      <provider invariantName="Oracle.ManagedDataAccess.Client" type="Oracle.ManagedDataAccess.EntityFramework.EFOracleProviderServices, Oracle.ManagedDataAccess.EntityFramework, Version=4.122.21.1, Culture=neutral, PublicKeyToken=89b483f429c47342" />
    </providers>

 

<system.data>
    <DbProviderFactories>
      <remove invariant="Oracle.ManagedDataAccess.Client" />
      <add name="ODP.NET, Managed Driver" invariant="Oracle.ManagedDataAccess.Client" description="Oracle Data Provider for .NET, Managed Driver" type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=6.122.21.1, Culture=neutral, PublicKeyToken=89b483f429c47342" />
    </DbProviderFactories>
  </system.data>

2.如果要用ADO.net+EF請把EF的版本改掉,由6.122.21.1,變成4.122.21.1


    Oracle.ManagedDataAccess.EntityFramework, Version=6.122.21.1, Culture=neutral,


3.執行的時候,會有異常,除了剛剛的EF變成4.122.21.1,也要把OracleClientFactory,改成4.122.21.1


    Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=6.122.21.1,

正常了


(E04,浪費了我8小時改一個數字,oracle的產品阿......)
(花了一個禮拜的時間....)

補充資訊:
有人提供方向:
https://www.facebook.com/groups/DotNetUserGroupTaiwan/posts/2768088380150929/?comment_id=2768431143449986&notif_id=1636610180937126&notif_t=group_comment&ref=notif
參考頁面
vs 2019 TNS_ADMIN 

 

VS 2019內,建議還是設定好TNS_ADMIN
 在VS選單列,Tools->Options->Oracle Developer Tools ->Connection Configuration

補充:重新閱讀下面內容

https://blog.darkthread.net/blog/managed-odp-net

發現一個問題,關鍵在這一段

注意:Managed ODP.NET支援Entity Framework,但不提供設計階段支援,如果想在Visual Studio使用Entity Framework專案項目,仍須安裝32位元版ODAC with Oracle Developer Tools for Visual Studio,另一方面,開發者通常會用到SQL Plus或第三方Oracle資料庫工具,故開發環境仍會以ODAC 32位元為主,伺服器或大量部署的客戶端才是Managed ODP.NET展現威力的主戰場。

所以,我之前一直有亂七八糟問題,還是要改6->4

但是我還是要『另外安裝』這個『ODAC with Oracle Developer Tools for Visual Studio』

我才能用EF的功能

(oracle的產品阿......)

2021/10/15

RDP自動變更解析度

搜尋關鍵字: mstsc resize window 得到一個答案 Smart Resizing of Remote Desktop Windows
Open the created .rdp file in any editor of your choice, for example, in Notepad, and add the following string at the end of the file: smart sizing:i:1 Make sure that the parameters desktopwidth:i:1280 and desktopheight:i:1024 match the server's desktop resolution. You can also change the color settings. For this purpose, replace the value session bpp:i:8 with the session bpp:i:24 string.
使用notepad開啟保存後的rdp檔案 然後加上這一行 smart sizing:i:1

2020/8/26

windows DHCP server 批次匯出及匯入

From:

如何匯出&匯入DHCP Server領域中的保留區資料


關鍵:

1.匯出

netsh dhcp server serverip scope scopeip dump > C:\reserve.txt  


2.匯入

最後再把該文字檔copy到你的總公司DHCP Server上面..然後進行下面的動作匯入 (匯入前請先將DHCP Server進行備份以防萬一)

netsh exec C:\reserve.txt







2020/3/10

firefox 每次顯示視窗最上方

總算找到來源:
https://superuser.com/questions/1246525/chrome-is-now-always-on-top-how-can-i-avoid-that
https://superuser.com/questions/356802/firefox-on-windows-7-became-an-always-top-window
原因:不明,windows 10瀏覽器切換時 ,總是被瀏覽器蓋住無法切換上來
解決方式:
Ctrl+Alt+Esc
多按幾次在切換回去

2020/03/15 update:
上面說的功能無效
目前找到的方式(還需要測試)
讓firefox進入安全模式(停用ADD-ON)
Help > Restart with Add-ons Disabled
然後再重開firefox
.....目前看起來正常

2020/3/4

客戶端威盾agent卸載(IP guard)

來源:
http://stenwang.blogspot.com/2015/10/agent.html


客戶端威盾agent卸載

問題:
威盾agent客戶端無法連接到服務器時如何卸載

分析:
1、客戶端網卡硬件故障網絡連接網絡
2、客戶端被威盾限制無法安裝可執行程序及PC管理等

解決:
方法一
1、在安裝agent的電腦上單擊開始-運行-「agt3tool ocularadv
2、彈出對話框中可以選著「卸載客戶端」(如只需清楚策略或卸載加密安全密碼也可以選著其他選項)
3、單擊生成操作碼
4、此時agent會生成一個12位原始操作碼,請記住此原始操作碼
5、打開威盾控制台
6、打開「工具」--「客戶端工具」下的「確認碼生成器」
7、將原始操作碼輸入「客戶端操作碼中」,並單擊「解析」
8、單擊「生成確認碼」
9、控制台會生成一8位的確認碼
10、回到agent端將確認碼輸入「輸入確認碼」中。單擊「確定」,卸載完成
註:1、卸載完成後計算機會提示重啟,只有agent和控制端版本號一致才可以卸載
方法二
1、使用WINPE進系統
2、 刪除以下兩個文件即可
C:\WINDOWS\system32\winrdlv3.exe
C:\WINDOWS\bakrdlv3.sys

2019/11/8

[I've Sound Explorer]our youthful days

個人強烈喜歡的歌
是因為旋律+歌詞嗎?
因為網路上沒有翻譯,
自己用破破的日文來翻出我自己認為的中文吧 (外加google翻譯)
(未完....待續)

https://www.ivesound.jp/music/o/our_youthful_days.php
 
「our youthful days」 - MELL
作詞:KOTOKO/作曲:C.G Mix/編曲:C.G Mix
ずっと一人でやって來たから 大丈夫…なんて
一直以來都是自己一個人,不要緊的

強がりと分かっていても
即使是你知道

ちょっとしたこと頭の中 離れなくなって
在我腦海裡面一直排懸不去

獨りきり胸を叩いた
獨自在我心中徘徊

懐かしい後ろ姿 変わらないね
懷念的背影一直都沒變

本當は見つめていたあの日へ…
 直到我凝視的那天

若葉の季節(とき)は
年幼的季節裡

裡腹な時間を刻んで
刻下時間在心裡

迷う僕らにいたずらな
玩弄而讓我們迷惘的事情

風が吹き抜けてく
隨風吹散而去

素直に笑いあえるには
能夠坦直的笑

少し早すぎて
還稍微太早

甘く切ない思いだけ
只有美好的想法

遠い空が見ていた
注視著遙遠的天空

きっと君なら平気だなんて
一直知道你很平安

本當の私見つけて…と 小さく泣いた
真實的我實際上在小聲的暗自悲傷

憧れ語り合った校庭には

僕らに良く似た夏草揺れ…

落ち葉の季節(とき)は

我がままな時間を選んで

獨りよがりの戯れに

そっと光り落とした

馴れ合うことと優しさを

履き違えたまま

走ることも止められずに

遠い空を見ていた

夕日の黒板には擦れた文字

笑顏で落ちる涙 隠した…

満開の花降り注ぐ

通い慣れた道

肩叩きまた呼び合える

そんな季節(とき)を信じて

辿り著くには高すぎて

まだ見えないけど

ここで出會えた僕達の

遠い空追いかけて…

JPA+complex key+custom Query

  來源: https://www.cnblogs.com/520playboy/p/6512592.html   整個來說,就是有複合主鍵 然後要使用  public interface XxXXxx DAO extends CrudRepository<Tc...