Basic‘ attribute type should not be a container解决方法

在使用Spring Data JPA的时候,实体类中定义一个用List修饰的成员ip,IDEA会提示Basic‘ attribute type should not be a container错误,导致编译不通过。

 

查阅一些博客和文档说是Spring Data JPA这个框架会把实体类的属性当做是MySQL数据库中的字段,但是MySQL数据库中又没得List属性,所以才会提示这个错误。

看了一下博客说添加变之间的关联关系如采用@OneToMany注解,这个我暂且没有试过,而且我用的字段不是涉及多个表关联,就是想单纯的从前端接收一个数组对象,所以就采用了@Transient注解的方式。

注解的方式

@Transient注释到实体类中的成员变量,意思是不会被Spring Data JPA框架序列化到数据库,单纯的作为一个临时字段,接收完数据后就暂且用不上了。

原文链接:‘Basic‘ attribute type should not be a container解决方法_basic' attribute type should not be a container-CSDN博客

### D3.js Linear Scale Function Usage and Examples In D3.js, `d3.scaleLinear()` creates a continuous quantitative scale with a linear mapping from numbers to numbers. This type of scale is particularly useful for visualizations where proportional relationships between data points need accurate representation. A linear scale can be created using: ```javascript const linearScale = d3.scaleLinear() .domain([minInputValue, maxInputValue]) .range([minOutputValue, maxOutputValue]); ``` The domain specifies the set of input values while the range defines corresponding output values. For instance, if plotting temperature over days on a graph, the domain might represent minimum and maximum temperatures observed during those days, whereas the range would correspond to pixel positions along an axis[^1]. To demonstrate how this works consider creating a simple SVG element representing a bar chart's height based upon some numeric value: ```html <svg width="200" height="200"></svg> <script src="https://d3js.org/d3.v7.min.js"></script> <script> const svg = d3.select('svg'); // Define scale properties. const minValue = 0; const maxValue = 100; const minBarHeight = 0; const maxBarHeight = 200; const linearScale = d3.scaleLinear() .domain([minValue, maxValue]) // Input values (data). .range([minBarHeight, maxBarHeight]); // Output values (pixels). // Create rectangle elements within SVG container. svg.append('rect') .attr('width', '50') // Width remains constant. .attr('height', `${linearScale(75)}px`) // Height determined by scaled value. .attr('fill', '#4CAF50'); // Color fill style attribute. </script> ``` This script sets up a basic visualization wherein a single rectangular shape represents a specific datum point transformed through scaling logic into graphical form suitable for display purposes. --related questions-- 1. How does changing the domain or range affect the outcome of a linear scale? 2. What other types of scales exist in D3 besides linear ones? 3. Can you provide additional examples demonstrating different applications of linear scales? 4. In what scenarios should one prefer non-linear scales over linear scales?
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

DN金猿

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值