entity

【47】kotlin 与java的互相调用

回眸只為那壹抹淺笑 提交于 2020-07-26 23:43:05
Get/Set Kotlin自动识别java的Getter/Setter Java操作kt属性通过Getter/Setter 空安全类型 Kotlin 空安全类型的原理 java 中没有 平台类型Platform Type @Nullable 和@NotNull 几类函数的调用 kt:包级函数:静态方法 扩展方法:带Receiver的静态方法 运算符重载:带Receiver的对应名称的静态方法 几个常用注解的使用 @JvmField:将属性编译为java变量 @JvmStatic:将对象的方法编译成Java静态方法 @JvmOverloads:默认参数生成重载方法 @file:JvmName:指定Kotlin文件编译后的类名 NoArg 与AllOpen NoArg为标注的类生成无参构造 -支持 Jpa注解,如@Entity AllOpen为标注的类 去掉final,允许被继承 -支持Spriing注解,如@Component 支持定义注解类型,列入@Poke 泛型 通配符Kotlin的 [*]对应于java的[?] 协变和逆变 out/in -ArrayList<out String> 没有Raw类型 -Java的List->Kotlin 的List<*> 来源: oschina 链接: https://my.oschina.net/u/4365009/blog/4319982

spring 框架的xml文件如何读取properties文件数据

自古美人都是妖i 提交于 2020-07-23 23:39:45
spring 框架的xml文件如何读取properties文件数据 第一步:在spring配置文件中 注意:value可以多配置几个properties文件 <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="locations"> <list> <value>/db.properties</value> </list> </property> </bean> 第二步: 在src目录下面建立db.properties文件 user=sa password=sa driver=com.microsoft.sqlserver.jdbc.SQLServerDriver url=jdbc:sqlserver://localhost:1433;databaseName=DB1 第三步: 在spring的配置文件中通过EL表达式的形式调用 ${user} <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3

Update an entity in Symfony 4?

大城市里の小女人 提交于 2020-07-22 12:26:38
问题 My question is simple, but I can't find a fine answer to it, I had an entity created by a command line : php bin/console make:entity this entity is User that has few attribute ( name - email - password ) After inserting the fields, I migrated, so my table has been created in the database using those commandlines : php bin/console make:migration php bin/console doctrine:migration:migrate But now I want to just change the name to a username but I don't know how to do it. I did not find anything

Update an entity in Symfony 4?

自闭症网瘾萝莉.ら 提交于 2020-07-22 12:24:28
问题 My question is simple, but I can't find a fine answer to it, I had an entity created by a command line : php bin/console make:entity this entity is User that has few attribute ( name - email - password ) After inserting the fields, I migrated, so my table has been created in the database using those commandlines : php bin/console make:migration php bin/console doctrine:migration:migrate But now I want to just change the name to a username but I don't know how to do it. I did not find anything

Entity Framework - Is there a way to automatically eager-load child entities without Include()?

不打扰是莪最后的温柔 提交于 2020-06-30 03:56:57
问题 Is there a way to decorate your POCO classes to automatically eager-load child entities without having to use Include() every time you load them? Say I have a Class Car, with Complex-typed Properties for Wheels, Doors, Engine, Bumper, Windows, Exhaust, etc. And in my app I need to load my car from my DbContext 20 different places with different queries, etc. I don't want to have to specify that I want to include all of the properties every time I want to load my car. I want to say List<Car>

How to address entity that uses composite identity key in OData Url?

流过昼夜 提交于 2020-06-27 07:08:21
问题 I have an entity OrderItem that has OrderId and ProductId integer fields and these two fields form the identity key/primary key for this table. I would like to use OData/Web API to expose such entities through a service and to be able to select OrderItem instances by they composite ID . What should be the format of the URL ? Are there any best practices for handling such scenarios? 回答1: Composite keys in the URL use syntax like this: ~/OrderItems(OrderId=1234,ProductId=1234) The "grammar" is

Get maximum id inside Doctrine entity

