What is the default value of    hibernate.hbm2ddl.auto   in hibernate cfg file mapping   is it possible to remove   &lt;property name="hibernate.hbm2ddl.auto"&gt;update&lt;/property&gt;   this mapping from config file   if i remove this property whether it affect my DB  ???
24768
I really want to know more about the update, export and the values that could be given to hibernate.hbm2ddl.auto I need to know when to use the update and when not? And what is the alternative?  These are changes that could happen over DB:   new tables new columns in old tables columns deleted data type of a column changed a type of a column changed its attributes tables dropped values of a column changed    In each case what is the best solution?
18644
I have a table which contains an auto incremented primary key id. If I delete the last row (highest id, for exampe id = 6) and insert a new row, the new id starts at 7. Which paramater I have to change that the primary key starts at 6?  CREATE TABLE animals (  id MEDIUMINT NOT NULL AUTO_INCREMENT,  name CHAR(30) NOT NULL,  PRIMARY KEY (id) ) ENGINE=MyISAM;  INSERT INTO animals (name) VALUES ('dog'),('cat'),('penguin'), ('lax'),('whale'),('ostrich');   Result: id  name 1   dog 2   cat 3   penguin 4   lax 5   whale 6   ostrich    DELETE FROM animals WHERE id = 6; INSERT INTO animals (name) VALUES ('x');   Result: id  name 1   dog 2   cat 3   penguin 4   lax 5   whale 7   x    Thanks for advice.
31523
I'm extending a class (ArrayBlockingQueue) that implements the . Sun's documentation (and my IDE) advises me that I should set this value in order to prevent mischief:     However, it is strongly recommended that all serializable classes explicitly declare serialVersionUID values, since the default serialVersionUID computation is highly sensitive to class details that may vary depending on compiler implementations, and can thus result in unexpected InvalidClassExceptions during deserialization.   Now, I couldn't care less about what value to put in there. Does it matter?
12090
I need to convert a named instance of SQL server 2005, to a default instance.  Is there a way to do this without a reinstall?    The problem is, 2 out of 6 of the developers, installed with a named instance. So its becoming a pain changing connection strings for the other 4 of us. I am looking for the path of least resistance to getting these 2 back on to our teams standard setup.    Each has expressed that this is going to be, too much trouble and that it will take away from their development time. I assumed that it would take some time to resolve, in the best interest of all involved, I tried combing through configuration apps installed and didn't see anything, so I figured someone with more knowledge of the inner workings would be here.
74052
I have lots of schemas and tables. I want to generate create script of all of my tables. I am using below statement and it is working pretty well.  SELECT DBMS_METADATA.GET_DDL('TABLE','table_name','schema') FROM DUAL   But this statement also generates all primary and foreign key scripts that belong to table. So, is there any way to not include primary and foreign keys in create table scripts
31361
Is there a way to configure a password for a stored session in ?  I know there is the capability to specify an "auto-login username" (under Connection/Data), but is there a way to do the same with the password?
3723
I'm trying to perform the following multilevel relationship query.   SELECT ID, SystemModstamp, Product__r.Catalog__r.Active__c  FROM Journal__c      WHERE SystemModstamp &gt; 2013-10-02T00:00:00.000+0000  AND SystemModstamp &lt; 2013-10-05T00:00:00.000+0000    In the Product__r.Catalog__r.Active__c column I'm getting a value of [object Object] for every single record. I can substitute any field name from the Catalog__c object and get the same response. Does anyone know why this is happening or how to get the field's actual value?
89337
I am interested to know what methods other people are using to keep track of changes made to the database including table definition changes, new objects, packages changes, etc.  Do you use flat files with an external version control system?  Triggers? Other software?
48895
I want to store user id in custom session variable and use it (read) in trigger procedures to authorize user actions. I found something like this:  set session "myapp.user" = '12345'; ... SELECT current_setting('myapp.user');   and it seems to work - I thought that "myapp.user" should be declared in .conf file but it seems that I can create session variables on the fly (I didn't change .conf file at all).  Is there any disadvantage of doing like this?
109033
In mysql, how do I get the primary key used for an insert operation, when it is autoincrementing.  Basically, i want the new autoincremented value to be returned when the statement completes.  Thanks!
3563
I need a way to keep auto-increment counter between mysql service restart.   As docs states by default after restart mysql autoincrement counter start from max(id)+1. How can I keep the last autoincrement value?  This is a big problem for me. I'm using envers to keep entities audits. I get as many errors as many "last rows" I delete.  Suppose I'm starting insert data into an empty table. Suppose to insert 10 rows. Then suppose to delete the last 8. In my table I will have as result 2 entities, with id 1 and 2 respectively. In the audit table I will have all 10 entities, with id from 1 to 10: entities with id from 3 to 10 will have 2 action: create action and delete action.  auto-increment counter is now setted to 11 in main table. Restarting mysql service auto-increment counter goes to 3. So if I insert a new entity, it will be saved with id 3. But in audit table there is already an entity with id = 3. That entity is already marked as created and deleted. It result in an assertion failure during update /delete action because envers cannot handle this inconsistent state.  Thanks
25708
I thought that the quotation mark (") was simply a type of grouping marker but I'm debugging some NHibernate code and notice that while  SELECT * FROM site WHERE site_id = 3;   Works fine  SELECT * FROM "site" WHERE site_id = 3;   fails with a table or view does not exist error.  What gives?
76601
When the standard Name field of an object is set as Text, it shows a weird behavior if left empty. It is not possible to mark it as required or non-required, but when editing a record from its standard edit page, the field is required:    No problem so far: the field is required in any case. The problem arises when it comes to insertion from code. If we insert a record from code:  CustomObject__c r = new CustomObject__c(); insert r;   ... we get no error. Instead, the record is inserted with the short, 15-character Id copied into its Name field. What I would expect is an exception with the same error that we've got in the standard edit page.  This problem does not occur with custom fields: if a custom field is marked as required, it will be so both in the standard edit page and from code.  I did not find any mention to this on documentation. Is this behavior new in Spring'14? Has any of you found this same problem before?
46572
I want to compare the current value of an in-memory Hibernate entity with the value in the database:  HibernateSession sess = HibernateSessionFactory.getSession(); MyEntity newEntity = (MyEntity)sess.load(MyEntity.class, id); newEntity.setProperty("new value"); MyEntity oldEntity = (MyEntity)sess.load(MyEntity.class, id); // CODEBLOCK#1 evaluate differences between newEntity and oldEntity sess.update(newEntity);       In CODEBLOCK#1 I get that newEntity.getProperty()="new value" AND oldEntity.getProperty()="new value" (while I expected oldEntity.getProperty()="old value", of course). In fact the two objects are exactly the same in memory.  I messed around with HibernateSessionFactory.getSession().evict(newEntity) and attempted to set oldEntity=null to get rid of it (I need it only for the comparison):  HibernateSession sess = HibernateSessionFactory.getSession(); MyEntity newEntity = (MyEntity)sess.load(MyEntity.class, id); newEntity.setProperty("new value"); HibernateSessionFactory.getSession().evict(newEntity); MyEntity oldEntity = (MyEntity)sess.load(MyEntity.class, id); // CODEBLOCK#1 evaluate differences between newEntity and oldEntity oldEntity = null; sess.update(newEntity);   and now the two entities are distinct, but of course I get the dreaded org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session.  Any idea?  EDIT: I tried the double session strategy; I modified my HibernateSessionFactory to implement a map of session and then...  Session session1 = HibernateSessionFactory.getSession(SessionKeys.DEFAULT); Session session2 = HibernateSessionFactory.getSession(SessionKeys.ALTERNATE); Entity newEntity = (Entity)entity; newEntity.setNote("edited note"); Entity oldEntity = (Entity)session1.load(Entity.class, id);  System.out.println("NEW:" + newEntity.getNote()); System.out.println("OLD: " + oldEntity.getNote()); // HANGS HERE!!!  HibernateSessionFactory.closeSession(SessionKeys.ALTERNATE);   My unit test hangs while attempting to print the oldEntity note... :-(
54399
I have a junction table like this:  CREATE TABLE `entitytagjunction` (      `EntityId` bigint(20) NOT NULL,      `TagId` bigint(20) NOT NULL,       PRIMARY KEY (`EntityId`,`TagId`),      KEY `IX_EntityId` (`EntityId`) USING HASH,      KEY `IX_TagId` (`TagId`) USING HASH,       CONSTRAINT `FK_EntityTagJunction_Entities_EntityId`          FOREIGN KEY (`EntityId`) REFERENCES `entities` (`Id`)          ON DELETE CASCADE ON UPDATE CASCADE,      CONSTRAINT `FK_EntityTagJunction_Tags_TagId`          FOREIGN KEY (`TagId`) REFERENCES `tags` (`Id`)          ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8;   I have EntityId and TagId as composite primary key to ensure uniqueness, and SQL Server and MySql will both use the primary key as clusteredId.   As far as I could read from the other posts, Guid is not good to be a primary key because the randomness make fragments for clusteredIds, poor for performance if the table consist of millions of rows. Apparently the combination of EntityId and TagId has some randomness. Will this have impact on performance when using them as a composite primary key and clusteredId by default? or should I add an int column as a surrogate primary key though it will not be used in applications?
119372
I am very, very new to MYSQL.I tried to create a table named "option". My SQL Query is :  create table option(   id int not null primary key auto_increment,  choice varchar(30)  )  While executing this query it shows the following error  Error Code : 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'option( id int not null primary key auto_increment, choice varchar(30) )' at line 1 (0 ms taken)  If I try with the table name as "choice" it is working.  can we have the table name as "option" in mysql?   thanks
69645
Our production environment just froze* this morning for a while when altering a table, adding a column actually.   Offending SQL:ALTER TABLE cliente ADD COLUMN topicos character varying(20)[];  * Login into our system requires a select from that very same table, so no one could login during the alter table. We actually had to kill the process to allow the system resume normal operations.    Table Structure:   CREATE TABLE cliente (   rut character varying(30) NOT NULL,   nombre character varying(150) NOT NULL,   razon_social character varying(150) NOT NULL,   direccion character varying(200) NOT NULL,   comuna character varying(100) NOT NULL,   ciudad character varying(100) NOT NULL,   codigo_pais character varying(3) NOT NULL,   activo boolean DEFAULT true,   id serial NOT NULL,   stock boolean DEFAULT false,   vigente boolean DEFAULT true,   clase integer DEFAULT 1,   plan integer DEFAULT 1,   plantilla character varying(15) DEFAULT 'WAYPOINT'::character varying,   facturable integer DEFAULT 1,   toolkit integer DEFAULT 0,   propietario integer DEFAULT 0,   creacion timestamp without time zone DEFAULT now(),   codelco boolean NOT NULL DEFAULT false,   familia integer DEFAULT 0,   enabled_machines boolean DEFAULT false,   enabled_canbus boolean DEFAULT false,   enabled_horometro boolean DEFAULT false,   enabled_comap boolean DEFAULT false,   enabled_frio boolean DEFAULT false,   enabled_panico boolean DEFAULT false,   enabled_puerta boolean DEFAULT false,   enabled_rpm boolean DEFAULT false,   enabled_supervisor integer DEFAULT 0,   demo boolean,   interno boolean,   mqtt_enable boolean NOT NULL DEFAULT false,   topicos character varying(20)[],   CONSTRAINT pk_cliente PRIMARY KEY (rut),   CONSTRAINT fk_cliente_familiaid FOREIGN KEY (familia)       REFERENCES cliente_familia (id) MATCH SIMPLE       ON UPDATE NO ACTION ON DELETE NO ACTION,   CONSTRAINT pk_pais FOREIGN KEY (codigo_pais)       REFERENCES pais (codigo) MATCH SIMPLE       ON UPDATE NO ACTION ON DELETE NO ACTION,   CONSTRAINT unique_id_cliente UNIQUE (id) ) WITH (   OIDS=FALSE ); ALTER TABLE cliente   OWNER TO waypoint; GRANT ALL ON TABLE cliente TO waypoint; GRANT ALL ON TABLE cliente TO waypointtx; GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE cliente TO waypointtomcat; GRANT SELECT ON TABLE cliente TO waypointphp; GRANT SELECT ON TABLE cliente TO waypointpphppublic; GRANT ALL ON TABLE cliente TO waypointsoporte; GRANT SELECT, INSERT ON TABLE cliente TO waypointsalesforce; GRANT SELECT ON TABLE cliente TO waypointadminuser; GRANT SELECT ON TABLE cliente TO waypointagenda; GRANT SELECT ON TABLE cliente TO waypointmachines; GRANT SELECT ON TABLE cliente TO waypointreports; GRANT SELECT ON TABLE cliente TO readonly;  CREATE INDEX index_cliente   ON cliente   USING btree   (rut COLLATE pg_catalog."default");  CREATE INDEX index_cliente_activo   ON cliente   USING btree   (activo);  CREATE INDEX index_cliente_id_activo   ON cliente   USING btree   (id, activo);  CREATE INDEX index_cliente_rut_activo   ON cliente   USING btree   (rut COLLATE pg_catalog."default", activo);   CREATE TRIGGER trigger_default_admin   AFTER INSERT   ON cliente   FOR EACH ROW   EXECUTE PROCEDURE crea_default_admin();  CREATE TRIGGER trigger_default_grupo   AFTER INSERT   ON cliente   FOR EACH ROW   EXECUTE PROCEDURE crea_default_clientegrupo();     Should I disable CONSTRAINTS, TRIGGERS, or something else?  Perhaps any DB Tuning?  What else should I provide for further analysis?  Version: PostgreSQL 9.4.5 on x86_64-unknown-linux-gnu, compiled by gcc (Debian 4.9.2-10) 4.9.2, 64-bit