English 中文(简体)
解放实体在除补贴以外的领域进行
原标题:Hibernate entity caching on a field other than the id

我有一个实体,拥有一个数据不全的主要(@Id)和一个独一无二但有意义的特性(存货Ticker)。 该实体的客户有时要求按“Id”标准,有时采用“TTicker”标准。 我也像海滩一样能够打上这两种标准。 @Id标准没有问题。 我可以想到2个办法,解决黑色袭击。 我可以建立一个单独的实体,将“Id”定在“Ticker”号仓库中,使第二层海滩能够使用。 或者,我可以转而处理问候。 我并不真的要谈谈问候,因为同一实体的“管理”中有其他实体,我并不真的希望。 因此,我不得不把这个问题分成一个单独的持续单位。 请说明其中一种做法是否正确,或是否有更好的选择。

@Entity
@Immutable
@Cache(usage= CacheConcurrencyStrategy.READ_ONLY)
@Table(name = "Security")
public class SecurityEntity {
    @Id
    private Integer id;
    private String stockTicker;
...
问题回答




相关问题
Write-though caching of large data sets in WCF?

We ve got a smart client that talks to a SQL Server database via WCF, displaying the entities in the database, and allowing the user to edit those entities. Some of the WCF calls return a large data ...

Clearing RSL in Cache

I have built a flex application which has a "main" project and it is assosciated with a few RSL s which are loaded and cached once i run my "main" application. The problem i am facing is that the ...

how to tell clicking "back" to load cache?

I would like for my site when someone clicks "Back" or "Forward" for the server to tell the browser to load the cache instead of reloading the entire page. I ve tested some headers and done research, ...

java plugin cache and dynamic IP host

I m trying to use Amazon S3 and Amazon Cloudfront CDN to deliver the jar files of my applet application. I m seeing several cache misses of my jars by the java plugin. This is a show-stopper for me, ...

Frequently Used metadata Hashmap

Are there any implementations of a static size hashtable that limits the entries to either the most recently or most frequently used metadata? I would prefer not to keep track of this information ...

PHP - Memcache - HTML Caching

I would like to create a caching system that will bypass some mechanisms in order to improve the performance. I have some examples: 1-) I have a dynamic PHP page that is updated every hour. The page ...

Performance of Sql subqueriesfunctions

I am currently working on a particularly complex use-case. Simplifying below :) First, a client record has a many-to-one relationship with a collection of services, that is, a single client may have ...

热门标签