痞子三分冷 提交于 2020-05-17 07:15:06
问题 I need to get maximum ID of a table inside of symfony 2.7 entity. But instead of having the id I'm getting this issue. Notice: Undefined property: AppBundle\Entity\BlogPost::$container This is my BlogPost entity, <?php namespace AppBundle\Entity; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\HttpFoundation\File\UploadedFile; /** * BlogPost * * @ORM\Table() * @ORM\Entity */ class BlogPost { const SERVER_PATH_TO_IMAGE_FOLDER = '/uploads'; /** * @var integer * * @ORM\Column(name="id",

oracle 导入DMP数据 imp 10g

给你一囗甜甜゛ 提交于 2020-05-09 09:47:43
imp 10g Microsoft Windows [版本 5.2.3790] (C) 版权所有 1985-2003 Microsoft Corp. C:\Documents and Settings\Administrator>imp Import: Release 10.2.0.1.0 - Production on 星期二 11月 9 09:26:46 2010 Copyright (c) 1982, 2005, Oracle. All rights reserved. 用户名: sbhw@192.168.1.155/orcl 口令: 连接到: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production With the Partitioning, OLAP and Data Mining options 导入文件: EXPDAT.DMP> E:\项目相关\苏北航~1\现场数~1\wxyb20100826PM.dmp 输入插入缓冲区大小 (最小为 8192) 30720> 经由常规路径由 EXPORT:V10.02.01 创建的导出文件 警告: 这些对象由 WXYB 导出, 而不是当前用户 已经完成 ZHS16GBK 字符集和 AL16UTF16 NCHAR 字符集中的导入 只列出导入文件的内容

Spring Boot Security

徘徊边缘 提交于 2020-05-08 19:41:59
如图,是一种通用的用户权限模型。一般情况下会有5张表,分别是:用户表,角色表,权限表,用户角色关系表,角色权限对应表。 一般,资源分配时是基于角色的(即,资源访问权限赋给角色,用户通过角色进而拥有权限);而访问资源的时候是基于资源权限去进行授权判断的。 Spring Security和Apache Shiro是两个应用比较多的权限管理框架。Spring Security依赖Spring,其功能强大,相对于Shiro而言学习难度稍大一些。 Spring的强大是不言而喻的,可扩展性也很强,强大到用Spring家族的产品只要按照其推荐的做法来就非常非常简单,否则,自己去整合过程可能会很痛苦。 目前,我们项目是基于Spring Boot的,而且Spring Boot的权限管理也是推荐使用Spring Security的,所以再难也是要学习的。 Spring Security简介 Spring Security致力于为Java应用提供认证和授权管理。它是一个强大的,高度自定义的认证和访问控制框架。 具体介绍参见https://docs.spring.io/spring-security/site/docs/5.0.5.RELEASE/reference/htmlsingle/ 这句话包括两个关键词: Authentication(认证) 和 Authorization(授权,也叫访问控制)

.Net Core2.2 + EF Core + DI,三层框架项目搭建教程

一笑奈何 提交于 2020-05-08 18:55:49
笔记:   近两年.Net Core发展的很快,目前最新版为3.0预览版,之前在网上买了一本1.1版书籍都还没来得及看呢,估计现在拿出来看也毫无意义了。已多年.net工作经验,看书不如 直接 实际上手来得快,遇到问题再度娘吧。 正好最近公司不忙时,抽空亲手搭建 .Net Core项目熟悉一下,说起.net那最自豪的就是VS编译器了,强大的辅助功能很多中小型项目只需要下一步就可以创建完成。这里我们还需要简单封装一下,使用仓储模式对数据访问层封装和Service层封装,通过.net自带DI依赖注入进行创建对象。对于初学者的我只能简单的封装一下,接下来我会一一讲解框架的思路,如有更好的方案或不明的地方欢迎留言。转载请备注来源: https://www.cnblogs.com/han1982/p/11058788.html 下面是已搭建好的框架结构: 第一步:创建解决方案 使用Visual Studio 2019编译器创建解决方案,默认安装vs2019自带的.NET Core 2.1,创建.NET Core 2.2版需要下载SDK安装。 https://dotnet.microsoft.com/download/visual-studio-sdks?utm_source=getdotnetsdk&utm_medium=referral 接下来可以创建项目了,首先创建的是数据访问层