小编dpo*_*ski的帖子

什么时候实体 - 类增强了,为什么?jpa,spring,hibernate,javassist

我使用的是spring 3.0.6,jpa 2.0,hibernate 3.6.8.我的问题是,在哪种情况下javassist用于为EntityClass创建"代理"?这个代理的原因是什么?我有以下实体:

@Entity
public MyEntity{
..

  @ManyToOne(fetch = FetchType.LAZY)
  @JoinColumn(name = "adresseID")
  private Adresse adresse;

  @OneToMany(fetch = FetchType.LAZY, mappedBy = "myEntity")
  private List<Parameter> parameters;

..
}
Run Code Online (Sandbox Code Playgroud)

当我从db加载MyEntity时,实体类就像MyEntity __ $$ _ javassist.为什么这样做?做什么的?我认为这里只能使用常规类MyEntity.

要实现延迟加载,我们可以:

  • 对于@OneToMany - 可以在这里使用PersistenceBag
  • 对于@ManyToOne - 这里应该像Adress_ $$ _javassist 一样使用"enchancedClass"

那么什么是让MyEntity迷恋的理由呢?在哪里我可以阅读更多关于它的内容?你能推荐哪本书/文章/博客?

spring hibernate jpa lazy-loading javassist

5
推荐指数
1
解决办法
1635
查看次数

BadCredentialsException:Kerberos验证不成功

我想与SPNEGO进行身份验证.我用:

  • 弹簧芯3.1.0.RELEASE.jar
  • 弹簧安全核心3.1.0.RELEASE.jar
  • 弹簧安全Kerberos的核心1.0.0.M2.jar
  • spring core security 3.0.7的包编解码器(https://jira.springsource.org/browse/SES-98)
  • tomcat的

我的Config文件如下所示.当我尝试使用上面的库进行身份验证时,我得到以下异常.

有人有同样的问题并处理它?

配置文件(取自spring security kerberos示例):

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:sec="http://www.springframework.org/schema/security"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
        http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd">

    <!-- This configuration uses SPNEGO by default, but one could also use a form if he directly goes to /login.html -->
    <sec:http entry-point-ref="spnegoEntryPoint" use-expressions="true">
        <sec:intercept-url pattern="/secure/**" access="isAuthenticated()" />
        <sec:custom-filter ref="spnegoAuthenticationProcessingFilter"
            position="BASIC_AUTH_FILTER" />
        <sec:form-login login-page="/login.html" default-target-url="/secure/index.jsp"/>
    </sec:http>

    <bean id="spnegoEntryPoint"
        class="org.springframework.security.extensions.kerberos.web.SpnegoEntryPoint" />

    <bean id="spnegoAuthenticationProcessingFilter"
        class="org.springframework.security.extensions.kerberos.web.SpnegoAuthenticationProcessingFilter">
        <property name="authenticationManager" ref="authenticationManager" />
    </bean>

    <sec:authentication-manager alias="authenticationManager">
        <sec:authentication-provider ref="kerberosServiceAuthenticationProvider" /> <!-- Used …
Run Code Online (Sandbox Code Playgroud)

spring tomcat kerberos spring-security spnego

5
推荐指数
1
解决办法
8943
查看次数

为什么IE8处于IE7模式.变量"IE"== 7

我在我的HTML页面中有如下所示的标题,我在IE8中打开此站点.当我在"Web Developer"中查看时,"if IE 7"处于活动状态.WebBrowser在"IE8 Compact VIew"上设置BrowserMode,在"IE7标准"上设置"文档模式".我在网站上有javascript,这对这些设置不起作用.为什么会这样?为什么IE变量等于7?为什么浏览器处于这些模式?

<!doctype html>
<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
<!--[if lt IE 7 ]> <html lang="de" class="no-js ie6"> <![endif]-->
<!--[if IE 7 ]>    <html lang="de" class="no-js ie7"> <![endif]-->
<!--[if IE 8 ]>    <html lang="de" class="no-js ie8"> <![endif]-->
<!--[if IE 9 ]>    <html lang="de" class="no-js ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--><html lang="de" class="no-js"> <!--<![endif]-->
Run Code Online (Sandbox Code Playgroud)

compatibility internet-explorer internet-explorer-8 ie-compatibility-mode

3
推荐指数
1
解决办法
3249
查看次数