Time of Update: 2018-12-03
往往兩張表之間有主外部索引鍵關聯,在插入資料時會出現以下錯誤 org.hibernate.PropertyValueException: not-null property references a null or transient value: org.epai.web.entity.Goods.userinfoBySalerId at org.hibernate.engine.Nullability.checkNullability(Nullability.java:72) at
Time of Update: 2018-12-03
1.Commit failed。……You have to update your working copy first 多人同時修改同一檔案,在提交前其他人已經搶先提交到SVN伺服器中,導致該錯誤;解決方案:對工作複本中的檔案進行更新即可 更新版本解決衝突主要就是 a、 在目前的目錄下執行“update”(更新)操作b、 在衝突的檔案上(選中檔案--右鍵菜單—TortoiseSVN—Edit conflicts(解決衝突))c、
Time of Update: 2018-12-03
Java Code:package com.shop.action;import java.io.File;import java.io.FileInputStream;import java.io.FileOutputStream;import java.text.SimpleDateFormat;import java.util.Date;import javax.servlet.http.HttpServletRequest;import
Time of Update: 2018-12-03
一個不可為空的屬性引用了一個空值或游離狀態的值 解決方案,在相應的設定檔中做修改 即:假設不可為空的欄位為ContestId,那麼在Contest/hbm.xml中修改,在property標籤中加insert="false" generated="always" <property name="contestId" type="java.lang.Integer" insert="false" generated="always"> <column
Time of Update: 2018-12-03
JVM記憶體結構近期看了看Java記憶體泄露的一些案例,跟原來的幾個哥們討論了一下,深入研究發現JVM裡面還是有不少以前不知道的細節,這裡稍微剖析一下。先看一看JVM內部結構——,JVM記憶體結構主要包括兩個子系統和兩個組件。兩個子系統分別是Classloader子系統和Executionengine(執行引擎)子系統;兩個組件分別是Runtimedataarea(運行時資料區域)組件和Nativeinterface(本地介面)組件。Classloader子系統的作用:根據給定的全限定名類名(如
Time of Update: 2018-12-03
在使用SSH的時候,會在DaoImpl中產生 findByExample 和findByAll一般情況在 我們都會在execute方法中使用findByAll 去給頁面準備資料加入你jsp頁面中 包含了這個Action 那麼就會出現資料 覆蓋的問題<s:action name="category" executeResult="false"></s:action>那麼現在 在execute方法中 直接使用 findByExample查詢方法 也在execute中
Time of Update: 2018-12-03
迷迷糊糊的搞出來了。。感慨萬千啊。。。public String indexInit(){ //擷取所有的父級 recursion(0); System.out.println(dList.size()); for (Category category : dList) { System.out.println(category.getName()); } return
Time of Update: 2018-12-03
org.hibernate.id.IdentifierGenerationException:ids for this class must be manually assigned before calling save()hibernate出現這個錯誤的原因有可能因為,你的表中有個主鍵。
Time of Update: 2018-12-03
最近在學習maven,對maven的一些用法還知之甚少下載了一個maven項目匯入eclipse,發現我本地倉庫少了一些項目需要的jar包怎麼辦呢?解決辦法:進入項目的根目錄(即 pom.xml檔案所在的目錄)執行:mvn dependency:copy-dependencies完成後進入eclipse,發現項目不再報錯前提條件:1,安裝了maven2,將maven安裝路徑配置到環境變數3,maven的eclipse外掛程式
Time of Update: 2018-12-03
這是第二種方法:返回需要的結果集public String indexInit(){//擷取所有的父級List<Category> bases=categoryService.findByBaseId(0);List<List<Category>> datas=new ArrayList<List<Category>>();for (Category category : bases) {List<Category>
Time of Update: 2018-12-03
在這兩天的開發中我碰到這樣一個問題,在第一次開啟window時資料正常,但是第二次及以後開啟時現實的額資料任然是第一次開啟的資料。經尋找發現此時window調用的關閉方式是hide而不是close,即每次關閉時實質上是沒有關閉的只是把window隱藏了而已,此時只要把關閉方法用close即可,而且把closeAction:'close'這樣配置即可。但是此時問題又發生了,此時window開啟一次後就無法開啟了代碼://關閉按鈕this.ButtonClose =new
Time of Update: 2018-12-03
jquery 提交值不為空白的元素 可以用來查詢的時候用具體代碼://在執行查詢的時候,如果表單的欄位為空白 就不進行提交$("#form1").submit(function(){try {$(this).find("*").each(function(){var elem = $(this);if (elem.prop("name") != null&&elem.prop("name") != "") {if(elem.val()==""){elem.removeAttr("
Time of Update: 2018-12-03
這是拋出來的提示資訊:HTTP Status 500 - could not execute query; nested exception is org.hibernate.exception.SQLGrammarException: could not execute querytype Exception reportmessage could not execute query; nested exception is
Time of Update: 2018-12-03
網頁可見地區寬: document.body.clientWidth網頁可見地區高: document.body.clientHeight網頁可見地區寬: document.body.offsetWidth (包括邊線的寬)網頁可見地區高: document.body.offsetHeight (包括邊線的高)網頁本文全文寬: document.body.scrollWidth網頁本文全文高: document.body.scrollHeight網頁被捲去的高:
Time of Update: 2018-12-03
今天做項目,插入了一條資料,心想,這個功能模組終於搞定了,誰料想出現"使用hibernate插入一條資料時,資料庫已存在,app中查詢不到,重啟tomcat後app可以查詢到"。
Time of Update: 2018-12-03
JS 資料類型轉換 方法主要有三種轉換函式、強制類型轉換、利用js變數弱類型轉換。1. 轉換函式:js提供了parseInt()和parseFloat()兩個轉換函式。前者把值轉換成整數,後者把值轉換成浮點數。只有對String類型調用這些方法,這兩個函數才能正確運行;對其他類型返回的都是NaN(Not a Number)。在判斷字串是否是數字值前,parseInt()和parseFloat()都會仔細分析該字串。parseInt()方法首先查看位置0處的
Time of Update: 2018-12-03
在最新的html標準中 有了個calc css運算式,我們可以用這個來計算布局。但是在古老的IE中,卻不支援,為了所有瀏覽器的支援,這裡用了js來做。:code:<!DOCTYPE HTML PUBLIC "-//IETF//DTD LEVEL1//EN"><html> <head> <title>MyHtml.html</title> <meta http-equiv="keywords"
Time of Update: 2018-12-03
using System;using System.Collections.Generic;using System.Data;using System.Web;using MySQLDriverCS;namespace Pan.Uilt{ public class Paging { public Paging(string sql,int number) { //資料集 das = new DataSet()
Time of Update: 2018-12-03
為了深入的去瞭解java的底層東西和hibernate和Struts2的原理,自己覺得寫了個架構。該框架組成了hibernate和Struts2的功能,當然沒有依靠其jar包,是獨立的一個架構。運行原理:我們知道Struts2 是用過濾器來進行工作的。那麼我這個架構也是一樣。其中有一點,使用方法和Struts2不同,而且更加靈活。首先聲明一點,我沒有看Struts2的源碼,我只是靠自己理解,來寫這個架構的。主要的目的就是減少繁瑣的操作,提高整體開發效率。Winter framework
Time of Update: 2018-12-03
---這不是分頁演算法,而是頁碼顯示的演算法。看:這個是分好頁之後,頁碼比較多的時候,可以用這個演算法實現這種效果轉載請註明來源,by-潘敬代碼:package com.domain;public class PageCode {int pageCount = 0; // 頁碼數量int showCount = 0; // 顯示數量int begin = 0; // 開始位置int end = 0; // 結束位置int index=0;// 索引public PageCode() {}/**