persistence

Remember window positions in swing

若如初见. 提交于 2019-12-01 03:25:06
I have a pretty big swing application and i want to make it remember sizes of all windows, jframes etc. So if user resized window how he likes, next time the window looks exact the same way. Do i have a better option to solve it, but manually write the position/size of each window in Preferences ? Is there any convinient way to store the order of columns in JTable? May be some framework? Just don't want to write boilerplate. Serialization of the whole big app is unfortunately not an option. No, there isn't. Don't forget to write the bounds (position/size) of the main JFrame. And after

eclipselink PersistenceUnitLoadingEception in executable JAR

烂漫一生 提交于 2019-12-01 03:13:14
问题 I am developing a stand-alone java application which uses eclipselink. It is all fine when I execute the app from eclipse IDE. But I've exported an executable JAR file, and since than I can not make eclipseLink work. I have found similar issue in the Eclipse community forum here, but yet not too handy: Please help, My exception is the following: 01 dec. 2010 22:47:31,199 INFO Configuration:97 - Iniciate database Exception in thread "main" java.lang.reflect.InvocationTargetException at sun

Is there a bidirectional multimap persistent data structure?

不羁岁月 提交于 2019-12-01 02:07:46
问题 In other words, can we model many to many relationships in a persistent data structure efficiently? A pair of unidirectional multimaps was suggested. However, I'm not sure how this would work well for removal in a persistent data structure. Let's take the case where we have keys 1..4 to values "1".."4" and let's say they each refer to all the others, so we have two maps that look very similar for both directions: {1 => ["2","3","4"], 2 => ["1","3","4"], ...} {"1" => [2,3,4], "2" => [1,3,4], .

Persist collection in object with MyBatis

无人久伴 提交于 2019-12-01 01:15:53
问题 I have POJO classes: class Ticket { private int id; private double cost; private Date time; private List<Place> places; // Getters and setters here } class Place { private int row; private int place; // Getters and setters here } Then I create one ticket and some places: Ticket ticket = new Ticket(); ticket.setCost(58.7); ticket.setTime(new Date()); Place place1 = new Place(); place1.setRow(1); place1.setPlace(2); ticket.addPlace(place1); Place place2 = new Place(); place2.setRow(3); place2

How can I migrate the data from the iCloud store file to a new store file in local storage?

﹥>﹥吖頭↗ 提交于 2019-12-01 01:06:55
I have iCloud in my app. I've removed iCloud from my app, but on ios 6 app crashes and I get this message: -[NSPersistentStoreCoordinator addPersistentStoreWithType:configuration:URL:options:error:](1055): CoreData: Ubiquity: Error: A persistent store which has been previously added to a coordinator using the iCloud integration options must always be added to the coordinator with the options present in the options dictionary. If you wish to use the store without iCloud , migrate the data from the iCloud store file to a new store file in local storage. How can I solve this error? How can I

JPA query for getting the whole tree

牧云@^-^@ 提交于 2019-12-01 01:00:36
问题 I have a class which models all categories and they can be ordered hierarchically. @Entity @Table(name="categories") public class Category { @Id @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="sequence") @SequenceGenerator(name="sequence", sequenceName="categories_pk_seq", allocationSize=1) @Column(name="id") private Long id; @Column private String name; @OneToOne @JoinColumn(name="idfather") private Category father; } I need to get all categories ordered hierarchically (I mean

Persistence provider for Java that supports final fields

不问归期 提交于 2019-12-01 00:53:11
问题 I'm very new to Java but I've been developing a habit to use final wherever possible declaring immutability which i think is a good thing. (Consider f#) I've read that JPA does not support final fields. Hibernate, TopLink? I'm not sure about these but i prefer JPA for now. Is that even possible theoretically - let's say through reflection - to modify final fields after creation? My guess would be... NO :) What would be certainly possible for a persistence solution is to support constructors

Can I configure Hibernate/JPA to update an entity record when only non-timestamp fields have been modified?

旧街凉风 提交于 2019-12-01 00:46:16
At the moment I have an Hibernate entity class as follows: @Entity @Table(name = "entity") public class Entity implements Serializable { private static final long serialVersionUID = 2040757598327793105L; @Id @Column private int id; @Column private String data; @Column(name = "last_modified") @Temporal(TemporalType.TIMESTAMP) private Date lastModified; } I've found that even when the non-timestamp fields are not modified (i.e. the data field) a call to merge still updates the timestamp. I would like the timestamp to only update when other data fields have changed. Is there anyway I can prevent

Should the EnumDataTypeAttribute work correctly in .NET 4.0 using Entity Framework?

六月ゝ 毕业季﹏ 提交于 2019-12-01 00:19:48
I have an enumeration which I'd like to persist as a value of some sort into the underlying database so that I can bring it back and forth. I have read some articles that suggest to create a enumeration wrapper with static implicit operators defined, mapped using a ComplexType object mapping as described in the link below. How to fake Enums in EF4 This solution works flawlessly! My thanks to Alex James . Aside, I discovered of the EnumDataTypeAttribute Class which purpose seems to handle enums persistence through Entity Framework. I tried it and it doesn't seem to work at all. Here's a code

How can I access Java heap objects without a reference?

一笑奈何 提交于 2019-11-30 23:13:18
I would like to get a reference to all objects in the Java heap, even if I don't immediately have a reference to those objects in my active thread. I don't need non-referenced objects (those "queued" for garbage collection), but would like to get anything that's still in use. The goal is to serialize and store all the objects to implement a poor-man's persistence of execution state. I realize that the rabbit hole goes deep when it comes to different types of transient state, but simply persisting objects & loaded class definitions would be useful to me. Is there a way to access the heap in